Skip to content

Instantly share code, notes, and snippets.

@hagenburger
Last active August 29, 2015 14:20
Show Gist options
  • Save hagenburger/b2d3cdf72ec265630d05 to your computer and use it in GitHub Desktop.
Save hagenburger/b2d3cdf72ec265630d05 to your computer and use it in GitHub Desktop.
Using CSS and JavaScript in the LivingStyleGuide

Adding CSS to the Style Guide

SCSS

@css:
.example {
  color: red;
}

Sass

@css preprocessor: sass
  color: red

You can define this option globally just once:

@default preprocessor: sass

@css
  color: red

Adding JavaScript to the Style Guide

@javascript-before adds into the <head>, @javascript-after at the end of the document.

JavaScript

@javascript-before:
alert("Hello World!");

CoffeeScript

@javascript-before transcompiler: coffee-script
  alert "Hello World!"

You can define this option globally just once:

@default transcompiler: coffee-script

@javascript-before
  alert "Hello World!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment