Skip to content

Commit 981f1ad

Browse files
committed
chore(docs): align Tailwind usage with official documentation in docs and Stylelint config
1 parent db51994 commit 981f1ad

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

COLLABORATOR_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ Finally, if you're unfamiliar with how to use Tailwind or how to use Tailwind wi
187187
#### Guidelines when writing CSS
188188

189189
- We use camelCase for defining CSS classes
190-
- We use Tailwind's `@apply` selector to apply Tailwind Tokens
190+
- We use Tailwind's `@apply` selector to apply Tailwind utility classes
191191
- We discourage the usage of any plain CSS styles and tokens, when in doubt ask for help
192-
- We require that you define one Tailwind Token per line, just as shown on the example above, since this improves readability
192+
- We require that you define one Tailwind utility class per line, just as shown on the example above, since this improves readability
193193
- Only write CSS within CSS Modules, avoid writing CSS within JavaScript files
194194

195195
> \[!NOTE]\
196196
> Tailwind is already configured for this repository. You don't need to import any Tailwind module within your CSS module.\
197-
> You can apply Tailwind Tokens with Tailwind's `@apply` CSS rule. [Read more about applying Tailwind classes with `@apply`](https://tailwindcss.com/docs/functions-and-directives#apply).
197+
> You can apply Tailwind utility classes with Tailwind's `@apply` CSS rule. [Read more about applying Tailwind utility classes with `@apply`](https://tailwindcss.com/docs/functions-and-directives#apply).
198198
199199
> \[!IMPORTANT]\
200200
> When using IDEs such as Visual Studio Code, we recommend installing the official [Stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)

apps/site/.stylelintrc.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
plugins: [
2727
'stylelint-order',
2828
'stylelint-selector-bem-pattern',
29-
'@node-core/ui-components/stylelint/one-mixin-per-line.mjs',
29+
'@node-core/ui-components/stylelint/one-utility-class-per-line.mjs',
3030
],
3131
rules: {
3232
// Enforces Element Class Names to be camelCase
@@ -49,6 +49,6 @@ export default {
4949
'import-notation': 'string',
5050
// Allow the `@apply` at rule as its part of Tailwind
5151
'at-rule-no-deprecated': [true, { ignoreAtRules: CUSTOM_AT_RULES }],
52-
'nodejs/one-mixin-per-line': true,
52+
'nodejs/one-utility-class-per-line': true,
5353
},
5454
};

packages/ui-components/.stylelintrc.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
plugins: [
2727
'stylelint-order',
2828
'stylelint-selector-bem-pattern',
29-
'./stylelint/one-mixin-per-line.mjs',
29+
'./stylelint/one-utility-class-per-line.mjs',
3030
],
3131
rules: {
3232
// Enforces Element Class Names to be camelCase
@@ -49,7 +49,7 @@ export default {
4949
'import-notation': 'string',
5050
// Allow the `@apply` at rule as its part of Tailwind
5151
'at-rule-no-deprecated': [true, { ignoreAtRules: CUSTOM_AT_RULES }],
52-
'nodejs/one-mixin-per-line': true,
52+
'nodejs/one-utility-class-per-line': true,
5353
// We need complex `:not()` for headings with anchor
5454
'selector-not-notation': null,
5555
},

packages/ui-components/stylelint/one-mixin-per-line.mjs renamed to packages/ui-components/stylelint/one-utility-class-per-line.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ const {
77
utils: { report, ruleMessages },
88
} = stylelint;
99

10-
const name = 'nodejs/one-mixin-per-line';
10+
const name = 'nodejs/one-utility-class-per-line';
1111

1212
const messages = ruleMessages(name, {
13-
className: tokens =>
14-
`Each line should contain only one Tailwind token; "${tokens}"`,
15-
spacing: tokens =>
16-
`Each class used with @apply should be indented by 2 spaces on a new line; ${tokens}`,
13+
className: classNames =>
14+
`Each line should contain only one Tailwind utility class; "${classNames}"`,
15+
spacing: classNames =>
16+
`Each utility class used with @apply should be indented by 2 spaces on a new line; ${classNames}`,
1717
});
1818

1919
const meta = {

0 commit comments

Comments
 (0)