PostCSS can't parse CSS variable values
See original GitHub issueIt appears PostCSS has difficulty parsing CSS variables according to CSS’s syntax, examples include:
examples {
--bracket-block: {1, 2, 3};
--JSON: [1, "2", {"three": 3}, [4]];
--javascript: function(rule) { console.log(rule) };
}
You can find more known-valid examples of CSS variables in my css-tests repository, or in the Web Platform Tests repository, and you can read about the syntax for CSS variable values in the CSS Variables spec
The allowed syntax for custom properties is extremely permissive. The
<declaration-value>
production matches any sequence of one or more tokens, so long as the sequence does not contain<bad-string-token>
,<bad-url-token>
, unmatched<)-token>
,<]-token>
, or<}-token>
, or top-level<semicolon-token>
tokens or<delim-token>
tokens with a value of “!
”.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
css variables are not properly processed in scss files [duplicate]
I have a problem with css variables used in scss files. When it's used as a pure value works fine, for example: iside...
Read more >Want CSS variables in media query declarations? Try this!
These declarations are processed while your CSS is being parsed, so it won't know to look to the :root and pull in the...
Read more >var() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The var() CSS function can be used to insert the value of a custom property (sometimes called a "CSS variable") instead of any...
Read more >How to create a file by file custom SCSS build including ...
dist/development/css-no-vars/theme-dark/button/Base.css: In this scenario we just get one file which contains the values of the scss variables.
Read more >postcss-css-variables - npm
PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation. Latest version: 0.18.0, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The fix was released in 7.0.15.
@ai @tomhodgins hey! I have started to work on that. I am new to PostCSS source code, so it could take a while. I will give an update in a week or so.