Sass (stylesheet language)

From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search
{{Expansion depth limit exceeded|{{Expansion depth limit exceeded| }}
Sass
{{{Expansion depth limit exceeded}}} | }}{{{Expansion depth limit exceeded}}}

Sass (Syntactically Awesome Stylesheets) is a stylesheet language initially designed by Hampton Catlin and developed by Nathan Weizenbaum. It is best described as a meta-language on top of CSS, and is meant to abstract CSS code and create simpler stylesheet files. After its initial versions, Nathan Weizenbaum and Chris Eppstein have continued to extend Sass with SassScript, a Turing Complete scripting language used in Sass files.

Nested Rules

One of the key features of Sass is its nested rules, which make complicated nested selectors easy to read and write.

#header
  background: #FFFFFF   
  /* -or-  :background #FFFFFF

  .error
    color: #FF0000

  a
    text-decoration: none
    &:hover
      text-decoration: underline

Would compile to:

#header {
  background: #FFFFFF;
}
#header .error {
  color: #FF0000;
}
#header a {
  text-decoration: none
}
#header a:hover {
  text-decoration: underline
}

CSS variables

Sass adds constants and mixins to css. This makes it easy to keep and maintain consistent values through out a large set of styles. Constants allow you to set one value and use it through out the styles while mixins expand that to a block of style attributes.

!link_color = #00F

a
  :color = !link_color

Would compile to

a {
  color: #00F
}

External links

If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...