forked from DanielHerr/FF_Apps_Archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostcss.config.cjs
More file actions
31 lines (29 loc) · 1.04 KB
/
Copy pathpostcss.config.cjs
File metadata and controls
31 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* PostCSS Configuration
* Transpiles CSS custom properties (variables) to static values
* for Firefox OS v1 (Gecko 18) compatibility
*
* With preserve: true, output includes BOTH:
* - Static fallback values (for Gecko 18 - light mode only)
* - var() syntax (for modern browsers - full theming support)
*/
const postcssGlobalData = require('@csstools/postcss-global-data');
const postcssCustomProperties = require('postcss-custom-properties');
const globalDataConfig = {
files: [
'./src/styles/colors-primitives.css', // Load primitives first
'./src/styles/design-tokens.css',
'./src/styles/colors-semantic.css'
]
};
module.exports = {
plugins: [
// First pass: load all CSS variable definitions globally
postcssGlobalData(globalDataConfig),
// First resolution pass - preserve both static and var()
postcssCustomProperties({ preserve: true }),
// Second pass to resolve chained variables (semantic → primitive)
postcssGlobalData(globalDataConfig),
postcssCustomProperties({ preserve: true })
]
};