Skip to content

Commit

Permalink
Add note about disabling stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
simurai committed Apr 6, 2021
1 parent 7a29f79 commit 958d04e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/content/getting-started/theming.md
Expand Up @@ -159,4 +159,18 @@ The benefit of `auto` over the `scale` variables is that `auto` variables automa
<style>code { margin-right: 16px; }</style>
```

In general, use `auto` variables if the results give enough constrast or create custom variables for further fine tuning.
**Note**: If you use `stylelint`, the [`primer/no-scale-colors`](https://github.com/primer/stylelint-config-primer/tree/main/plugins#primerno-scale-colors) will fail with "[variable] is a non-functional scale color and cannot be used without being wrapped in the color-variables mixin". You can disable stylelint for this case by adding `// stylelint-disable-line`:

```scss
.my-class {
color: var(--color-auto-gray-7); // stylelint-disable-line
}
```

---

In general,

1. use [functional variables](/support/color-system) as much as possible.
2. create new [custom color variables](/getting-started/theming#custom-color-variables) if there is no functional variable that fits the use case.
3. as an alternaitve to custom color variables, use [`auto` variables](/getting-started/theming#auto-variables) if the results give enough constrast.

0 comments on commit 958d04e

Please sign in to comment.