From e970b477205ea02dc96c67dac19bbc36660aab85 Mon Sep 17 00:00:00 2001 From: Ku6epXBOCTuK Date: Thu, 10 Sep 2026 15:08:56 +0500 Subject: [PATCH] refactor: set root layout, rename css, fix links in lint rules \ etc --- .../design-tokens/no-hardcoded-in-svelte.js | 4 +- .../no-token-definition-in-svelte.js | 4 +- .../design-tokens/no-undefined-in-svelte.js | 8 +-- web/eslint-plugins/index.js | 2 +- web/postcss.config.js | 4 +- web/scripts/check-tokens.mjs | 6 +- web/scripts/token-audit/colors.mjs | 2 +- web/scripts/token-audit/helpers.mjs | 6 +- web/scripts/token-audit/unused.mjs | 2 +- web/src/{preview.css => app.css} | 0 web/src/{old.css => app_v1.css} | 0 web/src/lib/palette.test.ts | 2 +- web/src/routes/+layout.svelte | 60 ++++++++++++++++--- web/src/routes/preview/+layout.svelte | 2 +- web/src/routes/v1/+layout.svelte | 2 +- web/stylelint.config.js | 6 +- 16 files changed, 76 insertions(+), 34 deletions(-) rename web/src/{preview.css => app.css} (100%) rename web/src/{old.css => app_v1.css} (100%) diff --git a/web/eslint-plugins/design-tokens/no-hardcoded-in-svelte.js b/web/eslint-plugins/design-tokens/no-hardcoded-in-svelte.js index d652078..70cda6e 100644 --- a/web/eslint-plugins/design-tokens/no-hardcoded-in-svelte.js +++ b/web/eslint-plugins/design-tokens/no-hardcoded-in-svelte.js @@ -37,9 +37,9 @@ export default { hardcodedZIndex: "Hardcoded z-index '{{value}}'. Use a var(--z-...) token.", hardcodedBreakpoint: - "Hardcoded breakpoint '{{value}}' in @media. Use the @custom-media name instead: declare `@custom-media --bp-* (...)` in preview.css and write `@media (--bp-*)`.", + "Hardcoded breakpoint '{{value}}' in @media. Use the @custom-media name instead: declare `@custom-media --bp-* (...)` in app.css and write `@media (--bp-*)`.", varInMedia: - "var() inside @media '{{value}}'. Custom properties do not resolve in media queries — declare `@custom-media --bp-* (...)` in preview.css and use `@media (--bp-*)`.", + "var() inside @media '{{value}}'. Custom properties do not resolve in media queries — declare `@custom-media --bp-* (...)` in app.css and use `@media (--bp-*)`.", colorMix: "color-mix() in component ({{value}}). Tokenize the result in the design CSS file.", }, diff --git a/web/eslint-plugins/design-tokens/no-token-definition-in-svelte.js b/web/eslint-plugins/design-tokens/no-token-definition-in-svelte.js index 4d67fa2..2aec0ba 100644 --- a/web/eslint-plugins/design-tokens/no-token-definition-in-svelte.js +++ b/web/eslint-plugins/design-tokens/no-token-definition-in-svelte.js @@ -2,7 +2,7 @@ // A custom property may be DEFINED inside a component's diff --git a/web/src/routes/preview/+layout.svelte b/web/src/routes/preview/+layout.svelte index 0ac3488..880bfdd 100644 --- a/web/src/routes/preview/+layout.svelte +++ b/web/src/routes/preview/+layout.svelte @@ -3,7 +3,7 @@ import Footer from "$lib/components/kit/layout/Footer.svelte"; import TopBar from "$lib/components/kit/layout/TopBar.svelte"; import type { Snippet } from "svelte"; - import "../../preview.css"; + import "../../app.css"; interface Props { children: Snippet; diff --git a/web/src/routes/v1/+layout.svelte b/web/src/routes/v1/+layout.svelte index b4517cc..c7e7543 100644 --- a/web/src/routes/v1/+layout.svelte +++ b/web/src/routes/v1/+layout.svelte @@ -6,7 +6,7 @@ import { t } from "$lib/i18n/t"; import { getTheme, initTheme, setTheme } from "$lib/theme.svelte"; import { onMount } from "svelte"; - import "../../old.css"; + import "../../app_v1.css"; let { children } = $props(); diff --git a/web/stylelint.config.js b/web/stylelint.config.js index 4ffd6b1..80c75a7 100644 --- a/web/stylelint.config.js +++ b/web/stylelint.config.js @@ -1,12 +1,12 @@ // Stylelint config — design-token enforcement for easy-png-tools. // FWHM: keeps the design system a single source of truth. Colors and sizes must // come from prefixed tokens; direct color values are allowed only for the two -// brand tokens. old.css is the legacy design and is ignored (removed later). +// brand tokens. app_v1.css is the legacy design and is ignored (removed later). export default { extends: ["stylelint-config-standard"], ignoreFiles: [ - "src/old.css", + "src/app_v1.css", "**/node_modules/**", "**/build/**", "**/.svelte-kit/**", @@ -52,7 +52,7 @@ export default { }, overrides: [ { - // Applies to every CSS file EXCEPT old.css (already in ignoreFiles) — + // Applies to every CSS file EXCEPT app_v1.css (already in ignoreFiles) — // the legacy design is exempt and will be removed later. files: ["src/**/*.css"], rules: {