turbosass 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/Gemfile +3 -0
- data/README.markdown +55 -0
- data/Rakefile +15 -0
- data/bin/turbosass +11 -0
- data/example/sinatra/app.rb +10 -0
- data/example/sinatra/config.ru +5 -0
- data/example/sinatra/views/index.haml +11 -0
- data/example/sinatra/views/style.scss +7 -0
- data/lib/turbosass/scss/_turbosass.scss +13 -0
- data/lib/turbosass/scss/turbosass/_buttons.scss +180 -0
- data/lib/turbosass/scss/turbosass/_css3.scss +151 -0
- data/lib/turbosass/scss/turbosass/_fonts.scss +20 -0
- data/lib/turbosass/scss/turbosass/_grid.scss +119 -0
- data/lib/turbosass/scss/turbosass/_ie6.scss +33 -0
- data/lib/turbosass/scss/turbosass/_reset.scss +99 -0
- data/lib/turbosass/scss/turbosass/_utils.scss +87 -0
- data/lib/turbosass/version.rb +3 -0
- data/lib/turbosass.rb +18 -0
- data/turbosass.gemspec +25 -0
- metadata +102 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# TurboSass
|
2
|
+
|
3
|
+
TurboSass is a vast collection of SCSS mixins for maximum productivitiy and minimal development time.
|
4
|
+
|
5
|
+
The mixins are divided in the following categories:
|
6
|
+
|
7
|
+
* CSS3 helpers, doing proper handling of all currently supported vendor prefixes.
|
8
|
+
|
9
|
+
* A grid system loosely based on 960.gs but using a configurable gutter width, amount of columns and column width.
|
10
|
+
|
11
|
+
* A web font wrapper.
|
12
|
+
|
13
|
+
* The HTML5 Boilerplate reset CSS.
|
14
|
+
|
15
|
+
* Various other utilities, such as sticky footer, clearfix, image replacement and selection color.
|
16
|
+
|
17
|
+
# Installation
|
18
|
+
|
19
|
+
To install TurboSass, just do:
|
20
|
+
|
21
|
+
gem install turbosass
|
22
|
+
|
23
|
+
and then you're ready to go.
|
24
|
+
|
25
|
+
# Usage
|
26
|
+
|
27
|
+
## Sinatra
|
28
|
+
|
29
|
+
TurboSass was built mainly for use in Sinatra applications, so using it here is really simple.
|
30
|
+
|
31
|
+
All you have to do is `require "turbosass"` in either your `config.ru` file or your main application file. Then you can use `@import "turbosass";` in any SCSS file where you want to use TurboSass.
|
32
|
+
|
33
|
+
See the `examples/sinatra` directory for a fully working example.
|
34
|
+
|
35
|
+
## But I don't use one of those fancy-pants frameworks
|
36
|
+
|
37
|
+
You can find the SCSS files that are used by TurboSass in the `lib/turbosass/scss` directory. Just copy these to wherever you like, just make sure to keep the directory structure intact. Then you can import the `turbosass` SCSS file to use the mixins.
|
38
|
+
|
39
|
+
You can also compile an SCSS file with TurboSass from the command line. For this you can use the `turbosass` binary. This is a wrapper around the original Sass command line tool, but it ensures that the TurboSass files are in the include path. This saves you the hassle of typing in the exact path every time.
|
40
|
+
|
41
|
+
# Documentation
|
42
|
+
|
43
|
+
All the SCSS mixins are documented with comments. To get an overview of these comments in HTML format you can execute `rake rocco` in the gem directory. This generates a `doc` directory with annotated source files.
|
44
|
+
|
45
|
+
Do note that in order to do this you need the Git version (or any version after 1.5) of Rocco because version 1.5 and below have unicode bugs which cause documentation to fail on files having the `@font-face` smiley trick.
|
46
|
+
|
47
|
+
# License
|
48
|
+
|
49
|
+
Copyright (c) 2010-2011 Emil Loer <http://emilloer.com>
|
50
|
+
|
51
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
52
|
+
|
53
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
54
|
+
|
55
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "bundler"
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
begin
|
5
|
+
require "rocco/tasks"
|
6
|
+
|
7
|
+
desc "Compile Rocco documentation"
|
8
|
+
Rocco::make "doc", "lib/turbosass/scss/turbosass/*.scss", {
|
9
|
+
:language => "scss",
|
10
|
+
:comment_chars => "//"
|
11
|
+
}
|
12
|
+
rescue LoadError
|
13
|
+
warn "Rocco not loaded"
|
14
|
+
task :rocco
|
15
|
+
end
|
data/bin/turbosass
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
!!!
|
2
|
+
%html{:lang => "en"}
|
3
|
+
%head
|
4
|
+
%meta{:charset => "utf-8"}
|
5
|
+
%meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
|
6
|
+
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
|
7
|
+
%title TurboSass Example
|
8
|
+
%link{:rel => "stylesheet", :href => "/style.css"}
|
9
|
+
%body
|
10
|
+
%h1 This is a Sinatra/TurboSass example
|
11
|
+
%p And as you can see, it works perfectly!
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is the TurboSass main import file. You should import this file
|
2
|
+
// in your main stylesheet.
|
3
|
+
//
|
4
|
+
// Alternatively you can import one of the indivitual modules, but note
|
5
|
+
// that some of these modules depend on `utils.scss`.
|
6
|
+
|
7
|
+
@import "turbosass/reset";
|
8
|
+
@import "turbosass/grid";
|
9
|
+
@import "turbosass/utils";
|
10
|
+
@import "turbosass/ie6";
|
11
|
+
@import "turbosass/css3";
|
12
|
+
@import "turbosass/buttons";
|
13
|
+
@import "turbosass/fonts";
|
@@ -0,0 +1,180 @@
|
|
1
|
+
// ## Fancy button
|
2
|
+
//
|
3
|
+
// Usage:
|
4
|
+
//
|
5
|
+
// <button>Click me</button>
|
6
|
+
//
|
7
|
+
// And then in your SCSS file:
|
8
|
+
//
|
9
|
+
// button {
|
10
|
+
// @include button;
|
11
|
+
// // insert any optional button helper mixins here
|
12
|
+
// }
|
13
|
+
@mixin button {
|
14
|
+
@include border-radius(6px);
|
15
|
+
@include box-shadow(0px 1px 3px rgba(0,0,0,0.6));
|
16
|
+
background: #222 url(/images/button.png) repeat-x;
|
17
|
+
display: inline-block;
|
18
|
+
padding: 5px 10px 6px;
|
19
|
+
color: #fff;
|
20
|
+
text-decoration: none;
|
21
|
+
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
|
22
|
+
border: none;
|
23
|
+
border-bottom: 1px solid rgba(0,0,0,0.25);
|
24
|
+
position: relative;
|
25
|
+
cursor: pointer;
|
26
|
+
line-height: 1;
|
27
|
+
font-weight: bold;
|
28
|
+
font-size: 13px;
|
29
|
+
|
30
|
+
&:hover {
|
31
|
+
background-color: #111;
|
32
|
+
color: #fff;
|
33
|
+
}
|
34
|
+
|
35
|
+
&:active {
|
36
|
+
top: 1px;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
// Make the button smaller
|
41
|
+
@mixin smallbutton {
|
42
|
+
font-size: 11px;
|
43
|
+
}
|
44
|
+
|
45
|
+
// Make the button larger
|
46
|
+
@mixin largebutton {
|
47
|
+
font-size: 14px;
|
48
|
+
padding: 8px 14px 9px;
|
49
|
+
}
|
50
|
+
|
51
|
+
// Make the button even larger
|
52
|
+
@mixin xlargebutton {
|
53
|
+
font-size: 24px;
|
54
|
+
padding: 8px 14px 9px;
|
55
|
+
}
|
56
|
+
|
57
|
+
// Make the button huge
|
58
|
+
@mixin xxlargebutton {
|
59
|
+
font-size: 72px;
|
60
|
+
padding: 8px 14px 9px;
|
61
|
+
}
|
62
|
+
|
63
|
+
// Give the button a pink color scheme
|
64
|
+
@mixin pinkbutton {
|
65
|
+
background-color: #e22092;
|
66
|
+
|
67
|
+
&:hover {
|
68
|
+
background-color: #c81e82;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
// Give the button a green color scheme
|
73
|
+
@mixin greenbutton {
|
74
|
+
background-color: #91bd09;
|
75
|
+
|
76
|
+
&:hover {
|
77
|
+
background-color: #749a02;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// Give the button a red color scheme
|
82
|
+
@mixin redbutton {
|
83
|
+
background-color: #e62727;
|
84
|
+
|
85
|
+
&:hover {
|
86
|
+
background-color: #cf2525;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
// Give the button an orange color scheme
|
91
|
+
@mixin orangebutton {
|
92
|
+
background-color: #ff5c00;
|
93
|
+
|
94
|
+
&:hover {
|
95
|
+
background-color: #d45500;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
// Give the button a blue color scheme
|
100
|
+
@mixin bluebutton {
|
101
|
+
background-color: #2981e4;
|
102
|
+
|
103
|
+
&:hover {
|
104
|
+
background-color: #2575cf;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
// Give the button a yellow color scheme
|
109
|
+
@mixin yellowbutton {
|
110
|
+
background-color: #ffb515;
|
111
|
+
|
112
|
+
&:hover {
|
113
|
+
background-color: #fc9200;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
// Give the button a grey color scheme
|
118
|
+
@mixin greybutton {
|
119
|
+
background-color: #aaaaaa;
|
120
|
+
|
121
|
+
&:hover {
|
122
|
+
background-color: #999999;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
// ## iOS style checkbox/switch
|
127
|
+
//
|
128
|
+
// Usage:
|
129
|
+
//
|
130
|
+
// <label>
|
131
|
+
// <input type="checkbox"/>
|
132
|
+
// <span class="check"></span>
|
133
|
+
// </label>
|
134
|
+
//
|
135
|
+
// And then in your SCSS file:
|
136
|
+
//
|
137
|
+
// label {
|
138
|
+
// @include iphonecheckbox;
|
139
|
+
// }
|
140
|
+
@mixin iphonecheckbox($width:80px,$height:32px) {
|
141
|
+
@include border-radius(4px);
|
142
|
+
display: inline-block;
|
143
|
+
background: -moz-linear-gradient(19% 75% 90deg,#3095C7, #14539C);
|
144
|
+
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#14539C), to(#3095C7));
|
145
|
+
border: 1px solid #555555;
|
146
|
+
width: $width;
|
147
|
+
position: relative;
|
148
|
+
height: $height;
|
149
|
+
cursor: pointer;
|
150
|
+
|
151
|
+
.check {
|
152
|
+
@include border-radius(3px);
|
153
|
+
@include transition(left .25s ease-out);
|
154
|
+
display: block;
|
155
|
+
width: $width / 2;
|
156
|
+
height: $height - 2;
|
157
|
+
background: -moz-linear-gradient(19% 75% 90deg,#FFFFFF, #A1A1A1);
|
158
|
+
background: #fff -webkit-gradient(linear, 0% 0%, 0% 100%, from(#A1A1A1), to(#FFFFFF));
|
159
|
+
border: 1px solid #e5e5e5;
|
160
|
+
position: absolute;
|
161
|
+
top: 0px;
|
162
|
+
left: 0px;
|
163
|
+
}
|
164
|
+
|
165
|
+
input[type=checkbox] {
|
166
|
+
display: none;
|
167
|
+
|
168
|
+
&:checked + .check {
|
169
|
+
@include box-shadow(#244766 -1px 0px 3px);
|
170
|
+
top: 0px;
|
171
|
+
left: ($width / 2 ) - 2;
|
172
|
+
}
|
173
|
+
|
174
|
+
& + .check {
|
175
|
+
@include box-shadow(#244766 1px 0px 3px);
|
176
|
+
top: 0px;
|
177
|
+
left: 0px;
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
@@ -0,0 +1,151 @@
|
|
1
|
+
// ## CSS3 wrappers
|
2
|
+
//
|
3
|
+
// This file contains useufl CSS3 wrappers that prevent you from having
|
4
|
+
// to deal with all those vendor prefixes.
|
5
|
+
|
6
|
+
// Apply a border radius on all corners
|
7
|
+
@mixin border-radius($radius) {
|
8
|
+
-moz-border-radius: $radius;
|
9
|
+
-webkit-border-radius: $radius;
|
10
|
+
border-radius: $radius;
|
11
|
+
}
|
12
|
+
|
13
|
+
// Apply a border radius on the top-left corner
|
14
|
+
@mixin border-radius-tl($radius) {
|
15
|
+
-moz-border-radius-topleft: $radius;
|
16
|
+
-webkit-border-top-left-radius: $radius;
|
17
|
+
border-top-left-radius: $radius;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Apply a border radius on the top-right corner
|
21
|
+
@mixin border-radius-tr($radius) {
|
22
|
+
-moz-border-radius-topright: $radius;
|
23
|
+
-webkit-border-top-right-radius: $radius;
|
24
|
+
border-top-right-radius: $radius;
|
25
|
+
}
|
26
|
+
|
27
|
+
// Apply a border radius on the bottom-left corner
|
28
|
+
@mixin border-radius-bl($radius) {
|
29
|
+
-moz-border-radius-bottomleft: $radius;
|
30
|
+
-webkit-border-bottom-left-radius: $radius;
|
31
|
+
border-bottom-left-radius: $radius;
|
32
|
+
}
|
33
|
+
|
34
|
+
// Apply a border radius on the bottom-right corner
|
35
|
+
@mixin border-radius-br($radius) {
|
36
|
+
-moz-border-radius-bottomright: $radius;
|
37
|
+
-webkit-border-bottom-right-radius: $radius;
|
38
|
+
border-bottom-right-radius: $radius;
|
39
|
+
}
|
40
|
+
|
41
|
+
// Apply a border radius on the left corners
|
42
|
+
@mixin border-radius-left($radius) {
|
43
|
+
@include border-radius-tl($radius);
|
44
|
+
@include border-radius-bl($radius);
|
45
|
+
}
|
46
|
+
|
47
|
+
// Apply a border radius on the right corners
|
48
|
+
@mixin border-radius-right($radius) {
|
49
|
+
@include border-radius-tr($radius);
|
50
|
+
@include border-radius-br($radius);
|
51
|
+
}
|
52
|
+
|
53
|
+
// Apply a border radius on the top corners
|
54
|
+
@mixin border-radius-top($radius) {
|
55
|
+
@include border-radius-tl($radius);
|
56
|
+
@include border-radius-tr($radius);
|
57
|
+
}
|
58
|
+
|
59
|
+
// Apply a border radius on the bottom corners
|
60
|
+
@mixin border-radius-bottom($radius) {
|
61
|
+
@include border-radius-bl($radius);
|
62
|
+
@include border-radius-br($radius);
|
63
|
+
}
|
64
|
+
|
65
|
+
// Apply a one pixel offset black text shadow with a given alpha value
|
66
|
+
@mixin textshadow($alpha:0.4) {
|
67
|
+
text-shadow: 0px 1px 1px rgba(0,0,0,$alpha);
|
68
|
+
}
|
69
|
+
|
70
|
+
// Apply a one pixel offset white emboss effect with a given alpha value
|
71
|
+
@mixin textemboss($alpha:0.4) {
|
72
|
+
text-shadow: rgba(255,255,255,$alpha) 0px 1px 1px;
|
73
|
+
}
|
74
|
+
|
75
|
+
// Apply a one pixel offset inset emboss effect with a given alpha value
|
76
|
+
@mixin textemboss2($alpha:0.4) {
|
77
|
+
text-shadow: rgba(255,255,255,$alpha) 0px 1px 1px, rgba(0,0,0,$alpha) 0px -1px -1px;
|
78
|
+
}
|
79
|
+
|
80
|
+
// Apply a single box shadow
|
81
|
+
@mixin box-shadow($shadow) {
|
82
|
+
-moz-box-shadow: $shadow;
|
83
|
+
-webkit-box-shadow: $shadow;
|
84
|
+
box-shadow: $shadow;
|
85
|
+
}
|
86
|
+
|
87
|
+
// Set the opacity to a given value
|
88
|
+
@mixin opacity($alpha) {
|
89
|
+
opacity: $alpha;
|
90
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$alpha*100})"; // for IE8
|
91
|
+
filter: alpha(opacity=#{$alpha*100}); // for IE5-7
|
92
|
+
}
|
93
|
+
|
94
|
+
// Apply a transition property
|
95
|
+
@mixin transition($trans) {
|
96
|
+
-webkit-transition: $trans;
|
97
|
+
-moz-transition: $trans;
|
98
|
+
-o-transition: $trans;
|
99
|
+
transition: $trans;
|
100
|
+
}
|
101
|
+
|
102
|
+
// Apply a transform property
|
103
|
+
@mixin transform($trans) {
|
104
|
+
-webkit-transform: $trans;
|
105
|
+
-moz-transform: $trans;
|
106
|
+
-ms-transform: $trans;
|
107
|
+
-o-transform: $trans;
|
108
|
+
transform: $trans;
|
109
|
+
}
|
110
|
+
|
111
|
+
// Apply a transition on the transform property
|
112
|
+
@mixin transtrans($trans) {
|
113
|
+
-webkit-transition: $trans -webkit-transform;
|
114
|
+
-moz-transition: $trans -moz-transform;
|
115
|
+
-o-transition: $trans -o-transform;
|
116
|
+
transition: $trans transform;
|
117
|
+
}
|
118
|
+
|
119
|
+
// Transform-origin wrapper
|
120
|
+
@mixin transform-origin($origin) {
|
121
|
+
-webkit-transform-origin: $origin;
|
122
|
+
-moz-transform-origin: $origin;
|
123
|
+
-ms-transform-origin: $origin;
|
124
|
+
-o-transform-origin: $origin;
|
125
|
+
transform-origin: $origin;
|
126
|
+
}
|
127
|
+
|
128
|
+
// Box-sizing wrapper
|
129
|
+
@mixin box-sizing($sizing) {
|
130
|
+
-webkit-box-sizing: $sizing;
|
131
|
+
-moz-box-sizing: $sizing;
|
132
|
+
box-sizing: $sizing;
|
133
|
+
}
|
134
|
+
|
135
|
+
// Apply a vertical gradient with two colors
|
136
|
+
@mixin vertical-gradient($top,$bottom) {
|
137
|
+
background-color: $top;
|
138
|
+
background-image: -moz-linear-gradient(top,$top,$bottom);
|
139
|
+
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,$top),color-stop(1,$bottom));
|
140
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$top}',endColorStr='#{$bottom}');
|
141
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$top}',endColorStr='#{$bottom}')";
|
142
|
+
}
|
143
|
+
|
144
|
+
// Apply a horizontal gradient with two colors
|
145
|
+
@mixin horizontal-gradient($left,$right) {
|
146
|
+
background-color: $left;
|
147
|
+
background-image: -moz-linear-gradient(left,$left,$right);
|
148
|
+
background-image: -webkit-gradient(linear,left top,right top,color-stop(0,$left),color-stop(1,$right));
|
149
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$top}',endColorStr='#{$bottom}',gradientType=1);
|
150
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$top}',endColorStr='#{$bottom}',gradientType=1)";
|
151
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
// Default font path without trailing slash, override at will
|
2
|
+
$fontpath: "/fonts" !default;
|
3
|
+
|
4
|
+
// ## Web font wrapper
|
5
|
+
//
|
6
|
+
// $family is the font name, $filename is the font filename minus extension.
|
7
|
+
// Include this in the top level.
|
8
|
+
//
|
9
|
+
// Example:
|
10
|
+
//
|
11
|
+
// @mixin webfont("MuseoSans", "museosans");
|
12
|
+
@mixin webfont($family, $filename) {
|
13
|
+
@font-face {
|
14
|
+
font-family: '#{$family}';
|
15
|
+
src: url('#{$fontpath}/#{$filename}.eot');
|
16
|
+
src: local('☺'), url('#{$fontpath}/#{$filename}.woff') format('woff'), url('#{$fontpath}/#{$filename}.ttf') format('truetype'), url('#{$fontpath}/#{$filename}.svg#webfont') format('svg');
|
17
|
+
font-weight: normal;
|
18
|
+
font-style: normal;
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
// ## Grid System
|
2
|
+
//
|
3
|
+
// The TurboSass grid system is loosely based on Nathan Smith's fantastic
|
4
|
+
// 960.gs system.
|
5
|
+
|
6
|
+
// Change this variable to alter the container width and the amount of
|
7
|
+
// grid columns
|
8
|
+
$gridwidth: 960px / 12 !default;
|
9
|
+
|
10
|
+
// Change this variable to alter the gutter margins.
|
11
|
+
$gridmargin: 10px !default;
|
12
|
+
|
13
|
+
// Make this object a container for grid columns
|
14
|
+
@mixin c12 {
|
15
|
+
margin-left: auto;
|
16
|
+
margin-right: auto;
|
17
|
+
width: 12*$gridwidth;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Internal helper with grid column properties
|
21
|
+
@mixin gridbox {
|
22
|
+
display: inline;
|
23
|
+
float: left;
|
24
|
+
margin-left: $gridmargin;
|
25
|
+
margin-right: $gridmargin;
|
26
|
+
}
|
27
|
+
|
28
|
+
// Internal helper with push-pull properties
|
29
|
+
@mixin pushpull {
|
30
|
+
position: relative;
|
31
|
+
}
|
32
|
+
|
33
|
+
// To nest grid cells in other grid cells apply the alpha mixin to the
|
34
|
+
// left inner cell and omega to the right inner cell. This prevents
|
35
|
+
// double gutters from appearing.
|
36
|
+
@mixin alpha { margin-left:0; }
|
37
|
+
@mixin omega { margin-right: 0; }
|
38
|
+
|
39
|
+
// Grid cell mixins. The number indicates the width of the cell in columns.
|
40
|
+
@mixin g1 { @include gridbox; width: ($gridwidth)-(2*$gridmargin); }
|
41
|
+
@mixin g2 { @include gridbox; width: (2*$gridwidth)-(2*$gridmargin); }
|
42
|
+
@mixin g3 { @include gridbox; width: (3*$gridwidth)-(2*$gridmargin); }
|
43
|
+
@mixin g4 { @include gridbox; width: (4*$gridwidth)-(2*$gridmargin); }
|
44
|
+
@mixin g5 { @include gridbox; width: (5*$gridwidth)-(2*$gridmargin); }
|
45
|
+
@mixin g6 { @include gridbox; width: (6*$gridwidth)-(2*$gridmargin); }
|
46
|
+
@mixin g7 { @include gridbox; width: (7*$gridwidth)-(2*$gridmargin); }
|
47
|
+
@mixin g8 { @include gridbox; width: (8*$gridwidth)-(2*$gridmargin); }
|
48
|
+
@mixin g9 { @include gridbox; width: (9*$gridwidth)-(2*$gridmargin); }
|
49
|
+
@mixin g10 { @include gridbox; width: (10*$gridwidth)-(2*$gridmargin); }
|
50
|
+
@mixin g11 { @include gridbox; width: (11*$gridwidth)-(2*$gridmargin); }
|
51
|
+
@mixin g12 { @include gridbox; width: (12*$gridwidth)-(2*$gridmargin); }
|
52
|
+
|
53
|
+
// Push this cell to the right
|
54
|
+
@mixin push1 { @include pushpull; left: $gridwidth; }
|
55
|
+
@mixin push2 { @include pushpull; left: 2*$gridwidth; }
|
56
|
+
@mixin push3 { @include pushpull; left: 3*$gridwidth; }
|
57
|
+
@mixin push4 { @include pushpull; left: 4*$gridwidth; }
|
58
|
+
@mixin push5 { @include pushpull; left: 5*$gridwidth; }
|
59
|
+
@mixin push6 { @include pushpull; left: 6*$gridwidth; }
|
60
|
+
@mixin push7 { @include pushpull; left: 7*$gridwidth; }
|
61
|
+
@mixin push8 { @include pushpull; left: 8*$gridwidth; }
|
62
|
+
@mixin push9 { @include pushpull; left: 9*$gridwidth; }
|
63
|
+
@mixin push10 { @include pushpull; left: 10*$gridwidth; }
|
64
|
+
@mixin push11 { @include pushpull; left: 11*$gridwidth; }
|
65
|
+
|
66
|
+
// Pull this cell to the left
|
67
|
+
@mixin pull1 { @include pushpull; left: -$gridwidth; }
|
68
|
+
@mixin pull2 { @include pushpull; left: -2*$gridwidth; }
|
69
|
+
@mixin pull3 { @include pushpull; left: -3*$gridwidth; }
|
70
|
+
@mixin pull4 { @include pushpull; left: -4*$gridwidth; }
|
71
|
+
@mixin pull5 { @include pushpull; left: -5*$gridwidth; }
|
72
|
+
@mixin pull6 { @include pushpull; left: -6*$gridwidth; }
|
73
|
+
@mixin pull7 { @include pushpull; left: -7*$gridwidth; }
|
74
|
+
@mixin pull8 { @include pushpull; left: -8*$gridwidth; }
|
75
|
+
@mixin pull9 { @include pushpull; left: -9*$gridwidth; }
|
76
|
+
@mixin pull10 { @include pushpull; left: -10*$gridwidth; }
|
77
|
+
@mixin pull11 { @include pushpull; left: -11*$gridwidth; }
|
78
|
+
|
79
|
+
// Apply padding to the left of the cell.
|
80
|
+
@mixin p1 { padding-left: $gridwidth; }
|
81
|
+
@mixin p2 { padding-left: 2*$gridwidth; }
|
82
|
+
@mixin p3 { padding-left: 3*$gridwidth; }
|
83
|
+
@mixin p4 { padding-left: 4*$gridwidth; }
|
84
|
+
@mixin p5 { padding-left: 5*$gridwidth; }
|
85
|
+
@mixin p6 { padding-left: 6*$gridwidth; }
|
86
|
+
@mixin p7 { padding-left: 7*$gridwidth; }
|
87
|
+
@mixin p8 { padding-left: 8*$gridwidth; }
|
88
|
+
@mixin p9 { padding-left: 9*$gridwidth; }
|
89
|
+
@mixin p10 { padding-left: 10*$gridwidth; }
|
90
|
+
@mixin p11 { padding-left: 11*$gridwidth; }
|
91
|
+
|
92
|
+
// Apply padding to the right of the cell.
|
93
|
+
@mixin s1 { padding-right: $gridwidth; }
|
94
|
+
@mixin s2 { padding-right: 2*$gridwidth; }
|
95
|
+
@mixin s3 { padding-right: 3*$gridwidth; }
|
96
|
+
@mixin s4 { padding-right: 4*$gridwidth; }
|
97
|
+
@mixin s5 { padding-right: 5*$gridwidth; }
|
98
|
+
@mixin s6 { padding-right: 6*$gridwidth; }
|
99
|
+
@mixin s7 { padding-right: 7*$gridwidth; }
|
100
|
+
@mixin s8 { padding-right: 8*$gridwidth; }
|
101
|
+
@mixin s9 { padding-right: 9*$gridwidth; }
|
102
|
+
@mixin s10 { padding-right: 10*$gridwidth; }
|
103
|
+
@mixin s11 { padding-right: 11*$gridwidth; }
|
104
|
+
|
105
|
+
// This is the clearfix from HTML5 Boilerplate
|
106
|
+
@mixin clearfix {
|
107
|
+
zoom: 1;
|
108
|
+
|
109
|
+
&:before, &:after {
|
110
|
+
content: "\0020";
|
111
|
+
display: block;
|
112
|
+
height: 0;
|
113
|
+
visibility: hidden;
|
114
|
+
}
|
115
|
+
|
116
|
+
&:after {
|
117
|
+
clear: both;
|
118
|
+
}
|
119
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// Trigger the hasLayout property on IE6.
|
2
|
+
@mixin haslayout {
|
3
|
+
zoom: 1;
|
4
|
+
}
|
5
|
+
|
6
|
+
// Hacks to implement min-height and min-width in IE6.
|
7
|
+
// See http://www.dustindiaz.com/min-height-fast-hack/ for more info.
|
8
|
+
@mixin minheight($height) {
|
9
|
+
min-height: $height;
|
10
|
+
height: auto !important;
|
11
|
+
height: $height;
|
12
|
+
}
|
13
|
+
|
14
|
+
@mixin minwidth($width) {
|
15
|
+
min-width: $width;
|
16
|
+
width: auto !important;
|
17
|
+
width: $width;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Fix for IE6 double float margin bug.
|
21
|
+
// See http://www.positioniseverything.net/explorer/doubled-margin.html
|
22
|
+
// for more info.
|
23
|
+
@mixin doublefloatmarginfix {
|
24
|
+
display: inline;
|
25
|
+
float: left;
|
26
|
+
}
|
27
|
+
|
28
|
+
// Fix for IE6 peekaboo bug.
|
29
|
+
// See http://www.positioniseverything.net/explorer/peekaboo.html for
|
30
|
+
// more info.
|
31
|
+
@mixin peekaboofix {
|
32
|
+
_display: inline-block;
|
33
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
// ## Reset CSS
|
2
|
+
//
|
3
|
+
// This is the awesome reset CSS from html5boilerplate.com
|
4
|
+
|
5
|
+
// You can prevent the reset CSS from being applied by setting
|
6
|
+
// `$use_reset` to false before importing the TurboSass SCSS.
|
7
|
+
$use_reset: true !default;
|
8
|
+
|
9
|
+
@if $use_reset == true {
|
10
|
+
|
11
|
+
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, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
|
12
|
+
margin: 0;
|
13
|
+
padding: 0;
|
14
|
+
border: 0;
|
15
|
+
outline: 0;
|
16
|
+
font-size: 100%;
|
17
|
+
vertical-align: baseline;
|
18
|
+
background: transparent;
|
19
|
+
}
|
20
|
+
|
21
|
+
body {
|
22
|
+
line-height: 1;
|
23
|
+
}
|
24
|
+
|
25
|
+
:focus {
|
26
|
+
outline: 1;
|
27
|
+
}
|
28
|
+
|
29
|
+
article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
|
30
|
+
display: block;
|
31
|
+
}
|
32
|
+
|
33
|
+
nav ul {
|
34
|
+
list-style: none;
|
35
|
+
}
|
36
|
+
|
37
|
+
blockquote, q {
|
38
|
+
quotes: none;
|
39
|
+
}
|
40
|
+
|
41
|
+
blockquote:before, blockquote:after, q:before, q:after {
|
42
|
+
content: '';
|
43
|
+
content: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
a {
|
47
|
+
margin: 0;
|
48
|
+
padding: 0;
|
49
|
+
border: 0;
|
50
|
+
font-size: 100%;
|
51
|
+
vertical-align: baseline;
|
52
|
+
background: transparent;
|
53
|
+
}
|
54
|
+
|
55
|
+
ins {
|
56
|
+
background-color: #ff9;
|
57
|
+
color: #000;
|
58
|
+
text-decoration: none;
|
59
|
+
}
|
60
|
+
|
61
|
+
mark {
|
62
|
+
background-color: #ff9;
|
63
|
+
color: #000;
|
64
|
+
font-style: italic;
|
65
|
+
font-weight: bold;
|
66
|
+
}
|
67
|
+
|
68
|
+
del {
|
69
|
+
text-decoration: line-through;
|
70
|
+
}
|
71
|
+
|
72
|
+
abbr[title], dfn[title] {
|
73
|
+
border-bottom: 1px dotted #000;
|
74
|
+
cursor: help;
|
75
|
+
}
|
76
|
+
|
77
|
+
table {
|
78
|
+
border-collapse: collapse;
|
79
|
+
border-spacing: 0;
|
80
|
+
}
|
81
|
+
|
82
|
+
hr {
|
83
|
+
display: block;
|
84
|
+
height: 1px;
|
85
|
+
border: 0;
|
86
|
+
border-top: 1px solid #cccccc;
|
87
|
+
margin: 1em 0;
|
88
|
+
padding: 0;
|
89
|
+
}
|
90
|
+
|
91
|
+
input, select {
|
92
|
+
vertical-align: middle;
|
93
|
+
}
|
94
|
+
|
95
|
+
html {
|
96
|
+
overflow-y: scroll;
|
97
|
+
}
|
98
|
+
|
99
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
// ## Sticky Footer
|
2
|
+
//
|
3
|
+
// This must be a top-level mixin.
|
4
|
+
//
|
5
|
+
// Usage:
|
6
|
+
//
|
7
|
+
// <body>
|
8
|
+
// <div id="root">
|
9
|
+
// Your content here.
|
10
|
+
// <div id="rootfooter"></div>
|
11
|
+
// </div>
|
12
|
+
// <div id="footer">
|
13
|
+
// This is the footer.
|
14
|
+
// </div>
|
15
|
+
// </body>
|
16
|
+
//
|
17
|
+
// And then in the SCSS:
|
18
|
+
//
|
19
|
+
// @include sticky-footer(100px, "#root", "#rootfooter", "#footer");
|
20
|
+
@mixin sticky-footer($height,$root,$rootfooter,$footer) {
|
21
|
+
html,body {
|
22
|
+
height: 100%;
|
23
|
+
}
|
24
|
+
|
25
|
+
#{$root} {
|
26
|
+
@include minheight(100%);
|
27
|
+
clear: both;
|
28
|
+
margin-bottom: -#{$height};
|
29
|
+
|
30
|
+
#{$rootfooter} {
|
31
|
+
clear: both;
|
32
|
+
height: #{$height};
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
#{$footer} {
|
37
|
+
clear: both;
|
38
|
+
position: relative;
|
39
|
+
height: #{$height};
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
// Change the color of the text selection.
|
44
|
+
//
|
45
|
+
// If you want to be cool you should use hot pink here.
|
46
|
+
@mixin selectioncolor($color) {
|
47
|
+
::-moz-selection {
|
48
|
+
background: $color;
|
49
|
+
color: #fff;
|
50
|
+
text-shadow: none;
|
51
|
+
}
|
52
|
+
|
53
|
+
::selection {
|
54
|
+
background: $color;
|
55
|
+
color: #fff;
|
56
|
+
text-shadow: none;
|
57
|
+
}
|
58
|
+
|
59
|
+
a:link {
|
60
|
+
-webkit-tap-highlight-color: $color;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
// Perform an image replacement technique by hiding the text in favor of
|
65
|
+
// the background image url.
|
66
|
+
@mixin imagereplacement {
|
67
|
+
display: block;
|
68
|
+
text-indent: -999em;
|
69
|
+
overflow: hidden;
|
70
|
+
background-repeat: no-repeat;
|
71
|
+
text-align: left;
|
72
|
+
direction: ltr;
|
73
|
+
}
|
74
|
+
|
75
|
+
// Apply this mixin to hide something, even from screen readers.
|
76
|
+
@mixin hidden {
|
77
|
+
display: none;
|
78
|
+
visibility: hidden;
|
79
|
+
}
|
80
|
+
|
81
|
+
// Apply pre-style wrapping.
|
82
|
+
@mixin prewrapping {
|
83
|
+
white-space: pre;
|
84
|
+
white-space: pre-wrap;
|
85
|
+
white-space: pre-line;
|
86
|
+
word-wrap: break-word;
|
87
|
+
}
|
data/lib/turbosass.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require "sass"
|
2
|
+
require "sass/plugin"
|
3
|
+
|
4
|
+
module TurboSass
|
5
|
+
def self.path
|
6
|
+
File.expand_path(File.join(File.dirname(__FILE__), "turbosass", "scss"))
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module Sass
|
11
|
+
class Engine
|
12
|
+
new_default_options = DEFAULT_OPTIONS.clone
|
13
|
+
new_default_options[:load_paths] << ::TurboSass.path
|
14
|
+
|
15
|
+
remove_const(:DEFAULT_OPTIONS)
|
16
|
+
DEFAULT_OPTIONS = new_default_options.freeze
|
17
|
+
end
|
18
|
+
end
|
data/turbosass.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "turbosass/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "turbosass"
|
7
|
+
s.version = TurboSass::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
|
10
|
+
s.authors = ["Emil Loer"]
|
11
|
+
s.email = ["emil@koffietijd.net"]
|
12
|
+
s.homepage = "http://github.com/thedjinn/turbosass"
|
13
|
+
s.summary = %q{Sass framework for ninjas}
|
14
|
+
s.description = %q{Sass framework for ninjas}
|
15
|
+
s.licenses = ["MIT"]
|
16
|
+
|
17
|
+
s.rubyforge_project = "turbosass"
|
18
|
+
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
|
24
|
+
s.add_dependency(%q<haml>, ["~> 3.0.0"])
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: turbosass
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Emil Loer
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-02-21 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: haml
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 3.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
description: Sass framework for ninjas
|
38
|
+
email:
|
39
|
+
- emil@koffietijd.net
|
40
|
+
executables:
|
41
|
+
- turbosass
|
42
|
+
extensions: []
|
43
|
+
|
44
|
+
extra_rdoc_files: []
|
45
|
+
|
46
|
+
files:
|
47
|
+
- .gitignore
|
48
|
+
- Gemfile
|
49
|
+
- README.markdown
|
50
|
+
- Rakefile
|
51
|
+
- bin/turbosass
|
52
|
+
- example/sinatra/app.rb
|
53
|
+
- example/sinatra/config.ru
|
54
|
+
- example/sinatra/views/index.haml
|
55
|
+
- example/sinatra/views/style.scss
|
56
|
+
- lib/turbosass.rb
|
57
|
+
- lib/turbosass/scss/_turbosass.scss
|
58
|
+
- lib/turbosass/scss/turbosass/_buttons.scss
|
59
|
+
- lib/turbosass/scss/turbosass/_css3.scss
|
60
|
+
- lib/turbosass/scss/turbosass/_fonts.scss
|
61
|
+
- lib/turbosass/scss/turbosass/_grid.scss
|
62
|
+
- lib/turbosass/scss/turbosass/_ie6.scss
|
63
|
+
- lib/turbosass/scss/turbosass/_reset.scss
|
64
|
+
- lib/turbosass/scss/turbosass/_utils.scss
|
65
|
+
- lib/turbosass/version.rb
|
66
|
+
- turbosass.gemspec
|
67
|
+
has_rdoc: true
|
68
|
+
homepage: http://github.com/thedjinn/turbosass
|
69
|
+
licenses:
|
70
|
+
- MIT
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
|
74
|
+
require_paths:
|
75
|
+
- lib
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
hash: 3
|
82
|
+
segments:
|
83
|
+
- 0
|
84
|
+
version: "0"
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
requirements: []
|
95
|
+
|
96
|
+
rubyforge_project: turbosass
|
97
|
+
rubygems_version: 1.4.1
|
98
|
+
signing_key:
|
99
|
+
specification_version: 3
|
100
|
+
summary: Sass framework for ninjas
|
101
|
+
test_files: []
|
102
|
+
|