Incompatibility with some coding styles
See original GitHub issueHello!
I’m a fan of putting a space after the opening and before the closing function parens (for multiple reasons), and it seems like this plugin is not compatible with that type of coding style because it’s using (too) specific sub-string to match when collecting the properties, ie var(--
.
Perhaps something like this would make it more forgiving?
Declaration (node, {Declaration}) {
// bail early
if (node[processed]) return
let matches = node.value.match(/var\(\s*[\w\d-]+\s*\)/g);
if (!matches) return;
let props = matches.map(v => v.match(/var\(\s*([\w\d-]+)\s*\)/)[1])
// ...
}
Disclaimer: My regex-fu is questionable 😁
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
What are some problems caused by programs that are correct ...
Inconsistent coding makes code harder to maintain. Inconsistent coding style makes merges worse because changes in whitespace (you use tabs, another person ...
Read more >Coding conventions (code style)
Everyone has opinions about coding style. This document contains some high-level advice. ... Many other coding convention documents are available.
Read more >Recommended C Style and Coding Standards
This document is an updated version of the Indian Hill C Style and Coding Standards paper, with modifications by the last three authors....
Read more >Typescript incompatibility with the prop style #479 - GitHub
Describe the bug. The style prop causes a TypeScript error, presumably because React treats it as a regular element style attribute instead of...
Read more >7 Common Cross Browser Compatibility Issues to Avoid
In this article, we will explore some of the most common reasons cross browser test cases can fail. Consider this a list of...
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 FreeTop 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
Top GitHub Comments
released and fixed in 1.0.2 👍🏻 thanks for the help!
@argyleink I took a stab at this and issued a PR: https://github.com/GoogleChromeLabs/postcss-jit-props/pull/6