Skip to content

Commit

Permalink
docs(sass): mention sass syntax weirdness
Browse files Browse the repository at this point in the history
Co-authored-by: sgoudham <sgoudham@gmail.com>
  • Loading branch information
nekowinston and sgoudham committed Aug 14, 2022
1 parent 594ccd1 commit aaa247a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,24 @@ Output:
Another way to create all four flavours, in a single file, from a single file,
is to use `_catppuccin.scss`.

**NB**: Due to websafe colours being predefined in CSS, colours like `red`, `green`, `blue` will **not** be generated with this method, **when they are not** explicitly cast as a string. To ensure proper generation, wrap your values with `'`.

In short:\
❌ Don't do this:
`#{map-get($color, blue)}`\
✅ Do this:
`#{map-get($color, 'blue')}`

Input:

```scss
@use "catppuccin";

@each $flavour, $colour in catppuccin.$palette {
.my-#{flavour}-class {
background: map-get($colour, base);
color: map-get($colour, text);
// you need surround the catppuccin colour names with quotes
background: map-get($colour, 'base');
color: map-get($colour, 'blue');
}
}
```
Expand Down

0 comments on commit aaa247a

Please sign in to comment.