-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathpostcss.config.js
More file actions
43 lines (39 loc) · 1.1 KB
/
postcss.config.js
File metadata and controls
43 lines (39 loc) · 1.1 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
32
33
34
35
36
37
38
39
40
41
42
43
export default () => {
const plugins = {
'postcss-import-ext-glob': {},
'@tailwindcss/postcss': {
optimize: false,
transformAssetUrls: false,
},
'postcss-advanced-variables': {
variables: {
target: process.env._TW_TARGET || 'frontend',
'where-not':
'editor' === process.env._TW_TARGET
? "[class~='not-prose'], [class~='not-prose'] *, [class~='acf-block-body']:not([class~='acf-block-preview']) *"
: "[class~='not-prose'], [class~='not-prose'] *",
},
},
'postcss-nesting': {},
};
if ('production' === process.env._TW_ENV) {
plugins.cssnano = {};
}
if ('intellisense' === process.env._TW_TARGET) {
delete plugins['@tailwindcss/postcss'];
plugins.cssnano = {};
plugins['postcss-advanced-variables'] = {
importFilter: () => {
return false;
},
unresolved: 'ignore',
variables: {
target: 'editor',
},
};
plugins['postcss-header'] = {
header: '/*!\n * IMPORTANT: This is a generated file. EDITS WILL BE OVERWRITTEN.\n * This file enables full Tailwind CSS Language Server support for all imports.\n */',
};
}
return { plugins };
};