stylobate
Version:
Framework for writing really abstract CSS in Stylus
96 lines (76 loc) • 2.5 kB
text/stylus
$resetted_elements = unquote('')
$reset_meyer_general_list = 'html' 'body' 'div' 'span' 'applet' 'object' 'iframe' 'h1' 'h2' 'h3' 'h4' 'h5' 'h6' 'p' 'blockquote' 'pre' 'a' 'abbr' 'acronym' 'address' 'big' 'cite' 'code' 'del' 'dfn' 'em' 'img' 'ins' 'kbd' 'q' 's' 'samp' 'small' 'strike' 'strong' 'sub' 'sup' 'tt' 'var' 'b' 'u' 'i' 'center' 'dl' 'dt' 'dd' 'ol' 'ul' 'li' 'fieldset' 'form' 'label' 'legend' 'table' 'caption' 'tbody' 'tfoot' 'thead' 'tr' 'th' 'td' 'article' 'aside' 'canvas' 'details' 'embed' 'figure' 'figcaption' 'footer' 'header' 'hgroup' 'menu' 'nav' 'output' 'ruby' 'section' 'summary' 'time' 'mark' 'audio' 'video'
reset_meyer_general()
@extends $reset_meyer_general
$reset_meyer_general
margin: 0
padding: 0
border: 0
font-size: 100%
font: inherit
vertical-align: baseline
reset_button()
@extends $reset_button
$reset_button
padding: 0
margin: 0
border: none
background: transparent
-moz-appearance: none
font: inherit
if ie
overflow: visible
// Could be splitted?
&::-moz-focus-inner
padding: 0
border: none
reset_input()
@extends $reset_input
unless no-focus in arguments
@extends $reset_input-focus
$reset_input
padding: 0
margin: 0
border: none
background: transparent
font: inherit
-webkit-appearance: none
&::-ms-clear
display: none
$reset_input-focus
&:focus
outline: none
reset_selector($tags, $global)
if $global
// Can we not check there, if the join would do nothing on single item?
if utilus_is_array($tags)
return join(',', $tags)
else
return $tags
else
return '&'
apply-reset($reset, $tags, $global)
if $reset in $tags and (not $reset in $resetted_elements)
if $global
push($resetted_elements, $reset)
{join(',', $tags)}
reset_{$reset}()
else
reset_{$reset}()
reset($which, $global = false)
// This could be made easier, with better names and checks
$list_for_meyer_general_reset = ()
for $tag in $which
if $tag in $reset_meyer_general_list
unless $tag in $resetted_elements or $tag in $list_for_meyer_general_reset
push($list_for_meyer_general_reset, $tag)
if $global
push($resetted_elements, $tag)
if length($list_for_meyer_general_reset) > 0
if $global
{join(',', $list_for_meyer_general_reset)}
reset_meyer_general()
else
reset_meyer_general()
apply-reset('button', $which, $global)
apply-reset('input', $which, $global)