Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass issues #82

Closed
XhmikosR opened this issue Oct 30, 2017 · 6 comments
Closed

Sass issues #82

XhmikosR opened this issue Oct 30, 2017 · 6 comments

Comments

@XhmikosR
Copy link

XhmikosR commented Oct 30, 2017

Hi @alecthomas.

I'm in the process of switching Bootstrap docs to Hugo with chroma as the highlighter.

It works well generally except for these 2 issues:

  1. the HTML < and > aren't the same color as the keyword. Compared to what we have now with Rouge, not sure which is right, or if this is a bug. Maybe I just need to update our highlighting script to include the p class. So that .nt, .p use the same style; please confirm if this affects more styles
  2. When highlighting scss sometimes I get no highlighting. Example:
\```scss
.selector-for-some-widget {
  box-sizing: content-box;
}
\```

results in:

<div class="highlight"><pre class="chroma"><code class="language-scss" data-lang="scss">.selector-for-some-widget {
  box-sizing: content-box;
}</code></pre></div>

Now this example is pure CSS but it's also valid scss syntax so it should be highlighted.

Another example is this:

\```scss
$font-family-sans-serif:
  // Safari for OS X and iOS (San Francisco)
  -apple-system,
  // Chrome < 56 for OS X (San Francisco)
  BlinkMacSystemFont,
  // Windows
  "Segoe UI",
  // Android
  "Roboto",
  // Basic web fallback
  "Helvetica Neue", Arial, sans-serif,
  // Emoji fonts
  "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
\```

I'm not sure if I'm missing something since this is still a work in progress, but I'd expect these to work.

Let me know if you need more info.

Thanks!

PS. I added the backslashes so that GitHub markdown doesn't break; they are not present in my markdown.

@danielpost
Copy link

danielpost commented Nov 8, 2017

I’m having the same issue. css works fine but sass or scss don’t. Any ideas?

@alecthomas
Copy link
Owner

scss is not supported. The lexer will need to be imported from Pygments. sass should be, to some degree, though I'm not sure how robust it is.

@alecthomas
Copy link
Owner

I imported the scss lexer from Pygments. Give it a shot.

@danielpost
Copy link

Thanks @alecthomas! I'm using Chroma through Hugo (static site generator) so I think I need to wait until the update gets implemented there? cc @bep @spf13

@alecthomas
Copy link
Owner

Ah yes. You can probably update the vendored version to test it if you're keen.

@danielpost
Copy link

I'll give it a shot. Thanks for the quick response and update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants