@seyuna/postcss 1.0.0-canary.28 → 1.0.0-canary.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/at-rules/config.js +3 -1
- package/package.json +1 -1
- package/src/at-rules/config.ts +3 -1
- package/tests/plugin.test.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.0.0-canary.29](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.28...v1.0.0-canary.29) (2026-01-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* allow mode-specific fixed color overrides in [@config](https://github.com/config) ([d41de2b](https://github.com/seyuna-corp/seyuna-postcss/commit/d41de2b4ef1f0d04ccd14584bcc150d21f9bbfcd))
|
|
7
|
+
|
|
1
8
|
# [1.0.0-canary.28](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.27...v1.0.0-canary.28) (2026-01-21)
|
|
2
9
|
|
|
3
10
|
|
package/dist/at-rules/config.js
CHANGED
|
@@ -58,8 +58,10 @@ export function handleConfig(atRule, context) {
|
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
60
|
// Custom colors in palette: --light-surface: 1 0 0;
|
|
61
|
+
// Also supports overrides like --light-color-primary: 0.8 0.1 240;
|
|
62
|
+
const cleanKey = key.replace(/^color-/, "");
|
|
61
63
|
const [l, c, h] = value.split(/\s+/).map(parseFloat);
|
|
62
|
-
palette.colors[
|
|
64
|
+
palette.colors[cleanKey] = { lightness: l, chroma: c, hue: h };
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
});
|
package/package.json
CHANGED
package/src/at-rules/config.ts
CHANGED
|
@@ -64,8 +64,10 @@ export function handleConfig(atRule: any, context: PluginContext) {
|
|
|
64
64
|
(palette as any)[key] = { lightness: l, chroma: c, hue: h };
|
|
65
65
|
} else {
|
|
66
66
|
// Custom colors in palette: --light-surface: 1 0 0;
|
|
67
|
+
// Also supports overrides like --light-color-primary: 0.8 0.1 240;
|
|
68
|
+
const cleanKey = key.replace(/^color-/, "");
|
|
67
69
|
const [l, c, h] = value.split(/\s+/).map(parseFloat);
|
|
68
|
-
palette.colors[
|
|
70
|
+
palette.colors[cleanKey] = { lightness: l, chroma: c, hue: h };
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
});
|
package/tests/plugin.test.ts
CHANGED
|
@@ -207,4 +207,26 @@ describe("Seyuna PostCSS Plugin", () => {
|
|
|
207
207
|
"background: oklch(var(--brand-lightness) var(--brand-chroma) var(--brand-hue) / 1)",
|
|
208
208
|
);
|
|
209
209
|
});
|
|
210
|
+
|
|
211
|
+
it("overrides fixed colors in mode blocks", async () => {
|
|
212
|
+
const input = `
|
|
213
|
+
@config "seyuna" {
|
|
214
|
+
--color-brand: 0.5 0.2 100;
|
|
215
|
+
--light-color-brand: 1 0 100;
|
|
216
|
+
}
|
|
217
|
+
@import "seyuna";
|
|
218
|
+
`;
|
|
219
|
+
const result = await postcss([plugin({ config: undefined })]).process(
|
|
220
|
+
input,
|
|
221
|
+
{ from: undefined },
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
// Global :root should have the original
|
|
225
|
+
expect(result.css).toContain(":root");
|
|
226
|
+
expect(result.css).toContain("--brand-lightness: 0.5");
|
|
227
|
+
|
|
228
|
+
// Light mode should have the override
|
|
229
|
+
expect(result.css).toContain('[data-mode="light"]');
|
|
230
|
+
expect(result.css).toContain("--brand-lightness: 1");
|
|
231
|
+
});
|
|
210
232
|
});
|