Tool for converting stylus vars into css vars
This commit is contained in:
parent
4fe2c21839
commit
fff7e73064
44
components/00_Global/_cssParameter.styl
Normal file
44
components/00_Global/_cssParameter.styl
Normal file
@ -0,0 +1,44 @@
|
||||
_lower_map = {
|
||||
A: 'a',
|
||||
B: 'b',
|
||||
C: 'c',
|
||||
D: 'd',
|
||||
E: 'e',
|
||||
F: 'f',
|
||||
G: 'g',
|
||||
H: 'h',
|
||||
I: 'i',
|
||||
J: 'j',
|
||||
K: 'k',
|
||||
L: 'l',
|
||||
M: 'm',
|
||||
N: 'n',
|
||||
O: 'o',
|
||||
P: 'p',
|
||||
Q: 'q',
|
||||
R: 'r',
|
||||
S: 's',
|
||||
T: 't',
|
||||
U: 'u',
|
||||
V: 'v',
|
||||
W: 'w',
|
||||
X: 'x',
|
||||
Y: 'y',
|
||||
Z: 'z'
|
||||
}
|
||||
|
||||
lower(string)
|
||||
for upper, lower in _lower_map
|
||||
string = replace(upper, lower, string)
|
||||
string
|
||||
|
||||
upper(string)
|
||||
for upper, lower in _lower_map
|
||||
string = replace(lower, upper, string)
|
||||
string
|
||||
|
||||
RV-CSSParameter(block)
|
||||
for name, value in block
|
||||
css-var-name = '--%s' % unquote(name)
|
||||
add-property(css-var-name, value)
|
||||
define(name, unquote('var(--%s)' % (unquote(name))), true)
|
Loading…
Reference in New Issue
Block a user