MidiBlog.net

SASS e Compass per migliorare la scrittura dei CSS

Settembre 1, 2009 @ 5:57 am

Josie: SASS (Syntactically Awesome Stylesheets) è un metalinguaggio che permette di scrivere del codice CSS in modo più semplice, organizzato e con alcune comodità niente male (ad esempio l’utilizzo di variabili):
Sass is a meta-language on top of CSS that’s used to describe the style of a document cleanly and structurally, with more power than flat CSS allows. Sass both provides a simpler, more elegant syntax for CSS and implements various features that are useful for creating manageable stylesheets.

Detto questo è meglio vedere subito un esempio:
Visualizza il codice SASS

!menu_bg = #2277aa
#menu
  :margin 0
  :list-style none
  li
    :float left
    a
      :display block
      :float left
      :padding 4px 8px
      :text-decoration none
      :color white
      :background = !menu_bg

Come potete notare non c’è stato alcun sconvolgimento rispetto un CSS standard ed il codice rimane comunque comprensibile anche a chi non conoscere il metalinguaggio SASS; [...]

Read more


Related:

Related foto e immagini: