Skip to content

Instantly share code, notes, and snippets.

View hagenburger's full-sized avatar

Nico Hagenburger hagenburger

View GitHub Profile
@hagenburger
hagenburger / styleguide.lsg
Last active August 29, 2015 14:07
How to use JavaScripts in the LivingStyleGuide
source: styles.scss
javascript-before:
- http://code.jquery.com/jquery-1.11.1.min.js
- /assets/angular-1.2.3.js
- |
$(function() {
alert("Hello World!");
}
@hagenburger
hagenburger / _functions.lsg
Created January 19, 2015 23:22
Color functions in LSG?
# Functions
```
@colorfuncs
foo()
```
@hagenburger
hagenburger / application.rb
Created April 10, 2015 10:20
Fix for Rails if _xyz.lsg raise errors on rake assets:precompile
config.assets.precompile.clear
precompiled_extensions = %w(.html .css .js .png .gif .jpg .svg .woff .woff2 .eot .ttf)
config.assets.precompile.push(Proc.new { |path|
File.extname(path).in?(precompiled_extensions) and not path =~ /^_|\/_/
})
@hagenburger
hagenburger / .gitconfig
Created April 22, 2015 13:22
Git aliases
[alias]
ci = commit -pm
last = log -1 HEAD
st = status
nb = checkout -b
co = checkout
cog = "!cog() { git checkout `git branch|grep $1`; }; cog"
cp = cherry-pick
amend = commit --amend -p -CHEAD
rb = rebase
@hagenburger
hagenburger / css-and-javascript.md
Last active August 29, 2015 14:20
Using CSS and JavaScript in the LivingStyleGuide

Adding CSS to the Style Guide

SCSS

@css:
.example {
  color: red;
}
@hagenburger
hagenburger / layout.haml
Last active August 29, 2015 14:20
Eurucamp Front-end API Draft
%html
%head
= style_css
= style_javascript
= style_template :layout do
= style_template :navigation, root_url: "/", items: [{ url: "/", text: "Home"}, { url: xyz_path(@abc), text: "XYZ" }])
= style_template :cover, date: "...", location: "..."
= style_template :team, items: data.team
= style_template :footer, ...
@hagenburger
hagenburger / interpolation.scss
Created June 30, 2015 08:33
LibSass interpolation bug
$name: "world";
// works:
.#{$name} {
test: test;
}
// fails:
.-#{$name} {
test: test;
=sprite-image($file)
background: sprite-image($file)
height: image-height($file)
width: image-width($file)
.star
+sprite-image("icons/star.png")
@hagenburger
hagenburger / gist:524532
Created August 14, 2010 17:57
Upcoming features in lemonade
/*
* 4 new mixins for sprite support in lemonade:
*
* (1) Sprite classes
* (2) Sprite classes with dimensions
* (3) Sprite classes generated from folder
* (4) Sprite classes with dimensions generated from folder
*
* Source at: http://github.com/hagenburger/lemonade/blob/master/stylesheets/lemonade.scss
* Don't forget to `gem install lemonade`
run "cd #{release_path} && rake update_stylesheets"