Problem:
- I have two build configurations. Each has its own preprocessor symbol: DEV and PROD.
- I would like each build to have its own background-image color.
- For C# files, I know that I can use preprocessor directives with the build symbols to conditionally generate code.
Question: How can I do this with a CSS file (like below)?
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
#if PROD
background-image: linear-gradient(180deg, #ff80ed 0%, gainsboro 90%);
#else
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
#endif
}
UPDATE:
- Alternatively, I'd be just as happy creating a
site.css.devandsite.css.prodif that would solve the problem.
site.css.devtosite.css. The build and/or packaging steps should usesite.css.site.cssfile with say the PROD info. On a DEV build, modify the file before it is packaged.