rapido-css 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rapido-css.rb +3 -1
- data/stylesheets/components/_breadcrumbs.scss +2 -1
- data/stylesheets/components/_buttons.scss +47 -9
- data/stylesheets/components/_dropdowns.scss +30 -19
- data/stylesheets/components/_forms.scss +74 -33
- data/stylesheets/components/_grids.scss +1 -5
- data/stylesheets/components/_navs.scss +1 -1
- data/stylesheets/components/_sliders.scss +2 -2
- data/stylesheets/components/_type.scss +6 -2
- data/stylesheets/settings/_dimensions.scss +16 -10
- data/stylesheets/utilities/_helper-classes.scss +4 -1
- data/stylesheets/utilities/_icon-fonts.scss +42 -8
- data/stylesheets/utilities/_mixins.scss +13 -14
- metadata +5 -16
- data/stylesheets/_susy.scss +0 -16
- data/stylesheets/susy/_background.scss +0 -18
- data/stylesheets/susy/_functions.scss +0 -376
- data/stylesheets/susy/_grid.scss +0 -286
- data/stylesheets/susy/_isolation.scss +0 -51
- data/stylesheets/susy/_margin.scss +0 -93
- data/stylesheets/susy/_media.scss +0 -112
- data/stylesheets/susy/_padding.scss +0 -92
- data/stylesheets/susy/_settings.scss +0 -56
- data/stylesheets/susy/_support.scss +0 -198
- data/stylesheets/susy/_units.scss +0 -159
@@ -18,10 +18,14 @@ Icon Fonts
|
|
18
18
|
url('http://weloveiconfonts.com/api/fonts/brandico/brandico.ttf') format('truetype'),
|
19
19
|
url('http://weloveiconfonts.com/api/fonts/brandico/brandico.svg#brandico') format('svg');
|
20
20
|
}
|
21
|
+
|
22
|
+
.branico {
|
23
|
+
display: inline-block;
|
24
|
+
font-family: 'branico';
|
25
|
+
}
|
21
26
|
}
|
22
27
|
|
23
28
|
// Entypo
|
24
|
-
//
|
25
29
|
|
26
30
|
@if $use-entypo {
|
27
31
|
@font-face {
|
@@ -34,10 +38,14 @@ Icon Fonts
|
|
34
38
|
url('http://weloveiconfonts.com/api/fonts/entypo/entypo.ttf') format('truetype'),
|
35
39
|
url('http://weloveiconfonts.com/api/fonts/entypo/entypo.svg#entypo') format('svg');
|
36
40
|
}
|
41
|
+
|
42
|
+
.entypo {
|
43
|
+
display: inline-block;
|
44
|
+
font-family: 'entypo';
|
45
|
+
}
|
37
46
|
}
|
38
47
|
|
39
48
|
// Fontawesome
|
40
|
-
//
|
41
49
|
|
42
50
|
@if $use-fontawesome {
|
43
51
|
@font-face {
|
@@ -50,10 +58,14 @@ Icon Fonts
|
|
50
58
|
url('http://weloveiconfonts.com/api/fonts/fontawesome/fontawesome-webfont.ttf') format('truetype'),
|
51
59
|
url('http://weloveiconfonts.com/api/fonts/fontawesome/fontawesome-webfont.svg#FontAwesomeRegular') format('svg');
|
52
60
|
}
|
61
|
+
|
62
|
+
.fontawesome {
|
63
|
+
display: inline-block;
|
64
|
+
font-family: 'FontAwesome';
|
65
|
+
}
|
53
66
|
}
|
54
67
|
|
55
68
|
// Fontelico
|
56
|
-
//
|
57
69
|
|
58
70
|
@if $use-fontelico {
|
59
71
|
@font-face {
|
@@ -66,10 +78,14 @@ Icon Fonts
|
|
66
78
|
url('http://weloveiconfonts.com/api/fonts/fontelico/fontelico.ttf') format('truetype'),
|
67
79
|
url('http://weloveiconfonts.com/api/fonts/fontelico/fontelico.svg#fontelico') format('svg');
|
68
80
|
}
|
81
|
+
|
82
|
+
.fontelico {
|
83
|
+
display: inline-block;
|
84
|
+
font-family: 'fontelico';
|
85
|
+
}
|
69
86
|
}
|
70
87
|
|
71
88
|
// Maki
|
72
|
-
//
|
73
89
|
|
74
90
|
@if $use-maki {
|
75
91
|
@font-face {
|
@@ -82,10 +98,14 @@ Icon Fonts
|
|
82
98
|
url('http://weloveiconfonts.com/api/fonts/maki/maki.ttf') format('truetype'),
|
83
99
|
url('http://weloveiconfonts.com/api/fonts/maki/maki.svg#maki') format('svg');
|
84
100
|
}
|
101
|
+
|
102
|
+
.maki {
|
103
|
+
display: inline-block;
|
104
|
+
font-family: 'maki';
|
105
|
+
}
|
85
106
|
}
|
86
107
|
|
87
108
|
// Openweb Icons
|
88
|
-
//
|
89
109
|
|
90
110
|
@if $use-openweb-icons {
|
91
111
|
@font-face {
|
@@ -98,10 +118,14 @@ Icon Fonts
|
|
98
118
|
url('http://weloveiconfonts.com/api/fonts/openwebicons/openwebicons.ttf') format('truetype'),
|
99
119
|
url('http://weloveiconfonts.com/api/fonts/openwebicons/openwebicons.svg#openweb_iconsregular') format('svg');
|
100
120
|
}
|
121
|
+
|
122
|
+
.openwebicons {
|
123
|
+
display: inline-block;
|
124
|
+
font-family: 'OpenWeb Icons';
|
125
|
+
}
|
101
126
|
}
|
102
127
|
|
103
128
|
// Typicons
|
104
|
-
//
|
105
129
|
|
106
130
|
@if $use-typicons {
|
107
131
|
@font-face {
|
@@ -114,10 +138,14 @@ Icon Fonts
|
|
114
138
|
url('http://weloveiconfonts.com/api/fonts/typicons/typicons-regular-webfont.ttf') format('truetype'),
|
115
139
|
url('http://weloveiconfonts.com/api/fonts/typicons/typicons-regular-webfont.svg#TypiconsRegular') format('svg');
|
116
140
|
}
|
141
|
+
|
142
|
+
.typicons {
|
143
|
+
display: inline-block;
|
144
|
+
font-family: 'Typicons';
|
145
|
+
}
|
117
146
|
}
|
118
147
|
|
119
148
|
// Zocial
|
120
|
-
//
|
121
149
|
|
122
150
|
@if $use-zocial {
|
123
151
|
@font-face {
|
@@ -130,4 +158,10 @@ Icon Fonts
|
|
130
158
|
url('http://weloveiconfonts.com/api/fonts/zocial/zocial-regular-webfont.ttf') format('truetype'),
|
131
159
|
url('http://weloveiconfonts.com/api/fonts/zocial/zocial-regular-webfont.svg#zocialregular') format('svg');
|
132
160
|
}
|
133
|
-
|
161
|
+
|
162
|
+
.zocial {
|
163
|
+
display: inline-block;
|
164
|
+
font-family: 'zocial';
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
@@ -112,6 +112,8 @@ Styleguide 23.3
|
|
112
112
|
|
113
113
|
Center-block
|
114
114
|
|
115
|
+
Horizzontally center an element.
|
116
|
+
|
115
117
|
@include center-block();
|
116
118
|
|
117
119
|
Become:
|
@@ -134,7 +136,7 @@ Styleguide 23.4
|
|
134
136
|
|
135
137
|
Center
|
136
138
|
|
137
|
-
Vertical and horizontal centering with absolute positioning, using the
|
139
|
+
Vertical and horizontal centering with absolute positioning, using the position absolute and negative translate.
|
138
140
|
|
139
141
|
@include center();
|
140
142
|
|
@@ -386,14 +388,9 @@ Styleguide 23.12
|
|
386
388
|
|
387
389
|
*/
|
388
390
|
|
389
|
-
@mixin alpha-color($color: #fff, $alpha: .5, $attribute:
|
390
|
-
|
391
|
-
|
392
|
-
color: rgba($color, $alpha);
|
393
|
-
} @else {
|
394
|
-
#{$attribute}: $color;
|
395
|
-
#{$attribute}: rgba($color, $alpha);
|
396
|
-
}
|
391
|
+
@mixin alpha-color($color: #fff, $alpha: .5, $attribute: color) {
|
392
|
+
#{$attribute}: $color;
|
393
|
+
#{$attribute}: rgba($color, $alpha);
|
397
394
|
}
|
398
395
|
|
399
396
|
/*
|
@@ -402,7 +399,9 @@ Keyframes support
|
|
402
399
|
|
403
400
|
Used for creating custom animations.
|
404
401
|
|
405
|
-
@include keyframes($name)
|
402
|
+
@include keyframes($name) {
|
403
|
+
...keyframes...
|
404
|
+
}
|
406
405
|
|
407
406
|
* `$name`: Name of the keyframe
|
408
407
|
|
@@ -668,20 +667,20 @@ Rapido use the compass' [Sprites Mixin](http://compass-style.org/help/tutorials/
|
|
668
667
|
for more info see the full documentation from the link.
|
669
668
|
|
670
669
|
First you need to add to your scss file an import to import all of the seperate icons that will be compiled in a single image.
|
671
|
-
For example if you have a folder named `
|
670
|
+
For example if you have a folder named `s` inside the main `images` folder add this line:
|
672
671
|
|
673
|
-
@import '
|
672
|
+
@import 's/ *.png';
|
674
673
|
|
675
674
|
Then add you have two options:
|
676
675
|
|
677
676
|
Add the sprite in the html with (where `icon_name` is the filename of the icon). .s` is the standard class the must be used with all sprites images.
|
678
677
|
|
679
|
-
<a href="#"><i class="s
|
678
|
+
<a href="#"><i class="s s-icon_name"></i> Link</a>
|
680
679
|
|
681
680
|
Or via `@include` from the scss:
|
682
681
|
|
683
682
|
a:before {
|
684
|
-
@include
|
683
|
+
@include s(icon_name)
|
685
684
|
}
|
686
685
|
|
687
686
|
The result is the same.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapido-css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,16 +9,16 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: susy
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 1.0.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 1.0.8
|
30
30
|
description: An easy and quick sass+compass+susy prototyping framework based on Bootstrap
|
31
31
|
without all the default styles.
|
32
32
|
email: raffaele.rasini@gmail.com
|
@@ -39,7 +39,6 @@ files:
|
|
39
39
|
- stylesheets/_default-styles.scss
|
40
40
|
- stylesheets/_functions.scss
|
41
41
|
- stylesheets/_normalize.scss
|
42
|
-
- stylesheets/_susy.scss
|
43
42
|
- stylesheets/components/_alerts.scss
|
44
43
|
- stylesheets/components/_breadcrumbs.scss
|
45
44
|
- stylesheets/components/_button-groups.scss
|
@@ -66,16 +65,6 @@ files:
|
|
66
65
|
- stylesheets/settings/_dimensions.scss
|
67
66
|
- stylesheets/settings/_effects.scss
|
68
67
|
- stylesheets/styleguide.md
|
69
|
-
- stylesheets/susy/_background.scss
|
70
|
-
- stylesheets/susy/_functions.scss
|
71
|
-
- stylesheets/susy/_grid.scss
|
72
|
-
- stylesheets/susy/_isolation.scss
|
73
|
-
- stylesheets/susy/_margin.scss
|
74
|
-
- stylesheets/susy/_media.scss
|
75
|
-
- stylesheets/susy/_padding.scss
|
76
|
-
- stylesheets/susy/_settings.scss
|
77
|
-
- stylesheets/susy/_support.scss
|
78
|
-
- stylesheets/susy/_units.scss
|
79
68
|
- stylesheets/utilities/_animations.scss
|
80
69
|
- stylesheets/utilities/_debug.scss
|
81
70
|
- stylesheets/utilities/_helper-classes.scss
|
data/stylesheets/_susy.scss
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
// ---------------------------------------------------------------------------
|
2
|
-
// Partials
|
3
|
-
|
4
|
-
// temporary
|
5
|
-
@import "susy/support";
|
6
|
-
@import "susy/units";
|
7
|
-
|
8
|
-
// permanent
|
9
|
-
@import "susy/settings";
|
10
|
-
@import "susy/functions";
|
11
|
-
@import "susy/grid";
|
12
|
-
@import "susy/isolation";
|
13
|
-
@import "susy/padding";
|
14
|
-
@import "susy/margin";
|
15
|
-
@import "susy/media";
|
16
|
-
@import "susy/background";
|
@@ -1,18 +0,0 @@
|
|
1
|
-
// ---------------------------------------------------------------------------
|
2
|
-
// Imports
|
3
|
-
|
4
|
-
@import "compass/layout/grid-background";
|
5
|
-
@import "compass/css3/background-origin";
|
6
|
-
@import "compass/css3/background-clip";
|
7
|
-
|
8
|
-
// ---------------------------------------------------------------------------
|
9
|
-
// Susy Grid Background
|
10
|
-
//
|
11
|
-
// A wrapper for the compass "column-grid-background" mixin
|
12
|
-
// Uses all your settings to create a grid background for a container element.
|
13
|
-
// Note: Sub-pixel rounding can lead to several pixels of variation between browsers.
|
14
|
-
@mixin susy-grid-background(){
|
15
|
-
@include column-grid-background($total-columns, column(), gutter(), 0);
|
16
|
-
@include background-origin(content-box);
|
17
|
-
@include background-clip(content-box);
|
18
|
-
}
|
@@ -1,376 +0,0 @@
|
|
1
|
-
// ---------------------------------------------------------------------------
|
2
|
-
// Imports
|
3
|
-
|
4
|
-
// We need access to some basic font settings for handling media-queries.
|
5
|
-
@import "compass/typography/vertical_rhythm";
|
6
|
-
|
7
|
-
// For now, we also need this...
|
8
|
-
$browser-default-font-size-px : 16px;
|
9
|
-
$browser-default-font-size-percent : 100%;
|
10
|
-
$browser-default-font-size-pt : 12pt;
|
11
|
-
|
12
|
-
$rem-with-px-fallback : true !default;
|
13
|
-
|
14
|
-
// ---------------------------------------------------------------------------
|
15
|
-
// Sass list Functions
|
16
|
-
|
17
|
-
// Return a list with specific items removed
|
18
|
-
//
|
19
|
-
// filter($list, $target)
|
20
|
-
// - $list : The list to filter.
|
21
|
-
// - $target : An item to be removed from the list.
|
22
|
-
@function filter($list, $target) {
|
23
|
-
$clean: compact();
|
24
|
-
@if index($list, $target) {
|
25
|
-
@each $item in $list {
|
26
|
-
$clean: if($item == $target, $clean, append($clean, $item));
|
27
|
-
}
|
28
|
-
} @else { $clean: $list; }
|
29
|
-
@return $clean;
|
30
|
-
}
|
31
|
-
|
32
|
-
// ---------------------------------------------------------------------------
|
33
|
-
// Don't use static output when it will break things
|
34
|
-
|
35
|
-
// Switch element-level output to fluid, when container-width is wrong for static
|
36
|
-
//
|
37
|
-
// fix-static-misalignment([$style, $width])
|
38
|
-
// - $style: $container-style.
|
39
|
-
// - $width: $container-width.
|
40
|
-
@function fix-static-misalignment(
|
41
|
-
$style: $container-style,
|
42
|
-
$width: $container-width
|
43
|
-
) {
|
44
|
-
@if $container-width and $container-width != container-outer-width($width: false) {
|
45
|
-
$style: fluid;
|
46
|
-
}
|
47
|
-
@return $style;
|
48
|
-
}
|
49
|
-
|
50
|
-
// ---------------------------------------------------------------------------
|
51
|
-
// Grid Functions
|
52
|
-
|
53
|
-
// Returns the full width of a grid based on your grid settings.
|
54
|
-
//
|
55
|
-
// $columns : The number of columns to get width for.
|
56
|
-
@function columns-width(
|
57
|
-
$columns : $total-columns
|
58
|
-
) {
|
59
|
-
@if round($columns) != $columns {
|
60
|
-
@warn "Susy works best with integer column-spans.
|
61
|
-
For partial-columns, you may need to finesse the math by hand using functions directly.";
|
62
|
-
}
|
63
|
-
@return ($columns * $column-width) + (if($columns >= 1, ceil($columns - 1), 0) * $gutter-width);
|
64
|
-
}
|
65
|
-
|
66
|
-
// Return the grid width after adding or subtracting grid padding
|
67
|
-
//
|
68
|
-
// $width : the width of the grid without padding;
|
69
|
-
// $operation : ( add | subtract ) if padding should be added or subtracted;
|
70
|
-
@function handle-grid-padding(
|
71
|
-
$width,
|
72
|
-
$operation : subtract
|
73
|
-
) {
|
74
|
-
$pad: $grid-padding*2;
|
75
|
-
|
76
|
-
@if comparable($width, $grid-padding) {
|
77
|
-
$width: if($operation == subtract, $width - $pad, $width + $pad);
|
78
|
-
} @else {
|
79
|
-
@warn "$grid-padding must be set in units comparable to the container width.";
|
80
|
-
}
|
81
|
-
|
82
|
-
@return $width;
|
83
|
-
}
|
84
|
-
|
85
|
-
// Return the full outer width of a Container element.
|
86
|
-
//
|
87
|
-
// $columns : The number of columns in the Grid Layout.
|
88
|
-
@function container-outer-width(
|
89
|
-
$columns : $total-columns,
|
90
|
-
$width : $container-width
|
91
|
-
) {
|
92
|
-
$outerwidth: if($width, $width, columns-width($columns));
|
93
|
-
|
94
|
-
@if $width {
|
95
|
-
@if not $border-box-sizing { $outerwidth: handle-grid-padding($outerwidth, subtract); }
|
96
|
-
} @else {
|
97
|
-
@if $border-box-sizing { $outerwidth: handle-grid-padding($outerwidth, add); }
|
98
|
-
}
|
99
|
-
|
100
|
-
@return $outerwidth;
|
101
|
-
}
|
102
|
-
|
103
|
-
// Return the percentage width of a single column in a given 'context'.
|
104
|
-
//
|
105
|
-
// $context : The grid context in columns, if nested.
|
106
|
-
// $style : The container style to use.
|
107
|
-
@function column(
|
108
|
-
$context : $total-columns,
|
109
|
-
$style : fix-static-misalignment()
|
110
|
-
) {
|
111
|
-
@return if($style == static, $column-width, relative-width($column-width, $context));
|
112
|
-
}
|
113
|
-
|
114
|
-
// Return the percentage width of multiple 'columns' in a given 'context'.
|
115
|
-
//
|
116
|
-
// $columns : The number of columns to get relative width for.
|
117
|
-
// $context : The grid context in columns, if nested.
|
118
|
-
// $style : The container style to use.
|
119
|
-
@function columns(
|
120
|
-
$columns,
|
121
|
-
$context : $total-columns,
|
122
|
-
$style : fix-static-misalignment()
|
123
|
-
) {
|
124
|
-
@return if($style == static, columns-width($columns), relative-width(columns-width($columns), $context));
|
125
|
-
}
|
126
|
-
|
127
|
-
// Return the percentage width of a single gutter in a given 'context'.
|
128
|
-
//
|
129
|
-
// $context : The grid context in columns, if nested.
|
130
|
-
// $style : The container style to use.
|
131
|
-
@function gutter(
|
132
|
-
$context : $total-columns,
|
133
|
-
$style : fix-static-misalignment()
|
134
|
-
) {
|
135
|
-
@return if($style == static, $gutter-width, relative-width($gutter-width, $context));
|
136
|
-
}
|
137
|
-
|
138
|
-
// Return the percentage width of a given value in a given 'context'.
|
139
|
-
//
|
140
|
-
// $width : Any given width value.
|
141
|
-
// $context : The grid context in columns, if nested.
|
142
|
-
@function relative-width(
|
143
|
-
$width,
|
144
|
-
$context : $total-columns
|
145
|
-
) {
|
146
|
-
@return percentage($width / columns-width($context));
|
147
|
-
}
|
148
|
-
|
149
|
-
// Return the total space occupied by multiple columns and associated gutters.
|
150
|
-
// Useful for adding padding or margins (prefix, suffix, push, pull, etc.)
|
151
|
-
//
|
152
|
-
// $columns : The number of columns to get relative space for.
|
153
|
-
// $context : The grid context in columns, if nested.
|
154
|
-
// $style : The container style to use.
|
155
|
-
@function space(
|
156
|
-
$columns,
|
157
|
-
$context : $total-columns,
|
158
|
-
$style : fix-static-misalignment()
|
159
|
-
) {
|
160
|
-
@return columns($columns, $context, $style) + if($columns >= 1, gutter($context, $style), 0);
|
161
|
-
}
|
162
|
-
|
163
|
-
// Accept a list including column-count and (optional) position.
|
164
|
-
// Return either the column count or the position alone.
|
165
|
-
//
|
166
|
-
// $columns : the list to split and interprate.
|
167
|
-
// $request : The value to return, either 'columns' or 'position'.
|
168
|
-
@function split-columns-value(
|
169
|
-
$columns,
|
170
|
-
$request : columns
|
171
|
-
) {
|
172
|
-
$pos : false;
|
173
|
-
$cols : false;
|
174
|
-
|
175
|
-
@each $var in $columns {
|
176
|
-
@if (type-of($var) == 'string') {
|
177
|
-
$pos: $var;
|
178
|
-
} @else {
|
179
|
-
@if (type-of($var) == 'number') and (unitless($var)) {
|
180
|
-
$cols: $var;
|
181
|
-
} @else {
|
182
|
-
@warn '"#{$var}" is not a valid part of "$columns: #{$columns}" in the columns() mixin.';
|
183
|
-
}
|
184
|
-
}
|
185
|
-
}
|
186
|
-
|
187
|
-
@if $request == 'columns' {
|
188
|
-
@return $cols;
|
189
|
-
} @else {
|
190
|
-
@if $request == 'position' {
|
191
|
-
@return $pos;
|
192
|
-
} @else {
|
193
|
-
@warn '"#{$request}"" is not a valid value for $request';
|
194
|
-
}
|
195
|
-
}
|
196
|
-
}
|
197
|
-
|
198
|
-
// Accept nth-selector variables, and format them as a valid CSS3 selector.
|
199
|
-
//
|
200
|
-
// $n : [first | only | last | <equation>]
|
201
|
-
// $selector : [child | last-child | of-type | last-of-type ]
|
202
|
-
@function format-nth(
|
203
|
-
$n : last,
|
204
|
-
$selector : child
|
205
|
-
) {
|
206
|
-
@if ($n == 'last') or ($n =='first') or ($n =='only') {
|
207
|
-
$selector: '#{$n}-#{$selector}';
|
208
|
-
} @else {
|
209
|
-
$selector: 'nth-#{$selector}(#{$n})';
|
210
|
-
}
|
211
|
-
@return $selector;
|
212
|
-
}
|
213
|
-
|
214
|
-
// ---------------------------------------------------------------------------
|
215
|
-
// Media Functions
|
216
|
-
|
217
|
-
// Return an em value adjusted to match the browser default font size.
|
218
|
-
// Note: This only works if actual sizes are set relative to browser defaults.
|
219
|
-
//
|
220
|
-
// $ems : The initial value to be converted.
|
221
|
-
// $font-size : The current font-size in.
|
222
|
-
@function base-ems(
|
223
|
-
$ems,
|
224
|
-
$font-size: $base-font-size
|
225
|
-
){
|
226
|
-
$font-size : if(unit($ems) == 'rem', $base-font-size, $font-size);
|
227
|
-
$unit : unit($font-size);
|
228
|
-
$mult : $ems / ($ems * 0 + 1);
|
229
|
-
|
230
|
-
@if $unit == 'px' {
|
231
|
-
@return $font-size / $browser-default-font-size-px * $mult * 1em;
|
232
|
-
}
|
233
|
-
@else if $unit == '%' {
|
234
|
-
@return $font-size / $browser-default-font-size-percent * $mult * 1em;
|
235
|
-
}
|
236
|
-
@else if $unit == 'em' {
|
237
|
-
@return $font-size / 1em * $mult * 1em;
|
238
|
-
}
|
239
|
-
@else if $unit == 'pt' {
|
240
|
-
@return $font-size / $browser-default-font-size-pt * $mult * 1em;
|
241
|
-
}
|
242
|
-
@else {
|
243
|
-
@warn 'Variable $base-font-size does not have a valid font unit. Valid units for fonts in CSS are px, pt, em, and %.';
|
244
|
-
}
|
245
|
-
}
|
246
|
-
|
247
|
-
// This name will be deprecated...
|
248
|
-
@function absolute-ems($ems, $font-size: $base-font-size){ @return base-ems($ems, $font-size); }
|
249
|
-
|
250
|
-
// Return a length, after any em-values have been sent through absolute-ems().
|
251
|
-
//
|
252
|
-
// $length : The length value to be checked and adjusted if necessary.
|
253
|
-
// $font-size : The current font-size in px.
|
254
|
-
@function fix-ems(
|
255
|
-
$length,
|
256
|
-
$font-size: $base-font-size
|
257
|
-
){
|
258
|
-
@if $length {
|
259
|
-
@if (unit($length) == 'em') or (unit($length) == 'rem') {
|
260
|
-
$length: absolute-ems($length,$font-size);
|
261
|
-
}
|
262
|
-
}
|
263
|
-
@return $length;
|
264
|
-
}
|
265
|
-
|
266
|
-
// Sort a list of arguments into "$min $layout $max $ie" order, and return the list.
|
267
|
-
//
|
268
|
-
// $media-layout : a list of values [$min $layout $max $ie] including...
|
269
|
-
// : - one unitless number (columns in a layout)
|
270
|
-
// : - two optional lengths (min and max-width media-query breakpoints).
|
271
|
-
// : - one optional boolean or string to trigger fallback support for IE.
|
272
|
-
// $font-size : [optional] The base font-size of your layout, if you are using ems.
|
273
|
-
// : - defaults to $base-font-size
|
274
|
-
@function medialayout(
|
275
|
-
$media-layout,
|
276
|
-
$font-size: $base-font-size
|
277
|
-
) {
|
278
|
-
$media : false;
|
279
|
-
$min : false;
|
280
|
-
$layout : false;
|
281
|
-
$max : false;
|
282
|
-
$ie : false;
|
283
|
-
$has-layout : false;
|
284
|
-
|
285
|
-
@each $val in $media-layout {
|
286
|
-
@if (type-of($val) == "number") {
|
287
|
-
@if unitless($val) {
|
288
|
-
$layout : $val;
|
289
|
-
$has-layout : true;
|
290
|
-
} @else {
|
291
|
-
@if ($has-layout) and (not $media) {
|
292
|
-
$max: $val;
|
293
|
-
} @else {
|
294
|
-
@if $media {
|
295
|
-
$media: join($media,$val);
|
296
|
-
} @else {
|
297
|
-
$media: $val;
|
298
|
-
}
|
299
|
-
}
|
300
|
-
}
|
301
|
-
} @else {
|
302
|
-
$ie: $val;
|
303
|
-
}
|
304
|
-
}
|
305
|
-
@if (length($media) > 0) {
|
306
|
-
@if (length($media) == 1) {
|
307
|
-
$min: nth($media,1);
|
308
|
-
} @else {
|
309
|
-
$min: nth($media,1);
|
310
|
-
$max: nth($media,2);
|
311
|
-
@if comparable($min, $max) {
|
312
|
-
@if ($min > $max) {
|
313
|
-
$max: nth($media,1);
|
314
|
-
$min: nth($media,2);
|
315
|
-
}
|
316
|
-
} @else {
|
317
|
-
@warn "Can't compare incompatible units.
|
318
|
-
Using #{$min} for min-width, and #{$max} for max-width";
|
319
|
-
}
|
320
|
-
@if (length($media) > 2) {
|
321
|
-
@warn "You can only send two lengths: a min-width and an (optional) max-width.
|
322
|
-
You sent #{length($media)}: #{$media}";
|
323
|
-
}
|
324
|
-
}
|
325
|
-
}
|
326
|
-
|
327
|
-
// media-queries must be set in ems relative to the browser default
|
328
|
-
// rather than the font-size set in CSS.
|
329
|
-
$min: fix-ems($min,$font-size);
|
330
|
-
$max: fix-ems($max,$font-size);
|
331
|
-
|
332
|
-
@return $min $layout $max $ie;
|
333
|
-
}
|
334
|
-
|
335
|
-
// Return the nearest layout (column-count) above a given breakpoint.
|
336
|
-
//
|
337
|
-
// $min : The min-width media-query breakpoint above which to establish a new layout.
|
338
|
-
@function get-layout (
|
339
|
-
$min
|
340
|
-
) {
|
341
|
-
$columns : 1;
|
342
|
-
$layout-width : container-outer-width($columns);
|
343
|
-
$return : false;
|
344
|
-
$min : fix-ems($min);
|
345
|
-
|
346
|
-
@if comparable($min, $layout-width) {
|
347
|
-
@while $min >= $layout-width {
|
348
|
-
$columns : $columns + 1;
|
349
|
-
$layout-width : container-outer-width($columns);
|
350
|
-
}
|
351
|
-
$return : $columns;
|
352
|
-
}
|
353
|
-
|
354
|
-
@return $return;
|
355
|
-
}
|
356
|
-
|
357
|
-
// Check to see if a given $media-layout list is simply the default.
|
358
|
-
//
|
359
|
-
// $media-layout : a list of values including -
|
360
|
-
// : One unitless number (columns in a layout)
|
361
|
-
// : Two optional lengths (min and max-width media-query breakpoints).
|
362
|
-
// : One optional boolean or string to trigger fallback support for IE.
|
363
|
-
@function is-default-layout(
|
364
|
-
$media-layout
|
365
|
-
) {
|
366
|
-
$media-layout : medialayout($media-layout);
|
367
|
-
$min : nth($media-layout,1);
|
368
|
-
$layout-cols : nth($media-layout,2);
|
369
|
-
$max : nth($media-layout,3);
|
370
|
-
|
371
|
-
@if $min or $max {
|
372
|
-
@return false;
|
373
|
-
} @else {
|
374
|
-
@return if($layout-cols == $total-columns,true,false);
|
375
|
-
}
|
376
|
-
}
|