-
Notifications
You must be signed in to change notification settings - Fork 10
/
postcss.config.js
32 lines (32 loc) · 1.09 KB
/
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
27
28
29
30
31
32
export default {
plugins: {
tailwindcss: { config: "./tailwind.config.js" },
"postcss-prefix-selector": {
prefix: ".diff-tailwindcss-wrapper",
transform: function (prefix, selector, prefixedSelector, _filePath, rule) {
const filePath = rule.source?.input?.file;
// ignore base css
// TODO next release update
if (rule.source?.start?.line === 1 && rule.source?.start?.column === 1) {
return selector;
}
if (selector.includes("diff-line-extend-wrapper") || selector.includes("diff-line-widget-wrapper")) {
return selector;
}
if (selector.includes("[data-theme")) {
return prefix + selector;
}
if (filePath.includes("node_modules")) {
if (filePath.includes("dark.css")) {
return `${prefix}[data-theme="dark"] .diff-line-syntax-raw ${selector}`;
} else {
return `${prefix}[data-theme="light"] .diff-line-syntax-raw ${selector}`;
}
} else {
return prefixedSelector;
}
},
},
autoprefixer: {},
},
};