Skip to content

Instantly share code, notes, and snippets.

@jaspertandy
Created February 1, 2012 17:01
Show Gist options
  • Select an option

  • Save jaspertandy/1718038 to your computer and use it in GitHub Desktop.

Select an option

Save jaspertandy/1718038 to your computer and use it in GitHub Desktop.
// config
$grid-width: 80px;
$grid-margin: 14px;
$grid-margins: $grid-margin * 2;
$grid-padding: $grid-margin;
$grid-paddings: $grid-padding * 2;
$grid-home-gutter: 4px;
$grid-home-height: 232px;
$grid-home-background: #4e8496;
$total-width: 960px;
$divider-gutter: 8px;
$font-dark: #353535;
$font-mid: #838383;
$font-light: #757575;
$font-lighter: #acacac;
$font-home-grid: #FFFFFF;
$blue: #5e9cb1;
$input-height: 28px;
// end config
// fonts
@font-face {
font-family: 'FSJoey';
src: url('../fonts/FSJoey-Regular.eot');
}
@font-face {
font-family: 'FSJoey';
src: url('../fonts/FSJoey-Regular.woff') format('woff'),
url('../fonts/FSJoey-Regular.svg#FSJoey') format('svg');
}
@font-face {
font-family: 'FSJoeyBold';
src: url('../fonts/FSJoey-Bold.eot');
}
@font-face {
font-family: 'FSJoeyBold';
src: url('../fonts/FSJoey-Bold.woff') format('woff'),
url('../fonts/FSJoey-Bold.svg#FSJoey') format('svg');
}
@mixin body-copy () {
font-family:Helvetica, Arial, sans-serif;
font-size: 13px;
color:#757575;
}
@mixin special-copy () {
font-family:FSJoey, Helvetica, Arial, sans-serif;
text-transform: uppercase;
}
@mixin special-copy-bold () {
font-family:FSJoeyBold, Helvetica, Arial, sans-serif;
text-transform: uppercase;
}
// end fonts
// shortcuts
@mixin border-radius ($i) {
-moz-border-radius: $i;
-webkit-border-radius: $i;
-o-border-radius: $i;
-ms-border-radius: $i;
border-radius: $i;
}
// end shortcuts
// reset
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img, ol, ul, li, form, input, iframe, object, table, th, tr, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
}
b,
strong {
font-weight: bold;
}
i,
em {
font-style: italic;
}
body {
background-color: #ffffff;
color: #231f20;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 18px;
}
@mixin clearfix {
display: inline-block;
&:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
* html & { height: 1px }
}
// end reset
// grid
@mixin grid-margin () {
margin: 0 $grid-margin 0 $grid-margin;
}
@mixin grid-padding () {
padding: 0 $grid-padding 0 $grid-padding;
}
.grid-wrapper {
@include clearfix;
display: block;
width: 960px;
margin: 0 auto;
}
@mixin grid {
float: left;
display: inline;
}
$i: 1;
@while $i <= 12 {
.grid-#{$i} {
@include grid;
width: $grid-width * $i;
}
.grid-#{$i}-margin {
@include grid;
@include grid-margin;
width: $grid-width * $i - $grid-margins;
}
.grid-#{$i}-padding {
@include grid;
@include grid-padding;
width: $grid-width * $i - $grid-paddings;
}
$i: $i + 1;
}
@mixin grid-home {
@include grid;
margin: 0 $grid-home-gutter ($grid-home-gutter * 2);
padding: 0 ($grid-margin - $grid-home-gutter);
}
@mixin home-grid ($i) {
.grid-#{$i}-home,
.grid-#{$i}-home .overlay {
@include grid-home;
width: $grid-width * $i - $grid-margins;
background:$grid-home-background;
}
}
@include home-grid( 3 );
@include home-grid( 6 );
@mixin grid-home-row ($n: 1) {
.grid-home-row-#{$n},
.grid-home-row-#{$n} .overlay {
height: ($grid-home-height * $n) + ( ($n - 1) * ($grid-home-gutter * 2) ) - ( $grid-margin * 2 ); // double height + extra gutters
padding-top: $grid-margin;
padding-bottom: $grid-margin;
}
}
@include grid-home-row( 1 );
@include grid-home-row( 2 );
// end grid
// dropdowns
.dropdownwrapper {
cursor: pointer;
position:relative;
z-index:1;
position:absolute;
top: 0;
left: 0;
color:$font-dark;
font-size: 12px;
font-weight: normal;
}
#dropdownoverlay {
position:absolute;
top:0;
left: 0;
z-index:2;
background:none;
}
.dropdownwrapperfocus {
//border: 1px dotted #363636;
border: none;
z-index:3;
}
.dropdownwrapper .current {
@extend .button;
}
body .dropdownwrapper .current {
padding-top: 5px;
height: 23px;
position:relative;
z-index:3;
width: auto;
padding-right: 23px;
font-weight: normal;
color:$font-light;
padding-left: 6px;
}
body .dropdownwrapper:hover .current {
color:$font-dark;
}
.dropdownarrow {
position:absolute;
top: 14px;
right: 8px;
z-index: 10;
background: url(/media/images/triangle-down-5e9cb1.png) no-repeat 0 0;
width: 5px;
height: 3px;
}
.dropdownwrapper .current,
.dropdownwrapper .option {
height: 20px;
}
.dropdownwrapper .options {
display: none;
overflow:hidden;
overflow-y: scroll;
margin-top: -2px;
z-index: 1;
padding-top: 10px;
position:relative;
background:#fff;
}
.dropdownwrapperfocus .options {
display: block;
border: 1px solid #A8A8A8;
border-top: none;
padding-bottom: 4px;
}
.dropdownwrapper .option {
padding: 2px 6px 2px;
}
.dropdownwrapper .optioncurrent,
.dropdownwrapper .option:hover {
color:$blue;
}
.dropdownparent {
position:relative;
height: 25px;
float: left;
}
.dropdowned {
opacity: 0;
width: 1px;
height: 1px;
}
// end dropdowns
// form
@mixin input () {
@include body-copy;
@include border-radius( 3px );
border-top: 1px solid #B7B7B7;
border-bottom: 1px solid #E8E8E8;
border-left: 1px solid #E3E3E3;
border-right: 1px solid #E3E3E3;
background:#FAFAFA;
height: $input-height;
padding: 0 6px;
}
input.text {
@include input;
}
.button {
@include border-radius( 3px );
@include body-copy;
color:$font-light;
background: none;
border: none;
margin: 0;
padding: 0;
-webkit-appearance:none;
font-weight: bold;
font-size: 12px;
background:url(../images/button.png) repeat-x 0 0;
height: 28px;
padding: 0 11px;
border-top: 1px solid #E5E5E5;
border-left: 1px solid #DBDBDB;
border-right: 1px solid #DBDBDB;
border-bottom: 1px solid #949494;
text-shadow: 0px 1px 2px #fff;
}
a.button {
padding-top: 5px;
height: 23px;
display: block;
display: inline-block;
position:relative;
}
a.button-img-left {
padding-left: 31px;
img {
opacity: 0.8;
position:absolute;
top: 6px;
left: 11px;
}
&:hover img {
opacity: 1;
}
}
.button:hover,
.dropdownwrapper:hover .current {
cursor: pointer;
border-top-color: #B0B0B0;
border-left-color: #A8A8A8;
border-right-color: #A8A8A8;
border-bottom-color: #727272;
color:#353535;
background-position: 0 -28px;
}
#search {
position:relative;
input.text {
@include input;
width:255px;
padding-right: 29px;
height: 34px;
}
input[type="image"] {
position:absolute;
top: 10px;
right: 8px;
}
}
// end form
// header
#header {
padding-bottom: 24px;
#logo {
padding-top: 24px;
}
#navigation {
padding-top: 42px;
}
#search {
margin-top: 34px;
}
}
#navigation {
ul {
@include clearfix;
}
li {
position:relative;
@include special-copy;
list-style: none;
color: $font-dark;
float: left;
font-size: 18px;
a {
color: $font-dark;
text-decoration: none;
line-height: 1;
padding: 0 24px 0 0;
.triangle {
margin-top: -4px;
}
}
a:hover {
color: $font-light;
}
ul {
display: none;
position:absolute;
top: 0;
right: 0;
}
}
}
// end header
// footer
#footer {
@include body-copy;
text-transform: none;
font-size: 12px;
$line: 18px;
padding-top: 18px;
padding-bottom: 8px;
line-height: $line;
h3 {
font-size: 14px;
padding-bottom: 9px;
}
.triangle-right {
margin-top: 5px;
li {
}
li.break {
margin-bottom: $line;
}
}
p {
color: $font-lighter;
margin-bottom: $line;
}
}
.lighter {
a {
color:$font-mid;
}
a:hover {
color:$font-dark;
}
}
#mailing-list {
.text {
width: 199px;
margin-right: 5px;
float: left;
}
button {
float: left;
}
form {
margin-top: -3px;
}
}
// end footer
// sub-footer
#sub-footer {
padding: 12px 0 13px;
color:$font-lighter;
}
// end sub-footer
// misc
.triangle {
vertical-align: middle;
}
.divider {
background:url(../images/divider-757575.png);
width: $total-width - $divider-gutter;
margin: 0 auto;
clear: both;
}
.divider-light {
@extend .divider;
background-image:url(../images/divider-787878.png);
height: 1px;
}
.divider-high {
@extend .divider;
height: 6px;
}
ul.triangle-right {
list-style: none;
padding-left: 0;
margin-left: 0;
li {
background:url(../images/triangle-right-ccc.png) no-repeat left center;
padding-left: 9px;
}
}
@mixin page {
padding-top: 33px;
}
// end misc
// typography
h1,
h2,
h3 {
@include special-copy-bold;
color:$font-dark;
}
h1 {
font-size: 24px;
color:$font-dark;
margin-bottom: 25px;
}
.lighter {
@include special-copy;
color:$font-lighter;
}
a {
color:$font-dark;
text-decoration: none;
}
a:hover {
color:$font-light;
}
.bluelinks {
color:$blue;
&:hover {
text-decoration: underline;
}
}
// end typography
// home
#home {
padding-top: 8px;
.box {
h2 {
@include special-copy;
font-size: 18px;
color: $font-home-grid;
opacity: 0.9;
margin-bottom: 9px;
}
p {
color:$font-home-grid;
opacity: 0.6;
}
.overlay {
display: block;
position:absolute;
top: 0;
left: 0;
background:rgba(35,42,47,0.2);
margin: 0;
img {
position:absolute;
bottom: 14px;
right: 10px;
}
}
}
.box:hover {
cursor: pointer;
h2 {
opacity: 1;
}
p {
opacity: 0.8;
}
.overlay {
background:none;
}
}
}
// end home
// work
#work {
@include page;
}
@mixin h3-grid {
font-size: 18px;
padding-top: 32px;
margin-bottom: 15px;
}
.workgrid {
@include clearfix;
padding-bottom: 31px;
position:relative;
.grid-2-padding {
&:hover {
.overlay {
opacity: 1;
}
a {
@extend .bluelinks:hover;
}
}
margin-bottom: 23px;
}
.preview {
width: 122px;
height: 122px;
padding: 4px;
border: 1px solid #cacaca;
margin-bottom: 8px;
position:relative;
a {
width: 122px;
height: 122px;
display: block;
}
.overlay {
position:absolute;
top: 4px;
left: 4px;
opacity: 0;
a {
}
}
}
.title {
@extend .bluelinks;
font-size: 11px;
line-height: 16px;
height: 16px;
display: block;
overflow: hidden;
width: 112px;
padding-right: 20px;
background-repeat: no-repeat;
background-position: right 1px;
}
h3 {
@include h3-grid;
margin-bottom: 16px;
}
.more {
@extend .bluelinks;
position:absolute;
top: 34px;
left: 814px;
background: url(/media/images/circle-cross-5e9cb1.png) no-repeat 0 1px;
font-size: 13px;
padding-left: 20px;
}
@each $type in animation, image, video {
.#{$type} {
.overlay a {
background: url(/media/images/work-overlay-#{$type}.png) no-repeat 0 0;
}
.title {
background-image:url(/media/images/work-#{$type}.png);
}
}
}
}
a.checkbox {
background: url(/media/images/checkbox.png) no-repeat 0 -15px;
height: 15px;
display: block;
padding-left: 22px;
&.on,
&:hover {
background-position: 0 0px;
}
}
.categories {
padding-top: 3px;
h2 {
font-size: 18px;
margin-bottom: 22px;
}
ul {
list-style: none;
border-top: 1px solid #ccc;
li {
border-bottom: 1px solid #ccc;
a {
@extend .bluelinks;
display: block;
padding: 11px 0 8px;
font-size: 13px;
span {
@extend .lighter;
color:#ccc;
}
}
a.children {
background: url(/media/images/triangle-down-ccc.png) no-repeat right center;
}
a.open {
background: url(/media/images/triangle-up-ccc.png) no-repeat right center;
}
ul {
padding-top: 9px;
padding-bottom: 2px;
}
li {
border: none;
padding: 0;
margin: 0;
padding-bottom: 6px;
a {
@extend .checkbox;
padding-top: 0;
padding-bottom: 0;
margin: 0;
border: none;
font-size: 12px;
color:$font-light;
&:hover {
text-decoration: none;
}
span {
@include body-copy;
color:#ccc;
}
}
}
}
.current {
a {
color:$font-light;
font-weight: bold;
background: none;
&:hover {
text-decoration: none;
}
}
}
}
}
.pagination {
@include clearfix;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 14px 0;
margin-bottom: 28px;
.box {
ul {
list-style: none;
li {
float: left;
padding: 0;
margin: 0;
}
}
a {
display: block;
vertical-align: middle;
}
}
.filters {
label {
float: left;
margin-right: 8px;
padding-top: 6px;
color:$font-light;
}
li {
width: 135px;
}
}
.numbers {
float: right;
ul li {
margin-left: 8px;
vertical-align: baseline;
}
.ellip {
padding-top: 6px;
}
}
}
// end work
// project type
#project-type {
@include page;
h1 {
margin-bottom: 12px;
}
h2 {
@include special-copy;
font-size: 24px;
text-transform:none;
color:$font-light;
line-height: 30px;
margin-bottom: 29px;
a {
@extend .bluelinks;
}
}
h3 {
@include h3-grid;
}
$base-spacing: 36px;
.video {
width: 612px;
height: 344px;
background:#cf0;
margin-top: 1px;
margin-bottom: $base-spacing;
}
blockquote {
@include special-copy;
color:$font-light;
text-transform: none;
padding: 0 45px 12px 0;
margin: 0;
font-size: 18px;
line-height: 24px;
background:url(/media/images/quote.png) no-repeat right 6px;
}
cite {
padding: 0;
margin: 0;
font-style: normal;
font-size: 12px;
color:#b3b3b3;
margin-bottom: $base-spacing;
}
.types-list {
a {
@extend .bluelinks;
}
h3 {
margin-bottom: 16px;
}
h4 {
@include special-copy;
text-transform: none;
font-size: 18px;
line-height: 1.2;
margin-bottom: 36px;
}
}
}
#project-type,
#project {
.workgrid {
padding-bottom: 35px;
}
}
// end project type
// project
#project-details {
@include clearfix;
padding-top: 36px;
padding-bottom: 39px;
.bread {
padding-top: 10px;
}
h1 {
margin-top: -5px;
margin-bottom: 6px;
}
.ref {
font-size: 11px;
color:$font-lighter;
text-transform: uppercase;
margin-bottom: 13px;
}
.button {
margin-bottom: 24px;
}
.tabs {
margin-bottom: 10px;
}
}
.bread {
@include clearfix;
color:#b3b3b3;
list-style:none;
padding: 0;
magin: 0;
li {
float: left;
margin-right: 4px;
}
a {
@extend .bluelinks;
}
}
.tabs {
@include special-copy-bold;
@include clearfix;
list-style: none;
margin: 0;
padding: 0;
font-size: 14px;
width: 100%;
clear: both;
border-bottom: 1px solid #CCCCCC;
border-left: 1px solid #CCCCCC;
$height: 37px;
li {
float: left;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #CCCCCC;
height: $height;
}
a {
padding: 8px 13px 0 13px;
height: $height - 8;
display: block;
vertical-align: top;
background:#fafafa;
}
li.current a,
a:hover {
background:#fff;
padding-bottom: 1px;
color:$font-light;
}
}
.tabfocus {
color:$font-mid;
}
// end project
@asgrim

asgrim commented Feb 1, 2012

Copy link
Copy Markdown

That's of pretty CSS right there.

@jaspertandy

Copy link
Copy Markdown
Author

Yeah, SASS is a lovely way to write stylesheets. Can't believe this is the first time I've ever used it on a project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment