Adding variables to style attribute issue #1099
Replies: 3 comments
-
|
Trying to do a similar thing. I want to render the following html. But the build complains with
|
Beta Was this translation helpful? Give feedback.
-
|
It's PostCSS that's throwing on invalid CSS syntax. I've been testing postcss-safe-parser for Maizzle 5, I try to add it in the current version as well. Meanwhile, you can try installing and using it yourself: npm install postcss-safe-parsermodule.exports = {
build: {
postcss: {
plugins: [
require('postcss-safe-parser')()
]
}
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I will give it a try. I managed to bypass it by using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to add variables to style attribute without quotation marks (single quotes in this case ' ' ) but when I remove them the build fails
template
<a style="color: '@{variables.categoryBgColor}'"> click me </a>output
<a style="color: 'red'"> click me </a>setup
module.exports = { build: { posthtml: { expressions: { delimiters: ["{", "}"], unescapeDelimiters: ["{{{", "}}}"], }, }, }, },Beta Was this translation helpful? Give feedback.
All reactions