bourbon 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,44 @@
|
|
1
|
+
//************************************************************************//
|
2
|
+
// Generate a variable ($all-text-inputs) with a list of all html5
|
3
|
+
// input types that have a text-based input, excluding textarea.
|
4
|
+
// http://diveintohtml5.org/forms.html
|
5
|
+
//************************************************************************//
|
6
|
+
$inputs-list: 'input[type="email"]',
|
7
|
+
'input[type="number"]',
|
8
|
+
'input[type="password"]',
|
9
|
+
'input[type="search"]',
|
10
|
+
'input[type="tel"]',
|
11
|
+
'input[type="text"]',
|
12
|
+
'input[type="url"]',
|
13
|
+
|
14
|
+
// Webkit & Gecko may change the display of these in the future
|
15
|
+
'input[type="color"]',
|
16
|
+
'input[type="date"]',
|
17
|
+
'input[type="datetime"]',
|
18
|
+
'input[type="datetime-local"]',
|
19
|
+
'input[type="month"]',
|
20
|
+
'input[type="time"]',
|
21
|
+
'input[type="week"]';
|
22
|
+
|
23
|
+
$list-count: 0;
|
24
|
+
$unquoted-inputs-list: false;
|
25
|
+
|
26
|
+
@each $input-type in $inputs-list {
|
27
|
+
@if $list-count == 0 {
|
28
|
+
$unquoted-inputs-list: unquote($input-type);
|
29
|
+
$list-count: $list-count + 1;
|
30
|
+
}
|
31
|
+
|
32
|
+
@else if $list-count > 0 {
|
33
|
+
$unquoted-inputs-list: join($unquoted-inputs-list, unquote($input-type), comma);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
$all-text-inputs: $unquoted-inputs-list;
|
38
|
+
|
39
|
+
// You must use interpolation on the variable:
|
40
|
+
// #{$all-text-inputs}
|
41
|
+
//************************************************************************//
|
42
|
+
// #{$all-text-inputs}, textarea {
|
43
|
+
// border: 1px solid green;
|
44
|
+
// }
|
data/readme.md
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
#Bourbon Sass Mixins
|
2
|
-
The purpose of Bourbon Sass Mixins is to provide a comprehensive library of sass mixins that are designed to be as vanilla as possible
|
1
|
+
# Bourbon Sass Mixins
|
2
|
+
The purpose of Bourbon Sass Mixins is to provide a comprehensive library of sass mixins that are designed to be as vanilla as possible, meaning they should not deter from the original CSS syntax.
|
3
|
+
The mixins contain vendor specific prefixes for all CSS3 properties for support amongst modern browsers. The prefixes also ensure graceful degradation for older browsers that support only CSS3 prefixed properties.
|
3
4
|
Bourbon uses SCSS syntax.
|
4
5
|
|
5
|
-
#Requirements
|
6
|
+
# Requirements
|
6
7
|
Sass 3.1+
|
7
8
|
|
8
|
-
|
9
|
-
#Install for Rails
|
9
|
+
# Install for Rails
|
10
10
|
Update your Gemfile
|
11
11
|
|
12
12
|
gem 'bourbon'
|
13
13
|
|
14
|
-
bundle install
|
14
|
+
$ bundle install
|
15
15
|
|
16
|
-
##Rails 3.1.x
|
16
|
+
## Rails 3.1.x
|
17
17
|
Rename application.css to application.css.scss
|
18
18
|
|
19
19
|
mv app/assets/stylesheets/application.css app/assets/stylesheets/application.css.scss
|
20
20
|
|
21
|
-
Bourbon needs the sass files to be imported in a specific order to function properly
|
21
|
+
Bourbon needs the sass files to be imported in a specific order to function properly. Therefore, you will need to disabled the require_tree sprocket directive.
|
22
22
|
Delete the following sprocket directive in application.css.scss
|
23
23
|
|
24
24
|
*= require_tree .
|
@@ -27,14 +27,14 @@ Import bourbon at the beginning of application.css.scss
|
|
27
27
|
|
28
28
|
@import "bourbon";
|
29
29
|
|
30
|
-
Import all additional stylesheets from your app/assets/
|
30
|
+
Import all additional stylesheets from your app/assets/stylesheets directory underneath the bourbon import
|
31
31
|
|
32
32
|
@import "bourbon";
|
33
33
|
@import "home";
|
34
34
|
@import "users";
|
35
35
|
|
36
|
-
##Rails 3.0.9 and below
|
37
|
-
For Rails < 3.1 you must run the installation rake task. Please note, you should run this task
|
36
|
+
## Rails 3.0.9 and below
|
37
|
+
For Rails < 3.1 you must run the installation rake task. Please note, you should run this task every time a new version of Bourbon is released.
|
38
38
|
This will copy the Sass files into your project's public/stylesheets/sass directory.
|
39
39
|
|
40
40
|
rake bourbon:install
|
@@ -44,7 +44,7 @@ Import the mixins at the beginning of your stylesheet
|
|
44
44
|
@import 'bourbon/bourbon';
|
45
45
|
|
46
46
|
|
47
|
-
#Install without Rails
|
47
|
+
# Install without Rails
|
48
48
|
The following script will generate a *bourbon* directory and convert all .css.scss to .scss extensions. The *bourbon* directory is for 'sass --watch' use outside of rails.
|
49
49
|
Preliminary step: clone this repo and cd into the directory.
|
50
50
|
|
@@ -64,8 +64,11 @@ Preliminary step: clone this repo and cd into the directory.
|
|
64
64
|
# Example (project root directory)
|
65
65
|
sass --watch stylesheets/sass:stylesheets -r ./stylesheets/sass/bourbon/lib/bourbon.rb
|
66
66
|
|
67
|
+
In this case as well, you will need to import the mixins at the beginning of your stylesheet
|
68
|
+
|
69
|
+
@import 'bourbon/bourbon';
|
67
70
|
|
68
|
-
#Browser support
|
71
|
+
# Browser support
|
69
72
|
Bourbon aims to provide support for CSS3 properties that are not yet fully supported in modern stable browsers.
|
70
73
|
**Pull requests:** A general rule when considering a new mixin: Do the following browsers *only* support the CSS3 property using vendor specific prefixes? If the answer is yes, there is a high chance the mixin will be accepted via a pull request.
|
71
74
|
|
@@ -75,14 +78,16 @@ Bourbon aims to provide support for CSS3 properties that are not yet fully suppo
|
|
75
78
|
* Opera 10+
|
76
79
|
* IE 9+
|
77
80
|
|
78
|
-
Bourbon does not intend to support IE filters
|
81
|
+
*Bourbon does not intend to support IE filters.*
|
82
|
+
|
83
|
+
Resources for checking browser support: [MDN - Moz Dev Network](https://developer.mozilla.org/en-US/), [Mozilla CSS Extensions](https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions), [Webkit CSS Properties](http://css-infos.net/properties/webkit.php), [Firefox CSS Properties](http://css-infos.net/properties/firefox.php), [MSDN - Microsoft Dev Network](http://msdn.microsoft.com/en-us/library/ms531207(v=VS.85).aspx)
|
79
84
|
|
80
85
|
|
81
|
-
#Using Bourbon Mixins
|
86
|
+
# Using Bourbon Mixins
|
82
87
|
Below are a few examples of mixin usage. Note that these are just a few, explore the repo to find out more.
|
83
88
|
|
84
89
|
|
85
|
-
###Animation
|
90
|
+
### Animation
|
86
91
|
|
87
92
|
The animation mixins support comma separated lists of values, which allows different transitions for individual properties to be described in a single style rule. Each value in the list corresponds to the value at that same position in the other properties.
|
88
93
|
|
@@ -94,9 +99,9 @@ The animation mixins support comma separated lists of values, which allows diffe
|
|
94
99
|
@include animation-basic((slideup, fadein), (1.0s, 2.0s), ease-in);
|
95
100
|
|
96
101
|
|
97
|
-
###Background-image
|
102
|
+
### Background-image
|
98
103
|
|
99
|
-
The background-image mixin is helpful for chaining multiple comma
|
104
|
+
The background-image mixin is helpful for chaining multiple comma delimited background images and/or linear-gradients into one background-image property. background-image supports up to 10 background-images.
|
100
105
|
|
101
106
|
# Multiple image assets
|
102
107
|
@include background-image(url("/images/a.png"), url("images/b.png"));
|
@@ -108,32 +113,32 @@ The background-image mixin is helpful for chaining multiple comma deliminated ba
|
|
108
113
|
@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(#4e7ba3, darken(#4e7ba4, 10%)) );
|
109
114
|
|
110
115
|
|
111
|
-
###Border Radius
|
116
|
+
### Border Radius
|
112
117
|
|
113
|
-
|
118
|
+
border-radius will also take short-hand notation.
|
114
119
|
|
115
120
|
@include border-radius(10px);
|
116
121
|
@include border-radius(5px 5px 2px 2px);
|
117
122
|
|
118
123
|
|
119
|
-
###Box Shadow
|
124
|
+
### Box Shadow
|
120
125
|
|
121
|
-
|
126
|
+
box-shadow supports single or multiple arguments:
|
122
127
|
|
123
128
|
@include box-shadow(1px 1px 2px 0 #ff0000);
|
124
129
|
|
125
|
-
# Multiple arguments must be comma-
|
130
|
+
# Multiple arguments must be comma-delimited.
|
126
131
|
@include box-shadow(1px 1px 2px 0 #fff0000, -1px -2px 0 #ccc);
|
127
132
|
|
128
133
|
|
129
|
-
###Box Sizing
|
134
|
+
### Box Sizing
|
130
135
|
|
131
136
|
Box-sizing will change the box-model of the element it is applied to.
|
132
137
|
|
133
138
|
@include box-sizing(border-box);
|
134
139
|
|
135
140
|
|
136
|
-
###Flex Box
|
141
|
+
### Flex Box
|
137
142
|
|
138
143
|
The flex-box mixin is based on the 2009 w3c spec. The mixin with change to the flexible box-model. [More info.](http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/)
|
139
144
|
|
@@ -154,14 +159,14 @@ The flex-box mixin is based on the 2009 w3c spec. The mixin with change to the f
|
|
154
159
|
}
|
155
160
|
|
156
161
|
|
157
|
-
###Inline-block
|
162
|
+
### Inline-block
|
158
163
|
|
159
164
|
The inline-block mixin provides support for the inline-block property in IE6 and IE7.
|
160
165
|
|
161
166
|
@include inline-block;
|
162
167
|
|
163
168
|
|
164
|
-
###Linear-Gradient
|
169
|
+
### Linear-Gradient
|
165
170
|
|
166
171
|
Gradient position is optional, default is top. Position can be a degree. Color-stops are optional as well. Mixin will support up to 10 gradients.
|
167
172
|
|
@@ -170,7 +175,7 @@ Gradient position is optional, default is top. Position can be a degree. Color-s
|
|
170
175
|
@include linear-gradient(50deg, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%);
|
171
176
|
|
172
177
|
|
173
|
-
###Position
|
178
|
+
### Position
|
174
179
|
|
175
180
|
Shorthand notation for setting the position of elements in your page.
|
176
181
|
|
@@ -186,10 +191,10 @@ You can write:
|
|
186
191
|
|
187
192
|
The first parameter is optional, with a default value of relative. The second parameter is a space delimited list of values that follow the standard CSS shorthand notation.
|
188
193
|
|
189
|
-
Note:
|
194
|
+
Note: unit-less values will be ignored. In the example above, this means that selectors will not be generated for the right and bottom positions, while the top position is set to 0px.
|
190
195
|
|
191
196
|
|
192
|
-
###Radial-Gradient
|
197
|
+
### Radial-Gradient
|
193
198
|
|
194
199
|
Takes up to 10 gradients. Position and shape are required.
|
195
200
|
|
@@ -197,30 +202,30 @@ Takes up to 10 gradients. Position and shape are required.
|
|
197
202
|
@include radial-gradient(50% 50%, circle cover, #eee 10%, #1e5799 30%, #efefef);
|
198
203
|
|
199
204
|
|
200
|
-
###Transform & Transform-origin
|
205
|
+
### Transform & Transform-origin
|
201
206
|
|
202
207
|
@include transform(translateY(50px));
|
203
208
|
@include transform-origin(center top);
|
204
209
|
|
205
210
|
|
206
|
-
###Transitions
|
211
|
+
### Transitions
|
207
212
|
|
208
|
-
Shorthand mixin: Supports multiple parentheses-
|
213
|
+
Shorthand mixin: Supports multiple parentheses-delimited values for each variable.
|
209
214
|
|
210
215
|
@include transition (all, 2.0s, ease-in-out);
|
211
216
|
@include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
|
212
217
|
@include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));`
|
213
218
|
|
214
219
|
|
215
|
-
##Functions
|
216
|
-
###Compact
|
220
|
+
## Functions
|
221
|
+
### Compact
|
217
222
|
|
218
223
|
The compact function will strip out any value from a list that is 'false'. Takes up to 10 arguments.
|
219
224
|
|
220
225
|
$full: compact($name-1, $name-2, $name-3, $name-4, $name-5, $name-6, $name-7, $name-8, $name-9, $name-10);
|
221
226
|
|
222
227
|
|
223
|
-
###Golden Ratio
|
228
|
+
### Golden Ratio
|
224
229
|
|
225
230
|
Returns the golden ratio of a given number. Must provide a Pixel or Em value for first argument. Also takes a required increment value that is not zero and an integer: ...-3, -2, -1, 1, 2, 3...
|
226
231
|
|
@@ -239,9 +244,9 @@ Returns the golden ratio of a given number. Must provide a Pixel or Em value for
|
|
239
244
|
Resources: [modularscale.com](http://modularscale.com) & [goldenratiocalculator.com](http://goldenratiocalculator.com)
|
240
245
|
|
241
246
|
|
242
|
-
###Linear-gradient
|
247
|
+
### Linear-gradient
|
243
248
|
|
244
|
-
Outputs a linear-gradient. Use in
|
249
|
+
Outputs a linear-gradient. Use in conjunction with the background-image mixin. The function takes the same arguments as the linear-gradient mixin (See Mixins section of this README).
|
245
250
|
|
246
251
|
# Image asset with a linear-gradient
|
247
252
|
@include background-image(url("/images/a.png"), linear-gradient(white 0, yellow 50%, transparent 50%));
|
@@ -250,9 +255,9 @@ Outputs a linear-gradient. Use in conjuntion with the background-image mixin. Th
|
|
250
255
|
@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(#4e7ba3, darken(#4e7ba4, 10%)) );
|
251
256
|
|
252
257
|
|
253
|
-
###Grid-width
|
258
|
+
### Grid-width
|
254
259
|
|
255
|
-
Easily setup and follow a grid based design. Need help
|
260
|
+
Easily setup and follow a grid based design. Need help busting a move grid-style?!? Check out [gridulator.com](http://gridulator.com/)
|
256
261
|
|
257
262
|
# The $gw-column and $gw-gutter variables must be defined in your base stylesheet to properly use the grid-width function.
|
258
263
|
$gw-column: 100px; // Column Width
|
@@ -264,7 +269,7 @@ Easily setup and follow a grid based design. Need help gridding? Check out [grid
|
|
264
269
|
}
|
265
270
|
|
266
271
|
|
267
|
-
###Tint & Shade
|
272
|
+
### Tint & Shade
|
268
273
|
|
269
274
|
Tint & shade are different from lighten() and darken() functions built into sass.
|
270
275
|
Tint is a mix of a color with white. Tint takes a color and a percent argument.
|
@@ -280,9 +285,9 @@ Shade is a mix of a color with black. Shade takes a color and a percent argument
|
|
280
285
|
}
|
281
286
|
|
282
287
|
|
283
|
-
##Add-ons
|
288
|
+
## Add-ons
|
284
289
|
|
285
|
-
###Buttons
|
290
|
+
### Buttons
|
286
291
|
|
287
292
|
The button add-on provides well-designed buttons with a single line in your CSS.
|
288
293
|
The mixin supports a style parameter and an optional color argument. The available styles are **"simple"** (default), **"shiny"**, and **"pill"**.
|
@@ -305,7 +310,27 @@ Create beautiful buttons by defining a style and color argument; using a single
|
|
305
310
|
}
|
306
311
|
|
307
312
|
|
308
|
-
###
|
313
|
+
### HTML5 Input Types
|
314
|
+
This addon generates a variable which contains a list of all html5 input types that render as text-based inputs, excluding textarea.
|
315
|
+
In other words, it allows for easy targeting of all inputs that mimick input[type="text"].
|
316
|
+
|
317
|
+
input[type="*"]
|
318
|
+
* = [color, date, datetime, datetime-local, email, month, number, password, search, tel, text, time, url, week]
|
319
|
+
|
320
|
+
|
321
|
+
Usage Note: You must use interpolation with the variable.
|
322
|
+
|
323
|
+
#{$all-text-inputs}, textarea {
|
324
|
+
border: 1px solid green;
|
325
|
+
}
|
326
|
+
|
327
|
+
Output:
|
328
|
+
input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], textarea {
|
329
|
+
border: 1px solid green;
|
330
|
+
}
|
331
|
+
|
332
|
+
|
333
|
+
### Timing functions
|
309
334
|
These CSS cubic-bezier timing functions are variables that can be used with CSS3 animations. The provided timing functions are the same as the jQuery UI demo: [easing functions](http://jqueryui.com/demos/effect/easing.html).
|
310
335
|
|
311
336
|
Variables supported: $ease-in-*, $ease-out-*, $ease-in-out-*
|
@@ -315,7 +340,7 @@ These CSS cubic-bezier timing functions are variables that can be used with CSS3
|
|
315
340
|
@include animation-basic(fade-in, 1s, $ease-in-quad);
|
316
341
|
|
317
342
|
|
318
|
-
#All Supported Functions, Mixins, and Addons
|
343
|
+
# All Supported Functions, Mixins, and Addons
|
319
344
|
*@ denotes a mixin and must be prefaced with @include*
|
320
345
|
|
321
346
|
#Functions
|
@@ -374,11 +399,12 @@ These CSS cubic-bezier timing functions are variables that can be used with CSS3
|
|
374
399
|
#Addons
|
375
400
|
--------------------------------
|
376
401
|
@ button(*args)
|
402
|
+
#{$all-text-inputs}
|
377
403
|
@ position(*args)
|
378
404
|
timing-functions ($ease-in-*, $ease-out-*, $ease-in-out-*)
|
379
405
|
|
380
406
|
|
381
|
-
##Help Out
|
407
|
+
## Help Out
|
382
408
|
|
383
409
|
Currently the project is a work in progress. Feel free to help out.
|
384
410
|
**Pull requests:** See *Browser Support* in this readme for more info
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bourbon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-09-
|
14
|
+
date: 2011-09-23 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sass
|
18
|
-
requirement: &
|
18
|
+
requirement: &70113739938740 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
version: '3.1'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70113739938740
|
27
27
|
description: ! 'The purpose of Bourbon Vanilla Sass Mixins is to provide a comprehensive
|
28
28
|
framework of
|
29
29
|
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- Rakefile
|
52
52
|
- app/assets/stylesheets/_bourbon.scss
|
53
53
|
- app/assets/stylesheets/addons/_button.scss
|
54
|
+
- app/assets/stylesheets/addons/_html5-input-types.scss
|
54
55
|
- app/assets/stylesheets/addons/_position.scss
|
55
56
|
- app/assets/stylesheets/addons/_timing-functions.scss
|
56
57
|
- app/assets/stylesheets/css3/_animation.scss
|