Dmi*_*hin 5 javascript reactjs postcss next.js
我有下一个 postcss 配置
module.exports = {
plugins: [
[
'postcss-preset-env',
{
browsers: 'last 2 versions, IE 11, not dead',
preserve: false,
features: {
'custom-media-queries': true,
'custom-properties': true,
'nesting-rules': true
},
importFrom: ['src/styles/variables.css']
}
]
]
}
Run Code Online (Sandbox Code Playgroud)
这个文件带有 css 变量
@custom-media --desktop screen and (min-width: 768px);
@custom-media --mobile screen and (max-width: 767px);
:root {
--montserrat: montserrat, sans-serif;
--sfProDisplay: sf pro display, sans-serif;
--helvetica: helvetica, sans-serif;
--blue: #315efb;
--middleBlue: #2c54e2;
--darkBlue: #274bc8;
--lightBlue: #e0ebff;
--green: #21a038;
--grey: #62687f;
--darkGray: #343b4c;
--blueGray: #8d96b2;
--cloudGray: #f3f4f7;
--cloudGray7: #afb6c9;
--darkCarbone: #1f2431;
--paleYellow: #fffde5;
--red: #ff564e;
}
Run Code Online (Sandbox Code Playgroud)
在我通过下一个构建&&下一个导出构建项目后,颜色未正确显示。例如,颜色:var(--blueGray),而不是颜色:#8d96b2。有人知道出了什么问题吗?
| 归档时间: |
|
| 查看次数: |
3142 次 |
| 最近记录: |