Skip to content

Commit f788608

Browse files
authored
docs: Updated CSS Support blog post (#828)
* docs: Updated CSS Support blog post Updated code examples to match current version requirements Fixes #800 * Updated with PR suggestion.
1 parent b09357c commit f788608

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/_data/blog-dates.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@
420420
"2025-01-28-differences-between-eslint-and-typescript.md": "2025-01-21T17:19:50.000Z",
421421
"2025-02-07-eslint-v9.20.0-released.md": "2025-02-07T22:26:50.000Z",
422422
"2025-02-11-eslint-v9.20.1-released.md": "2025-02-11T17:19:27.000Z",
423-
"2025-02-18-eslint-css-support.md": "2025-02-18T16:48:43.000Z",
423+
"2025-02-18-eslint-css-support.md": "2025-10-30T17:11:37.089Z",
424424
"2025-02-21-eslint-v9.21.0-released.md": "2025-02-21T22:24:14.000Z",
425425
"2025-03-07-eslint-v9.22.0-released.md": "2025-03-07T22:01:00.000Z",
426426
"2025-03-07-flat-config-extends-define-config-global-ignores.md": "2025-03-09T18:20:28.000Z",

src/content/blog/2025-02-18-eslint-css-support.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ export default [
127127
];
128128
```
129129

130-
If you're using [Tailwind](https://tailwindcss.com), you can configure most of the custom syntax using the builtin `tailwindSyntax` object, like this:
130+
If you're using [Tailwind](https://tailwindcss.com), you can configure the custom syntax using [`tailwind-csstree`](https://www.npmjs.com/package/tailwind-csstree), like this:
131131

132132
```js
133133
import css from "@eslint/css";
134-
import { tailwindSyntax } from "@eslint/css/syntax";
134+
import { tailwind4 } from "tailwind-csstree";
135135

136136
export default [
137137
{
@@ -141,7 +141,7 @@ export default [
141141
},
142142
language: "css/css",
143143
languageOptions: {
144-
customSyntax: tailwindSyntax,
144+
customSyntax: tailwind4,
145145
},
146146
rules: {
147147
"css/no-empty-blocks": "error",
@@ -150,8 +150,6 @@ export default [
150150
];
151151
```
152152

153-
**Note:** The Tailwind syntax doesn't currently provide for the `theme()` function. This is a limitation of CSSTree that we hope will be resolved soon.
154-
155153
## Creating custom rules and using Code Explorer
156154

157155
As with `@eslint/json` and `@eslint/markdown`, `@eslint/css` allows the creation of custom rules. Using the [CSSTree AST format](https://github.com/csstree/csstree/blob/master/docs/ast.md), you can create your own rules in the same way you would for JavaScript. [Code Explorer](https://explorer.eslint.org) now supports CSS parsing and is a great resource to get started creating your own rules.

0 commit comments

Comments
 (0)