Skip to content

Commit 9ab35ac

Browse files
jekatigrromainmenke
authored andcommitted
support for ".pcss" file resolution in importFrom option (postcss/postcss-custom-properties#211)
1 parent d3fcc76 commit 9ab35ac

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

plugins/postcss-custom-properties/.tape.js

+11
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ module.exports = {
100100
expect: 'basic.import.expect.css',
101101
result: 'basic.import.result.css'
102102
},
103+
'basic:import-css-pcss': {
104+
message: 'supports { importFrom: "test/import-properties.{p}?css" } usage',
105+
options: {
106+
importFrom: [
107+
'test/import-properties.pcss',
108+
'test/import-properties-2.css'
109+
]
110+
},
111+
expect: 'basic.import.expect.css',
112+
result: 'basic.import.result.css'
113+
},
103114
'basic:import-css-from': {
104115
message: 'supports { importFrom: { from: "test/import-properties.css" } } usage',
105116
options: {

plugins/postcss-custom-properties/src/lib/get-custom-properties-from-imports.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function getCustomPropertiesFromImports(sources) {
7878
}).reduce(async (customProperties, source) => {
7979
const { type, from } = await source;
8080

81-
if (type === 'css') {
81+
if (type === 'css' || type === 'pcss') {
8282
return Object.assign(await customProperties, await getCustomPropertiesFromCSSFile(from));
8383
}
8484

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:root {
2+
--ref-color: var(--color);
3+
--z-index: 10;
4+
}

0 commit comments

Comments
 (0)