| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This Meteor package provides an easy way to create your stylesheets in CoffeeScript: CSSC
Find some additional information on my blog:
meteor add pierreeric:csscThe following example creates a new stylesheet with 3 rules: one on the HTML file and a second on a CSS class .bubble and a third for multiple CSSRules:
mainCss = new CSSC
mainCss
.add 'html',
backgroundColor: 'red'
.add '.bubble',
backgroundColor: '#FFDC00'
borderRadius: CSSC.em 0.75
.add ['h1', 'h2'],
backgroundColor: 'blue'CSS properties are declared as a dictionary of keys and values respecting the DOM and CCOM API when called in Javascript.
They allow working with numerical value instead of strings.
CSSC.px 12
# Returns: '12px'CSSC.pc 50
# Returns: '50%'CSSC.em 1.2
# Returns: '1.2em'You can add additional plugins to this package enhancing its capabilities.
Available options are:
CSSC.red
# Returns: '#FF4136'# Create a color from an hex String and add alpha blending
c = new CSSC.Clr ['#FF4136', 0.3]
# Add 20% luminance
c.set 'l', (Math.round 1.2 * c.get 'l')
# Get an RGBA string
c.rgba()require('famous.core.famous');| Back | FazBrowse Home | New Git URL |