A pure regexp-replace version of rework-vars. Differences are:
- It doesn't use
rework
or parse the CSS AST - It does not remove variable declarations
- It is much less robust
- It does not throw error messages
Like rework-vars
, it only implements a subset of CSS variables.
var variables = require('variables')
Do CSS variables magic.
Parse CSS variables on :root
,
storing the variable values in map
.
Variable names do not include the leading --
s.
Compile a regular expression for matching var(--<name>)
s with name
s given from map
.
This regular expression do not match var()
s with fallbacks.
Replace variables in css
with a variable map
.