ShortCSS/ShortCSS.styl

302 строки
5.2 KiB
Stylus
Исходник Обычный вид История

2015-08-24 14:00:55 +00:00
/*
* Config
*/
// default unit
__units ?= 0px
/*
* Internal
*/
--unit(arg)
if (arg is a 'unit')
if arg == 0
0
else
unit(arg) ? arg : arg + __units
else
arg
--units(args)
out = ''
for num in args
out = out + ' ' + --unit(num)
unquote(out)
/*
* Synonym
*/
// margin
-m()
2015-08-24 14:00:55 +00:00
margin --units(arguments)
-mt()
2015-08-24 14:00:55 +00:00
margin-top --units(arguments)
-mb()
2015-08-24 14:00:55 +00:00
margin-bottom --units(arguments)
-ml()
2015-08-24 14:00:55 +00:00
margin-left --units(arguments)
-mr()
2015-08-24 14:00:55 +00:00
margin-right --units(arguments)
// padding
-p()
2015-08-24 14:00:55 +00:00
padding --units(arguments)
-pt()
2015-08-24 14:00:55 +00:00
padding-top --units(arguments)
-pb()
2015-08-24 14:00:55 +00:00
padding-bottom --units(arguments)
-pl()
2015-08-24 14:00:55 +00:00
padding-left --units(arguments)
-pr()
2015-08-24 14:00:55 +00:00
padding-right --units(arguments)
// width
-w()
2015-08-24 14:00:55 +00:00
width --units(arguments)
-wmin()
2015-08-24 14:00:55 +00:00
min-width --units(arguments)
-wmax()
2015-08-24 14:00:55 +00:00
max-width --units(arguments)
// height
-h()
2015-08-24 14:00:55 +00:00
height --units(arguments)
-hmin()
2015-08-24 14:00:55 +00:00
min-height --units(arguments)
-hmax()
2015-08-24 14:00:55 +00:00
max-height --units(arguments)
// position
-pos()
position arguments
-t()
2015-08-24 14:00:55 +00:00
top --units(arguments)
-l()
2015-08-24 14:00:55 +00:00
left --units(arguments)
-b()
2015-08-24 14:00:55 +00:00
bottom --units(arguments)
-r()
2015-08-24 14:00:55 +00:00
right --units(arguments)
// background
-bg()
2015-08-24 14:00:55 +00:00
background --units(arguments)
-bga()
background-attachment arguments
-bgc()
background-color arguments
-bgi()
background-image arguments
-bgo()
background-origin arguments
-bgp()
2015-08-24 14:00:55 +00:00
background-position --units(arguments)
-bgr()
background-repeat arguments
// border
-br()
2015-08-24 14:00:55 +00:00
border --units(arguments)
-brc()
border-color arguments
-brs()
border-style arguments
-brw()
2015-08-24 14:00:55 +00:00
border-width --units(arguments)
// border-top
-brt()
2015-08-24 14:00:55 +00:00
border-top --units(arguments)
-brtc()
border-top-color arguments
-brts()
border-top-style arguments
-brtw()
2015-08-24 14:00:55 +00:00
border-top-width --units(arguments)
2015-08-24 14:00:55 +00:00
// border-bottom
-brb()
2015-08-24 14:00:55 +00:00
border-bottom --units(arguments)
-brbc()
border-bottom-color arguments
-brbs()
border-bottom-style arguments
-brbw()
2015-08-24 14:00:55 +00:00
border-bottom-width --units(arguments)
2015-08-24 14:00:55 +00:00
// border-left
-brl()
2015-08-24 14:00:55 +00:00
border-left --units(arguments)
-brlc()
border-left-color arguments
-brls()
border-left-style arguments
-brlw()
2015-08-24 14:00:55 +00:00
border-left-width --units(arguments)
2015-08-24 14:00:55 +00:00
// border-right
-brr()
2015-08-24 14:00:55 +00:00
border-right --units(arguments)
-brrc()
border-right-color arguments
-brrs()
border-right-style arguments
-brrw()
border-right-width --units(arguments)
-brcol()
border-collapse arguments
//color
-c()
color arguments
//display
-d()
display arguments
//float
-fl()
float arguments
//font
-f()
2015-08-24 14:00:55 +00:00
out = ''
weight = 100 200 300 400 500 600 700 800 900
for num in arguments
if num in weight
out = out + ' ' + num
else
out = out + ' ' + --unit(num)
font unquote(out)
-ff()
font-family arguments
-fs()
2015-08-24 14:00:55 +00:00
font-size --units(arguments)
-fst()
font-style arguments
-fv()
font-variant arguments
-fw()
font-weight arguments
//text
-td()
text-decoration arguments
-ts()
2015-08-24 14:00:55 +00:00
text-shadow --units(arguments)
-ta()
text-align arguments
-to()
text-overflow arguments
//list
-lis()
list-style arguments
-lip()
list-style-position arguments
-lh()
2015-08-24 14:00:55 +00:00
line-height --units(arguments)
//vertical-align
-va()
vertical-align arguments
//z-index
-z()
z-index arguments
2015-08-24 14:00:55 +00:00
/*
* Hacks
*/
b-radius()
2015-08-24 14:00:55 +00:00
-webkit-border-radius: --units(arguments)
-moz-border-radius: --units(arguments)
-o-border-radius: --units(arguments)
-ms-border-radius: --units(arguments)
-khtml-border-radius: --units(arguments)
border-radius: --units(arguments)
l-gradient()
-bgi -moz-linear-gradient(arguments)
-bgi -webkit-linear-gradient(arguments)
-bgi -o-linear-gradient(arguments)
-bgi -ms-linear-gradient(arguments)
-bgi linear-gradient(arguments)
r-l-gradient()
-bgi -moz-repeating-linear-gradient(arguments)
-bgi -webkit-repeating-linear-gradient(arguments)
-bgi -o-repeating-linear-gradient(arguments)
-bgi -ms-repeating-linear-gradient(arguments)
-bgi repeating-linear-gradient(arguments)
r-gradient()
-bgi -moz-radial-gradient(arguments)
-bgi -webkit-radial-gradient(arguments)
-bgi -o-radial-gradient(arguments)
-bgi -ms-radial-gradient(arguments)
-bgi radial-gradient(arguments)
bx-shadow()
2015-08-24 14:00:55 +00:00
-moz-box-shadow --units(arguments)
-webkit-box-shadow --units(arguments)
box-shadow --units(arguments)
bg-clip()
-webkit-background-clip arguments
-moz-background-clip arguments
background-clip arguments
bg-size()
2015-08-24 14:00:55 +00:00
-moz-background-size --units(arguments)
-webkit-background-size --units(arguments)
-o-background-size --units(arguments)
background-size --units(arguments)
transit()
-webkit-transition arguments
-moz-transition arguments
-o-transition arguments
transition arguments
2015-04-30 15:14:03 +00:00
transit-delay()
-webkit-transition-delay arguments
-moz-transition-delay arguments
-o-transition-delay arguments
transition-delay arguments
2015-04-30 14:37:34 +00:00
transfrm()
-webkit-transform arguments
-moz-transform arguments
-o-transform arguments
-ms-transform arguments
transform arguments
opacit()
-ms-filter unquote('"progid:DXImageTransform.Microsoft.Alpha(Opacity='+arguments*100+')"')
filter unquote('alpha(opacity='+arguments*100+')')
-moz-opacity arguments
-khtml-opacity arguments
opacity arguments
_h16 = 'h1,h2,h3,h4,h5,h6'
_h15 = 'h1,h2,h3,h4,h5'
_h14 = 'h1,h2,h3,h4'
_h13 = 'h1,h2,h3'
_h26 = 'h2,h3,h4,h5,h6'
_h25 = 'h2,h3,h4,h5'
_h24 = 'h2,h3,h4'
_h36 = 'h3,h4,h5,h6'
_h35 = 'h3,h4,h5'
2015-08-24 14:16:17 +00:00
imp = !important