Skip to content

Instantly share code, notes, and snippets.

@atinypixel
Created April 28, 2010 16:51
Show Gist options
  • Save atinypixel/382370 to your computer and use it in GitHub Desktop.
Save atinypixel/382370 to your computer and use it in GitHub Desktop.
Some basic sass files for rails projects
!ninesixty_gutter_width ||= 20px
!ninesixty_grid_width ||= 960px
!ninesixty_columns ||= 12
=grid-container
margin-left: auto
margin-right: auto
width = !ninesixty_grid_width
=grid-width(!n, !cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width)
width = (!ninesixty_grid_width / !cols) * !n - !gutter_width
=grid-unit-base(!gutter_width = !ninesixty_gutter_width)
display: inline
float: left
margin:
left = !gutter_width / 2
right = !gutter_width / 2
=grid(!n, !cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width)
+grid-unit-base(!gutter_width)
+grid-width(!n, !cols, !gutter_width)
=alpha
margin-left: 0
=omega
margin-right: 0
=grids(!cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width)
#{enumerate(".grid_",1,!cols)}
+grid-unit-base
@for !n from 1 through !cols
.grid_#{!n}
+grid-width(!n, !cols, !gutter_width)
=grid-prefix(!n, !cols = !ninesixty_columns)
padding-left = (!ninesixty_grid_width / !cols) * !n
=grid-prefixes(!cols = !ninesixty_columns)
@for !n from 1 through !cols - 1
.prefix_#{!n}
+grid-prefix(!n, !cols)
=grid-suffix(!n, !cols = !ninesixty_columns)
padding-right = (!ninesixty_grid_width / !cols) * !n
=grid-suffixes(!cols = !ninesixty_columns)
@for !n from 1 through !cols - 1
.suffix_#{!n}
+grid-suffix(!n, !cols)
=grid-children
.alpha
+alpha
.omega
+omega
=grid-system(!cols = !ninesixty_columns)
+grid-container
+grids(!cols)
+grid-prefixes(!cols)
+grid-suffixes(!cols)
+grid-children
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, p, blockquote, pre, a,
abbr, acronym, address, big, cite, code, small, strike, strong, sub, sup, tt, var,
dfn, em, img, del, small, strike, strong, sub, sup, tt, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td
margin: 0
padding: 0
border: 0
outline: 0
font-size: 100%
vertical-align: baseline
background: transparent
body
line-height: 1
blockquote
quotes: none
del
text-decoration: line-through
ol, ul
list-style: none
table
background: transparent
border-collapse: collapse
border-spacing: 0
*:focus
outline: 0
/*
Reset for HTML5
By Eric Meyers
PURPOSE:
Resets everything to zero for better browser compatibility
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, dialog, figure, footer, header,
hgroup, menu, nav, section, menu,
time, mark, audio, video
margin: 0
padding: 0
border: 0
outline: 0
font-size: 100%
vertical-align: baseline
background: transparent
body
line-height: 1
article, aside, dialog, figure, footer, header,
hgroup, nav, section
display: block
ul
list-style: none
blockquote, q
quotes: none
blockquote:before, blockquote:after,
q:before, q:after
content: ''
content: none
a
margin: 0
padding: 0
border: 0
font-size: 100%
vertical-align: baseline
background: transparent
ins
background-color: #ff9
color: #000
text-decoration: none
mark
background-color: #ff9
color: #000
font-style: italic
font-weight: bold
del
text-decoration: line-through
abbr[title], dfn[title]
border-bottom: 1px dotted #000
cursor: help
table
border-collapse: collapse
border-spacing: 0
hr
display: block
height: 1px
border: 0
border-top: 1px solid #cccccc
margin: 1em 0
padding: 0
input, select
vertical-align: middle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment