scss-library/components/00_Tools/_cssParameter.styl

44 lines
634 B
Stylus

_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)