From 08884f3b6d119ea871f47053716e40a300ac27a1 Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Tue, 14 Apr 2026 12:30:05 +0200 Subject: [PATCH] refactor(css): track use of undeclared CSS variables --- .github/workflows/ci.yml | 10 +++++++++- .stylelintrc.json | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28a11835..553f064e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,16 @@ jobs: with: node-version: 25 + # because we are not using package.json + - name: Install Stylelint and plugins + run: | + npm install --global \ + stylelint@17 \ + postcss@8 \ + stylelint-value-no-unknown-custom-properties@6 + - name: Run Stylelint - run: npx stylelint "**/*.{css,scss}" + run: npx stylelint "static/css/**/*.{css,scss}" rust-fmt: name: Rustfmt diff --git a/.stylelintrc.json b/.stylelintrc.json index 30a46514..e802f384 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,13 +1,22 @@ { + "files": ["statc/css/**/*.css"], + "plugins": [ + "stylelint-value-no-unknown-custom-properties" + ], "rules": { "color-no-hex": true, "color-named": "never", "function-disallowed-list": ["rgb", "rgba", "hsl", "hsla", "hwb", "oklch", "oklab"], - "selector-disallowed-list": ["/\\[data-theme/"] + "selector-disallowed-list": ["/\\[data-theme/"], + "csstools/value-no-unknown-custom-properties": [true, { + "importFrom": [ + "static/css/base/variables.css" + ] + }] }, "overrides": [ { - "files": ["**/variables.css"], + "files": ["static/css/base/variables.css"], "rules": { "color-no-hex": null, "color-named": null, @@ -15,7 +24,7 @@ } }, { - "files": ["**/themes/dark.css"], + "files": ["static/css/themes/*"], "rules": { "color-no-hex": null, "color-named": null,