Skip to content

Instantly share code, notes, and snippets.

@mndvns
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save mndvns/872a202ddb0d9349a3a4 to your computer and use it in GitHub Desktop.

Select an option

Save mndvns/872a202ddb0d9349a3a4 to your computer and use it in GitHub Desktop.
ESS constructor pattern
var bg = props.bg
var family = props.family
background = bg || 'white'
font-family = family || 'Arial'
.Foo {
background: #fff
}
.Foo, .Bar {
font-family: Arial
}
.Bar {
background: purple
}
.Bazz {
background: red;
font-family: Helvetica;
}
import Constructor from './constructor.ess?raw'
.Foo
Constructor
.Bar
Constructor(bg='purple')
.Bazz
Constructor(bg='red' family='Helvetica')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment