Moving to SCSS

master
Nick Sergeant 2012-02-10 22:38:59 -05:00
parent 29c3d31688
commit bf19602b63
7 changed files with 8276 additions and 869 deletions

5
snipt/fabfile.py vendored
View File

@ -6,14 +6,11 @@ def staticfiles():
BASE_PATH = os.path.dirname(__file__) BASE_PATH = os.path.dirname(__file__)
# CSS # CSS
local('lessc %s/media/css/style.less %s/media/css/style.css' % (BASE_PATH, BASE_PATH)) local('sass %s/media/css/style.scss %s/media/css/style.css' % (BASE_PATH, BASE_PATH))
local('sed -i -e \'s/\/media\//https:\/\/snipt.s3.amazonaws.com\//g\' %s/media/css/style.css' % BASE_PATH) local('sed -i -e \'s/\/media\//https:\/\/snipt.s3.amazonaws.com\//g\' %s/media/css/style.css' % BASE_PATH)
local('rm %s/media/css/style.css-e' % BASE_PATH) local('rm %s/media/css/style.css-e' % BASE_PATH)
css = [ css = [
'%s/media/css/reset.css' % BASE_PATH,
'%s/media/css/style.css' % BASE_PATH, '%s/media/css/style.css' % BASE_PATH,
'%s/media/css/bootstrap.css' % BASE_PATH,
'%s/media/css/themes.css' % BASE_PATH,
] ]
local('cat %s > %s/media/cache/snipt.css' % (' '.join(css), BASE_PATH)) local('cat %s > %s/media/cache/snipt.css' % (' '.join(css), BASE_PATH))

View File

@ -1,48 +0,0 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +1,58 @@
@import 'bootstrap', 'themes';
// Fonts // Fonts
@Helvetica: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; $Helvetica: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
@Consolas: Consolas, Menlo, "Courier New", monospace; $Consolas: Consolas, Menlo, "Courier New", monospace;
// Mixins // Mixins
.border-radius(@radius: 5px) { @mixin border-radius($radius: 5px) {
-webkit-background-clip: padding-box; -webkit-background-clip: padding-box;
-webkit-border-radius: @radius; -webkit-border-radius: $radius;
-moz-background-clip: padding-box; -moz-background-clip: padding-box;
-moz-border-radius: @radius; -moz-border-radius: $radius;
border-radius: @radius; border-radius: $radius;
background-clip: padding-box; background-clip: padding-box;
} }
.box-shadow(@horizontal: 0px, @vertical: 1px, @blur: 2px, @color: #CCC) { @mixin box-shadow($horizontal: 0px, $vertical: 1px, $blur: 2px, $color: #CCC) {
-webkit-box-shadow: @horizontal @vertical @blur @color; -webkit-box-shadow: $horizontal $vertical $blur $color;
-moz-box-shadow: @horizontal @vertical @blur @color; -moz-box-shadow: $horizontal $vertical $blur $color;
box-shadow: @horizontal @vertical @blur @color; box-shadow: $horizontal $vertical $blur $color;
} }
.inset-box-shadow(@horizontal: 0px, @vertical: 1px, @blur: 2px, @color: #CCC) { @mixin inset-box-shadow($horizontal: 0px, $vertical: 1px, $blur: 2px, $color: #CCC) {
-webkit-box-shadow: inset @horizontal @vertical @blur @color; -webkit-box-shadow: inset $horizontal $vertical $blur $color;
-moz-box-shadow: inset @horizontal @vertical @blur @color; -moz-box-shadow: inset $horizontal $vertical $blur $color;
box-shadow: inset @horizontal @vertical @blur @color; box-shadow: inset $horizontal $vertical $blur $color;
} }
.multi-color-border(@top, @sides, @bottom) { @mixin multi-color-border($top, $sides, $bottom) {
border-top: 1px solid @top; border-top: 1px solid $top;
border-left: 1px solid @sides; border-left: 1px solid $sides;
border-right: 1px solid @sides; border-right: 1px solid $sides;
border-bottom: 1px solid @bottom; border-bottom: 1px solid $bottom;
} }
.multi-border-radius(@topLeft: 5px, @topRight: 5px, @bottomRight: 5px, @bottomLeft: 5px) { @mixin multi-border-radius($topLeft: 5px, $topRight: 5px, $bottomRight: 5px, $bottomLeft: 5px) {
-webkit-border-top-left-radius: @topLeft; -webkit-border-top-left-radius: $topLeft;
-webkit-border-top-right-radius: @topRight; -webkit-border-top-right-radius: $topRight;
-webkit-border-bottom-right-radius: @bottomRight; -webkit-border-bottom-right-radius: $bottomRight;
-webkit-border-bottom-left-radius: @bottomLeft; -webkit-border-bottom-left-radius: $bottomLeft;
-moz-border-radius-topleft: @topLeft; -moz-border-radius-topleft: $topLeft;
-moz-border-radius-topright: @topRight; -moz-border-radius-topright: $topRight;
-moz-border-radius-bottomright: @bottomRight; -moz-border-radius-bottomright: $bottomRight;
-moz-border-radius-bottomleft: @bottomLeft; -moz-border-radius-bottomleft: $bottomLeft;
border-top-left-radius: @topLeft; border-top-left-radius: $topLeft;
border-top-right-radius: @topRight; border-top-right-radius: $topRight;
border-bottom-right-radius: @bottomRight; border-bottom-right-radius: $bottomRight;
border-bottom-left-radius: @bottomLeft; border-bottom-left-radius: $bottomLeft;
} }
.vertical-gradient(@start: #000, @stop: #FFF) { background: (@start + @stop) / 2; @mixin vertical-gradient($start: #000, $stop: #FFF) { background: ($start + $stop) / 2;
background: -webkit-gradient(linear, left top, left bottom, from(@start), to(@stop)); background: -webkit-gradient(linear, left top, left bottom, from($start), to($stop));
background: -moz-linear-gradient(center top, @start 0%, @stop 100%); background: -moz-linear-gradient(center top, $start 0%, $stop 100%);
background: -moz-gradient(center top, @start 0%, @stop 100%); background: -moz-gradient(center top, $start 0%, $stop 100%);
} }
.vertical-gradient-with-image(@start: #000, @stop: #FFF, @image) { @mixin vertical-gradient-with-image($image, $start: #000, $stop: #FFF) {
background: (@start + @stop) / 2 @image; background: ($start + $stop) / 2 $image;
background: @image, -webkit-gradient(linear, left top, left bottom, from(@start), to(@stop)); background: $image, -webkit-gradient(linear, left top, left bottom, from($start), to($stop));
background: @image, -moz-linear-gradient(center top, @start 0%, @stop 100%); background: $image, -moz-linear-gradient(center top, $start 0%, $stop 100%);
background: @image, -moz-gradient(center top, @start 0%, @stop 100%); background: $image, -moz-gradient(center top, $start 0%, $stop 100%);
} }
// Page // Page
@ -59,7 +61,7 @@ html, body {
} }
body { body {
color: #666; color: #666;
font: normal 14px @Helvetica; font: normal 14px $Helvetica;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
li { li {
@ -67,6 +69,18 @@ body {
} }
} }
// Utils
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.hidden {
display: none;
}
// Global // Global
header.main { header.main {
background: #12343D url('/media/images/header-bg.gif') top left repeat-x; background: #12343D url('/media/images/header-bg.gif') top left repeat-x;
@ -119,7 +133,7 @@ header.main {
color: #72979C; color: #72979C;
cursor: text; cursor: text;
float: none; float: none;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
left: 30px; left: 30px;
position: absolute; position: absolute;
top: 8px; top: 8px;
@ -130,14 +144,14 @@ header.main {
background: rgba(43, 82, 93, .5) url('/media/images/search-icon.png') 8px center no-repeat; background: rgba(43, 82, 93, .5) url('/media/images/search-icon.png') 8px center no-repeat;
border: 1px solid #3A5E67; border: 1px solid #3A5E67;
color: #FFF; color: #FFF;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
height: auto; height: auto;
margin: 0; margin: 0;
padding: 7px; padding: 7px;
padding-left: 28px; padding-left: 28px;
width: 175px; width: 175px;
.border-radius(3px); @include border-radius(3px);
.inset-box-shadow(0, 1px, 0px, #1D4249); @include inset-box-shadow(0, 1px, 0px, #1D4249);
&:focus { &:focus {
border-color: #62D5E1; border-color: #62D5E1;
@ -161,7 +175,7 @@ header.main {
color: #FFF; color: #FFF;
display: block; display: block;
float: left; float: left;
font: 500 14px @Helvetica; font: 500 14px $Helvetica;
padding: 7px; padding: 7px;
padding-bottom: 4px; padding-bottom: 4px;
margin-right: 20px; margin-right: 20px;
@ -191,7 +205,7 @@ header.main {
} }
} }
header.sub { header.sub {
.vertical-gradient(#ECECEC, #DBDBDB); @include vertical-gradient(#ECECEC, #DBDBDB);
div.inner { div.inner {
border-left: 1px solid #d0d0d0; border-left: 1px solid #d0d0d0;
@ -218,7 +232,7 @@ header.sub {
a { a {
color: #999999; color: #999999;
font: bold 12px @Consolas; font: bold 12px $Consolas;
text-decoration: none; text-decoration: none;
text-shadow: 0 1px 0 #FFF; text-shadow: 0 1px 0 #FFF;
@ -228,7 +242,7 @@ header.sub {
} }
&.prompt { &.prompt {
color: #999999; color: #999999;
font: bold 12px @Consolas; font: bold 12px $Consolas;
margin-right: 3px; margin-right: 3px;
text-shadow: 0 1px 0 #FFF; text-shadow: 0 1px 0 #FFF;
} }
@ -237,7 +251,7 @@ header.sub {
div.shortcuts { div.shortcuts {
color: #999999; color: #999999;
float: right; float: right;
font: bold 12px @Consolas; font: bold 12px $Consolas;
padding-top: 6px; padding-top: 6px;
text-shadow: 0 1px 0 #FFF; text-shadow: 0 1px 0 #FFF;
} }
@ -282,12 +296,12 @@ section.main {
margin: 0 15px 6px; margin: 0 15px 6px;
padding: 15px 14px; padding: 15px 14px;
width: 130px; width: 130px;
.border-radius(4px); @include border-radius(4px);
a { a {
color: #939393; color: #939393;
display: block; display: block;
font: normal 11px/12px @Helvetica; font: normal 11px/12px $Helvetica;
text-decoration: none; text-decoration: none;
img { img {
@ -302,7 +316,7 @@ section.main {
} }
div.meta { div.meta {
color: #939393; color: #939393;
font: normal 11px/12px @Helvetica; font: normal 11px/12px $Helvetica;
margin: 0 15px; margin: 0 15px;
text-align: center; text-align: center;
text-transform: uppercase; text-transform: uppercase;
@ -323,7 +337,7 @@ section.main {
h1 { h1 {
background: transparent url('/media/images/tags-icon.png') 0 0 no-repeat; background: transparent url('/media/images/tags-icon.png') 0 0 no-repeat;
color: #3BAAF3; color: #3BAAF3;
font: bold 12px @Helvetica; font: bold 12px $Helvetica;
padding-bottom: 5px; padding-bottom: 5px;
padding-left: 22px; padding-left: 22px;
} }
@ -338,7 +352,7 @@ section.main {
a { a {
border-bottom: 1px solid #5AB6F4; border-bottom: 1px solid #5AB6F4;
color: #5AB6F4; color: #5AB6F4;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
text-decoration: none; text-decoration: none;
&:hover { &:hover {
@ -370,7 +384,7 @@ section.main {
a { a {
border-bottom: 1px solid #999; border-bottom: 1px solid #999;
color: #999; color: #999;
font: bold 12px @Helvetica; font: bold 12px $Helvetica;
text-decoration: none; text-decoration: none;
&:hover { &:hover {
@ -398,7 +412,7 @@ article.snipt {
div.number { div.number {
color: #CCC; color: #CCC;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
left: -115px; left: -115px;
position: absolute; position: absolute;
text-align: right; text-align: right;
@ -429,12 +443,12 @@ article.snipt {
} }
header { header {
border-bottom: 1px solid #F1F1EE; border-bottom: 1px solid #F1F1EE;
.inset-box-shadow(0, -1px, 0, #FFF); @include inset-box-shadow(0, -1px, 0, #FFF);
.vertical-gradient(#FFF, #FFFAF2); @include vertical-gradient(#FFF, #FFFAF2);
h1 { h1 {
clear: left; clear: left;
font: bold 16px/20px @Helvetica; font: bold 16px/20px $Helvetica;
margin: 8px 15px 10px 15px; margin: 8px 15px 10px 15px;
a { a {
@ -459,7 +473,7 @@ article.snipt {
border-top: 0; border-top: 0;
color: #73BBC5; color: #73BBC5;
display: inline-block; display: inline-block;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
margin-left: 15px; margin-left: 15px;
padding: 3px 8px 2px 8px; padding: 3px 8px 2px 8px;
} }
@ -475,7 +489,7 @@ article.snipt {
pre { pre {
background: transparent; background: transparent;
border: none; border: none;
font: normal 12px/16px @Consolas; font: normal 12px/16px $Consolas;
font-weight: normal !important; font-weight: normal !important;
overflow-x: auto; overflow-x: auto;
margin: 0 15px; margin: 0 15px;
@ -489,19 +503,19 @@ article.snipt {
bottom: 0; bottom: 0;
color: #999999; color: #999999;
display: block; display: block;
font: bold 12px @Helvetica; font: bold 12px $Helvetica;
padding: 15px 40px 15px 40px; padding: 15px 40px 15px 40px;
position: absolute; position: absolute;
text-decoration: none; text-decoration: none;
text-transform: uppercase; text-transform: uppercase;
width: 100%; width: 100%;
.box-shadow(0, -25px, 25px, #FFF); @include box-shadow(0, -25px, 25px, #FFF);
span.collapse { span.collapse {
display: none; display: none;
} }
span.lines { span.lines {
font: normal 10px @Helvetica; font: normal 10px $Helvetica;
margin-left: 5px; margin-left: 5px;
vertical-align: 1px; vertical-align: 1px;
} }
@ -519,42 +533,42 @@ article.snipt {
} }
section.emacs, section.default { section.emacs, section.default {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #F8F8F8); @include box-shadow(0, -25px, 25px, #F8F8F8);
} }
} }
section.friendly { section.friendly {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #F0F0F0); @include box-shadow(0, -25px, 25px, #F0F0F0);
} }
} }
section.fruity { section.fruity {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #111111); @include box-shadow(0, -25px, 25px, #111111);
} }
} }
section.manni { section.manni {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #F0F3F3); @include box-shadow(0, -25px, 25px, #F0F3F3);
} }
} }
section.monokai { section.monokai {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #272822); @include box-shadow(0, -25px, 25px, #272822);
} }
} }
section.native { section.native {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #202020); @include box-shadow(0, -25px, 25px, #202020);
} }
} }
section.perldoc { section.perldoc {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #EEEEDD); @include box-shadow(0, -25px, 25px, #EEEEDD);
} }
} }
section.tango { section.tango {
a.expand { a.expand {
.box-shadow(0, -25px, 25px, #F8F8F8); @include box-shadow(0, -25px, 25px, #F8F8F8);
} }
} }
&:after { &:after {
@ -565,7 +579,7 @@ article.snipt {
right: 3px; right: 3px;
width: 50%; width: 50%;
z-index: 48; z-index: 48;
.box-shadow(0, 6px, 12px, rgba(184, 184, 184, .6)); @include box-shadow(0, 6px, 12px, rgba(184, 184, 184, .6));
-webkit-transform: rotate(3deg); -webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg); -moz-transform: rotate(3deg);
-o-transform: rotate(3deg); -o-transform: rotate(3deg);
@ -588,7 +602,7 @@ article.snipt {
background: rgba(128, 128, 128, .15) url('/media/images/edit-icon.png') 14px center no-repeat; background: rgba(128, 128, 128, .15) url('/media/images/edit-icon.png') 14px center no-repeat;
color: #000; color: #000;
display: block; display: block;
font: bold 12px @Helvetica; font: bold 12px $Helvetica;
opacity: .5; opacity: .5;
padding: 7px 10px 7px 35px; padding: 7px 10px 7px 35px;
position: relative; position: relative;
@ -630,7 +644,7 @@ article.snipt {
h2 { h2 {
background: transparent url('/media/images/snipt-tags-icon.png') 15px center no-repeat; background: transparent url('/media/images/snipt-tags-icon.png') 15px center no-repeat;
color: #999999; color: #999999;
font: bold 12px @Helvetica; font: bold 12px $Helvetica;
padding: 7px 0 7px 35px; padding: 7px 0 7px 35px;
} }
ul { ul {
@ -644,7 +658,7 @@ article.snipt {
border-bottom: 1px solid #999; border-bottom: 1px solid #999;
color: #999; color: #999;
display: inline-block; display: inline-block;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
max-width: 72px; max-width: 72px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -676,13 +690,13 @@ article.snipt {
background: transparent url('/media/images/calendar-icon.png') top left no-repeat; background: transparent url('/media/images/calendar-icon.png') top left no-repeat;
color: #999; color: #999;
display: inline; display: inline;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
margin-right: 15px; margin-right: 15px;
padding: 1px 0 0 24px; padding: 1px 0 0 24px;
a { a {
color: #999; color: #999;
font: normal 12px @Helvetica; font: normal 12px $Helvetica;
text-decoration: none; text-decoration: none;
&:hover { &:hover {
@ -747,7 +761,7 @@ article.snipt {
article.private-snipt { article.private-snipt {
div.container { div.container {
header { header {
.vertical-gradient-with-image(#FFF, #FFFAF2, url('/media/images/private-icon.png') top right no-repeat); @include vertical-gradient-with-image(#FFF, #FFFAF2, url('/media/images/private-icon.png') top right no-repeat);
h1 { h1 {
a { a {
@ -868,15 +882,3 @@ body.detail {
} }
} }
} }
// Utils
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.hidden {
display: none;
}

View File

@ -6,10 +6,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="description" content="Long-term memory for coders. Share and store code snippets." /> <meta name="description" content="Long-term memory for coders. Share and store code snippets." />
{% if debug %} {% if debug %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/reset.css" /> <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" />
<link rel="stylesheet/less" href="{{ STATIC_URL }}css/style.less" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/themes.css" />
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/a_underscore.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}js/libs/a_underscore.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/b_jquery.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}js/libs/b_jquery.js"></script>
@ -22,7 +19,6 @@
<script type="text/javascript" src="{{ STATIC_URL }}js/src/application.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}js/src/application.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/src/modules/site.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}js/src/modules/site.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/src/modules/snipt.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}js/src/modules/snipt.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}css/less.js"></script>
{% else %} {% else %}
<link rel="stylesheet" href="{{ STATIC_URL }}cache/snipt.css" /> <link rel="stylesheet" href="{{ STATIC_URL }}cache/snipt.css" />
<script type="text/javascript" src="{{ STATIC_URL }}cache/snipt.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}cache/snipt.js"></script>