Created
February 4, 2012 06:46
-
-
Save sapegin/1735915 to your computer and use it in GitHub Desktop.
CSS vendor prefixes for Stylus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// © 2011 Artem Sapegin http://sapegin.ru | |
// Simple CSS3 properties with vendor prefixes | |
box-sizing() | |
-moz-box-sizing arguments | |
box-sizing arguments | |
box-shadow() | |
-webkit-box-shadow arguments | |
box-shadow arguments | |
transition() | |
-webkit-transition arguments | |
-moz-transition arguments | |
-ms-transition arguments | |
-o-transition arguments | |
transition arguments | |
transform() | |
-webkit-transform arguments | |
-moz-transform arguments | |
-ms-transform arguments | |
-o-transform arguments | |
transform arguments | |
overflow-scrolling() | |
-webkit-overflow-scrolling arguments | |
overflow-scrolling arguments | |
// Preserve '%'s in hsla() -- strange hack | |
hsla() | |
'hsla(%s)' % unquote(join(', ', arguments)) | |
// Gradients | |
// https://github.com/LearnBoost/stylus/issues/245 | |
replace(str, a, b) | |
str = clone(str) | |
for e, i in str | |
if length(e) > 1 | |
str[i] = replace(e, a, b) | |
else | |
if a == e | |
str[i] = b | |
str | |
linear-gradient() | |
prop = current-property[0] | |
val = current-property[1] | |
args = unquote(join(', ', arguments)) | |
add-property(prop, replace(val, '__CALL__', '-webkit-linear-gradient(%s)' % args)) | |
add-property(prop, replace(val, '__CALL__', '-moz-linear-gradient(%s)' % args)) | |
add-property(prop, replace(val, '__CALL__', '-ms-linear-gradient(%s)' % args)) | |
add-property(prop, replace(val, '__CALL__', '-o-linear-gradient(%s)' % args)) | |
g = 'linear-gradient(%s)' % args | |
g |
получилось! вот: gist.github.com/1736384 (эта же ссылка сверху справа, форк же)
добавил много чего. надеюсь, не только для Себя старался.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
а если попробовать дублированием последней примеси и заменой в ней “linear” на “radial” добавить поддержку круговых растяжек? надо проверить. сейчас фильм досмотрю и попробую.