diff --git a/components/00_Global/_cssParameter.styl b/components/00_Global/_cssParameter.styl new file mode 100644 index 0000000..ace2c34 --- /dev/null +++ b/components/00_Global/_cssParameter.styl @@ -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) \ No newline at end of file