-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostcss.config.ts
More file actions
40 lines (33 loc) · 944 Bytes
/
postcss.config.ts
File metadata and controls
40 lines (33 loc) · 944 Bytes
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
32
33
34
35
36
37
38
39
40
import type { Plugin } from 'postcss'
import type { Config } from 'postcss-load-config'
// @property in shadow DOM
const removeAtProperty: Plugin = {
postcssPlugin: 'remove-at-property',
AtRule: {
property(atRule) {
atRule.remove()
},
},
}
// https://github.com/tailwindlabs/tailwindcss/blob/v4.1.11/packages/tailwindcss/src/ast.ts#L697-L705
const transformPropertiesLayer: Plugin = {
postcssPlugin: 'transform-properties-layer',
AtRule: {
layer(atRule) {
if (atRule.params !== 'properties') {
return
}
atRule.walkAtRules('supports', (supportsRule) => {
const supportedRules = supportsRule.nodes
supportsRule.remove()
if (supportedRules) {
atRule.append(supportedRules)
}
})
},
},
}
const config: Config = {
plugins: [removeAtProperty, transformPropertiesLayer],
}
export default config