Closed wujekbogdan closed 4 years ago
@wujekbogdan I don't recommend trying to re-use resolve-value.js
. It doesn't work very well and it's confusing.
I started on a better generic utility type thing that is probably more what you are after but it's not in any finished sorta state (I just made the project public if you want to look at it though), https://github.com/MadLittleMods/postcss-selector-scope-utility
@MadLittleMods Thanks for the update. I'll be watching the progress.
Hi,
I don't use
postcss-css-variables
plugin in a standard way. I don't want to pass the whole CSS code throughpostcss-css-variables
. I'd like to use it as a standalone tool to parse only some specific variables within the callback of another postCSS plugin.I use svg-transform-loader together with postcss-move-props-to-bg-image-query
I'd like to be able to do:
When I pass that code through the
postcss-move-props-to-bg-image-query
plugin thenvar(--my-css-variable)
is not evaluated - I'd like to usepostcss-css-variables/lib/resolve-value
module to get the value of this variable.I already forked the
postcss-move-props-to-bg-image-query
in a way that in thetransform
callback I have access toroot
anddeclaration
objects.And now I'm stuck. I don't know how to use the
resolveValue()
module. I know that it taksedeclaration
as a first argument andmap
object as second argument, but I have no idea how to build a propermap
object.