rtts / djhtml

Django/Jinja template indenter
GNU General Public License v3.0
582 stars 32 forks source link

SCSS file wrong idention with @font-face #90

Closed GitRon closed 1 year ago

GitRon commented 1 year ago

Hi @JaapJoris

I updated to the 3.0.4 version and now get this odd behaviour 😅

@font-face {
  font-family: 'proxima nova light';
  src: url(static://fonts/proxima-nova-light.otf);
  }

       @font-face {
    font-family: 'proxima nova s';
    src: url(static://fonts/ProximaNovaS-Bold.eot);
      src: url(static://fonts/ProximaNovaS-Bold.eot?#iefix) format('embedded-opentype'),
        url(static://fonts/ProximaNovaS-Bold.woff2) format('woff2'),
          url(static://fonts/ProximaNovaS-Bold.woff) format('woff'),
            url(static://fonts/ProximaNovaS-Bold.ttf) format('truetype'),
              url(static://fonts/ProximaNovaS-Bold.svg#ProximaNovaS-Bold) format('svg');
                font-weight: bold;
                font-style: normal;
              }

grafik

Best from Cologne
Ronny

JaapJoris commented 1 year ago

Hi there. Could you please, please, not post screenshots of text, but the text instead?

GitRon commented 1 year ago

Haha, sorry, wanted to point out the difference. Will add the code tomorrow.

GitRon commented 1 year ago

Updated my post. 👍

JaapJoris commented 1 year ago

Thanks, I see now what the problem is. DjCSS interprets the everything following the // as a comment:

@font-face {
  font-family: 'proxima nova light';
  src: url(static: // fonts/proxima-nova-light.otf);
  }

Enclosing the URL in quotes fixes this:

@font-face {
  font-family: 'proxima nova light';
  src: url('static://fonts/proxima-nova-light.otf');
}

Nevertheless, I'll add an exception to not treat // inside URLs as comments.

GitRon commented 1 year ago

Awesome, it works! Thx again!