Using imported value in rgba()
See original GitHub issueI have the following:
/* colors.css */
@value midnight: #182947;
/* foo.css */
@value midnight from './colors.css';
.root {
background-color: midnight;
background-color: rgba(midnight, 0.97);
}
The output of this that I see in the browser is (similar to):
.foo__root___hwRbh {
background-color: #182947;
background-color: rgba(i__const_midnight_0, 0.97);
}
The value for midnight
is not being interpolated correctly in the rgba() instance.
This occurs with css-loader@1.1.0
and with postcss-loader
removed from my webpack configuration (I thought maybe one of my postcss plugins were conflicting).
Is this a bug? Or an unsupported use case?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:9
- Comments:11 (1 by maintainers)
Top Results From Across the Web
rgba() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The rgba() functional notation expresses a color according to its red, green, and blue components. An optional alpha component represents ...
Read more >CSS rgba() function - W3Schools
The rgba() function define colors using the Red-green-blue-alpha (RGBA) model. RGBA color values are an extension of RGB color values with an alpha...
Read more >Python 3.6: 'c' argument looks like a single numeric RGB or ...
Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all...
Read more >Functions | Material Dashboard 2 React @ Creative Tim
The rgba() function helps you to create a rgba color code. Copy. import rgba from "assets/theme/functions/rgba"; rgba(color, opacity);.
Read more >Built-In Modules - Sass
You can even use var() in place of multiple arguments, since it might be replaced by multiple values! When a color function is...
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
same issue here, using color() from cssnext the value results in i__const… however i think the values plugin should run before cssnext, as i defined this order in my postcss plugin chain… so why is this not working?
Possibly related, I get a silent fail when using
css-modulesify
withpostcss-cssnext
and trying to use acolor()
function on an imported@value
.Above code causes watchify to just hang, no error message.
color()
function works as expected when not used on a@value
.