Created
June 24, 2012 07:05
-
-
Save benknight/2982168 to your computer and use it in GitHub Desktop.
I just wanted to post an example of how my CSS looks in a post-preprocessor world.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// imports | |
@import 'normalize.less'; | |
@import 'grid.less'; | |
@import 'helpers.less'; | |
@import 'mixins.less'; | |
// brand colors | |
@red: hsl(6, 89%, 59%); | |
@light_gray: hsl(0, 0%, 93%); | |
// apply a natural box layout model to all elements | |
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } | |
// class for showing certain elements only on mobile | |
.mobile { display: none; } | |
// structure | |
body { | |
color: #000; | |
font: 13px/1.4 'adobe-garamond-pro', Times, serif; | |
padding: 0 2em; | |
} | |
select, input, textarea { | |
color: #444; | |
font-family: Arial, sans-serif; | |
} | |
#page { | |
padding-top: 100px; | |
} | |
.row { | |
position: relative; | |
} | |
// logo | |
.site-title { | |
margin: 0; | |
} | |
.logo { | |
display: block; | |
img { | |
display: block; | |
height: auto; | |
} | |
} | |
.animation { | |
width: 165px; // *shudder* | |
height: auto; | |
margin-top: 16px; | |
} | |
// nav | |
.navbar { | |
position: absolute; | |
top: 2em; | |
right: 0; | |
height: 100px; | |
} | |
.main-nav { | |
ul { | |
position: relative; | |
float: left; | |
padding: 0; | |
margin: 2px 1em 10px 0; | |
} | |
li { | |
float: left; | |
margin: 0 1em; | |
} | |
a { | |
display: block; | |
color: black; | |
text-decoration: none; | |
font-size: 140%; | |
line-height: 1.1; | |
border-bottom: 2px solid transparent; | |
&:hover, | |
&.menuactive { | |
border-color: @red; | |
} | |
} | |
.searchform { | |
float: left; | |
} | |
} | |
.sub-nav { | |
ul { | |
float: left; | |
min-width: 200px; | |
height: 2em; | |
line-height: 2em; | |
background: @light_gray; | |
margin: 0 0 1em 0; | |
padding: 0 1em; | |
li { | |
float: left; | |
} | |
a { | |
color: black; | |
text-decoration: none; | |
} | |
a.menuactive { | |
color: @red; | |
} | |
} | |
} | |
// search | |
.searchform { | |
input { | |
float: left; | |
height: 23px; | |
outline: none; | |
} | |
input[type=search] { | |
padding: 0 .5em; | |
width: 180px; | |
background-color: @light_gray; | |
border: none; | |
box-shadow: | |
inset 1px 1px 2px rgba(0,0,0,0.38); | |
font-size: 12px; | |
} | |
input[type=submit] { | |
background: url(../img/mag-glass.png) no-repeat; | |
width: 26px; | |
} | |
} | |
// content | |
h1, .h1 { | |
color: @red; | |
font-size: 150%; | |
font-weight: normal; | |
} | |
h2, .h2 { | |
font-size: 115%; | |
} | |
h3, .h3 { | |
font-size: 100%; | |
} | |
h4, .h4 { | |
font-size: 80%; | |
} | |
h2 + h3 { | |
margin-top: -1em; | |
font-weight: normal; | |
font-style: italic; | |
} | |
.content { | |
background: url(../img/homes-strip.png) no-repeat right top; | |
min-height: 500px; | |
padding: 0 20% 2em 5%; | |
} | |
.page-title { | |
margin-top: 0; | |
} | |
// footer | |
.footer { | |
margin: 2em 0; | |
border-top: 3px solid @red; | |
.vcard { | |
float: left; | |
i { | |
font-style: normal; | |
} | |
} | |
.copyright { | |
float: right; | |
} | |
} | |
// small screen | |
@media handheld, only screen and (max-width: 800px) { | |
body { | |
font-size: 16px; | |
padding: 0 1em; | |
} | |
.mobile { | |
display: block; | |
} | |
#page { | |
padding-top: 20px; | |
} | |
.content { | |
padding-left: 0; | |
} | |
// branding & nav | |
#branding { | |
position: relative; | |
height: 140px; | |
padding-left: 190px; | |
} | |
.animation { | |
position: absolute; | |
top: 0; | |
left: 0; | |
margin: 0; | |
} | |
.site-title { | |
padding-top: 4px; | |
} | |
.navbar { | |
position: static; | |
height: auto; | |
} | |
.main-nav { | |
position: absolute; | |
top: 83px; | |
left: 186px; | |
li { | |
margin: 0 1em 0 0; | |
} | |
a { | |
font-size: 120%; | |
} | |
} | |
.sub-nav ul { | |
float: none; | |
} | |
// content | |
.page-title { | |
padding-top: .5em; | |
border-top: 3px solid @light_gray; | |
} | |
// footer | |
.footer { | |
font-size: 80%; | |
p { | |
float: none !important; | |
} | |
} | |
// grid adjustments | |
.row, .container { | |
width: 100%; | |
min-width: 0; | |
margin-left: 0; | |
margin-right: 0; | |
padding-left: 0; | |
padding-right: 0; | |
} | |
.row .span1, .row .span2, .row .span3, .row .span4, .row .span5, .row .span6, .row .span7, .row .span8, .row .span9, .row .span10, .row .span11, .row .span12, .row .span13, .row .span14, .row .span15, .row .span16, .row .span17, .row .span18, .row .span19, .row .span20, .row .span21, .row .span22, .row .span23, .row .span24 | |
{ | |
width: auto; | |
float: none; | |
margin-left: 0; | |
margin-right: 0; | |
padding-left: 0; | |
padding-right: 0; | |
} | |
} | |
// mobile | |
@media handheld, only screen and (max-width: 639px) { | |
// branding & nav | |
#branding { | |
padding-left: 95px; | |
height: 80px; | |
} | |
.logo .animation { | |
width: auto; | |
height: 60px; | |
} | |
.main-nav { | |
position: static; | |
li { | |
margin: 0 1em .5em 0; | |
} | |
} | |
.searchform { | |
display: none; | |
} | |
.content { | |
padding: 0; | |
min-height: 0; | |
background: none; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment