-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostcss.config.js
26 lines (23 loc) · 932 Bytes
/
postcss.config.js
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
export default {
plugins: {
tailwindcss: {},
'postcss-prefix-selector': {
prefix: '#admin-bar',
exclude: ['#admin-bar', '#admin-bar.dark'],
transform(prefix, selector, prefixedSelector, filePath, rule) {
if (selector.match(/^(html|body)/)) {
return selector.replace(/^([^\s]*)/, `$1 ${prefix}`)
}
if (filePath.match(/node_modules/)) {
return selector // Do not prefix styles imported from node_modules
}
const annotation = rule.prev()
if (annotation?.type === 'comment' && annotation.text.trim() === 'no-prefix') {
return selector // Do not prefix style rules that are preceded by: /* no-prefix */
}
return prefixedSelector
},
},
autoprefixer: {},
},
}