compass 0.13.alpha.7 → 0.13.alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION.yml +1 -1
- data/frameworks/compass/stylesheets/compass/_support.scss +136 -62
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +1 -1
- data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +11 -2
- data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +2 -2
- data/frameworks/compass/stylesheets/compass/css3/_opacity.scss +1 -1
- data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +1 -1
- data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +2 -2
- data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +1 -1
- data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +3 -3
- data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +6 -6
- data/lib/compass/browser_support.rb +2 -2
- data/lib/compass/caniuse.rb +55 -19
- data/lib/compass/sass_extensions/functions/cross_browser_support.rb +34 -10
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +0 -3
- data/test/fixtures/stylesheets/compass/css/animation.css +0 -3
- data/test/fixtures/stylesheets/compass/css/filters.css +30 -6
- data/test/fixtures/stylesheets/compass/css/gradients.css +7 -2
- data/test/fixtures/stylesheets/compass/css/support.css +23 -16
- data/test/fixtures/stylesheets/compass/sass/support.scss +45 -8
- data/test/fixtures/stylesheets/envtest/tmp/env.css +3 -3
- data/test/units/caniuse_test.rb +29 -10
- metadata +3 -91
- data/test/fixtures/stylesheets/compass/tmp/animation-with-legacy-ie.css +0 -22
- data/test/fixtures/stylesheets/compass/tmp/animation.css +0 -22
- data/test/fixtures/stylesheets/compass/tmp/appearance.css +0 -3
- data/test/fixtures/stylesheets/compass/tmp/background-clip.css +0 -11
- data/test/fixtures/stylesheets/compass/tmp/background-origin.css +0 -11
- data/test/fixtures/stylesheets/compass/tmp/background-size.css +0 -17
- data/test/fixtures/stylesheets/compass/tmp/border_radius.css +0 -14
- data/test/fixtures/stylesheets/compass/tmp/box-sizing.css +0 -9
- data/test/fixtures/stylesheets/compass/tmp/box.css +0 -103
- data/test/fixtures/stylesheets/compass/tmp/box_shadow.css +0 -24
- data/test/fixtures/stylesheets/compass/tmp/brightness.css +0 -14
- data/test/fixtures/stylesheets/compass/tmp/browser-support.css +0 -306
- data/test/fixtures/stylesheets/compass/tmp/color.css +0 -18
- data/test/fixtures/stylesheets/compass/tmp/columns.css +0 -134
- data/test/fixtures/stylesheets/compass/tmp/filters.css +0 -29
- data/test/fixtures/stylesheets/compass/tmp/flexbox.css +0 -94
- data/test/fixtures/stylesheets/compass/tmp/fonts.css +0 -4
- data/test/fixtures/stylesheets/compass/tmp/force-wrap.css +0 -9
- data/test/fixtures/stylesheets/compass/tmp/gradients.css +0 -230
- data/test/fixtures/stylesheets/compass/tmp/grid_background.css +0 -64
- data/test/fixtures/stylesheets/compass/tmp/hyphenation.css +0 -16
- data/test/fixtures/stylesheets/compass/tmp/image_size.css +0 -15
- data/test/fixtures/stylesheets/compass/tmp/images.css +0 -8
- data/test/fixtures/stylesheets/compass/tmp/layout.css +0 -16
- data/test/fixtures/stylesheets/compass/tmp/legacy_clearfix.css +0 -26
- data/test/fixtures/stylesheets/compass/tmp/lists.css +0 -145
- data/test/fixtures/stylesheets/compass/tmp/opacity.css +0 -3
- data/test/fixtures/stylesheets/compass/tmp/print.css +0 -11
- data/test/fixtures/stylesheets/compass/tmp/regions.css +0 -9
- data/test/fixtures/stylesheets/compass/tmp/replacement.css +0 -59
- data/test/fixtures/stylesheets/compass/tmp/reset.css +0 -59
- data/test/fixtures/stylesheets/compass/tmp/selection.css +0 -50
- data/test/fixtures/stylesheets/compass/tmp/sprites.css +0 -1263
- data/test/fixtures/stylesheets/compass/tmp/sprites_with_explicit_separator.css +0 -16
- data/test/fixtures/stylesheets/compass/tmp/stretching.css +0 -66
- data/test/fixtures/stylesheets/compass/tmp/support.css +0 -59
- data/test/fixtures/stylesheets/compass/tmp/text_shadow.css +0 -29
- data/test/fixtures/stylesheets/compass/tmp/transform.css +0 -369
- data/test/fixtures/stylesheets/compass/tmp/transition.css +0 -116
- data/test/fixtures/stylesheets/compass/tmp/typography/links/hover-link.css +0 -4
- data/test/fixtures/stylesheets/compass/tmp/units.css +0 -30
- data/test/fixtures/stylesheets/compass/tmp/user-interface.css +0 -52
- data/test/fixtures/stylesheets/compass/tmp/utilities.css +0 -71
- data/test/fixtures/stylesheets/compass/tmp/vertical_rhythm.css +0 -211
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d6c6dd7481ec7877855d168f9505d10186b7a51
|
4
|
+
data.tar.gz: 80fc296eb971444658894a328e313ea2331df706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 309c62c39207648d3e586f7ff575aaea385ec13886b9013563da2ff4e99c19881078cd6284b40b7cc07809af4c2a82514fde27ac8ed085325c947cb071d045fa
|
7
|
+
data.tar.gz: f326bcd541902ba48d3a0fd06e56b802974a73172bc1ec78d9d6b0306a4fe9015e368ceede9d4d456996a5bf0105a5adb79417e3b848568f15780b0d9a11a78d
|
data/VERSION.yml
CHANGED
@@ -32,12 +32,19 @@ $default-capability-options: (
|
|
32
32
|
(partial-support: true)
|
33
33
|
);
|
34
34
|
|
35
|
-
// When a prefix
|
35
|
+
// When a prefix in in context, but there is no current prefix
|
36
|
+
// That context is recorded here so other prefixes can be avoided.
|
37
|
+
$prefix-context: null;
|
38
|
+
|
39
|
+
// When a prefix is in a selector or directive scope, this is set to the
|
40
|
+
// current prefix value. When `null`, either there is no prefix in scope
|
41
|
+
// or the official prefix is being rendered. The `$prefix-context`
|
42
|
+
// variable can be used to make that distinction.
|
36
43
|
$current-prefix: null;
|
37
44
|
|
38
45
|
// When in a context that only exists in a particular version
|
39
46
|
// this variable is set to those versions.
|
40
|
-
$current-browser-
|
47
|
+
$current-browser-versions: ();
|
41
48
|
|
42
49
|
// The legacy support CSS 2.1 Selectors.
|
43
50
|
// Defaults to the $critical-usage-threshold.
|
@@ -47,21 +54,23 @@ $css-sel2-support-threshold: $critical-usage-threshold !default;
|
|
47
54
|
@function browser-out-of-scope($browser, $version: null) {
|
48
55
|
@if not ($current-prefix == null or $current-prefix == browser-prefix($browser)) {
|
49
56
|
@if $debug-browser-support {
|
50
|
-
@return "
|
57
|
+
@return "#{$browser} #{$version} is incompatible with #{$current-prefix}."
|
51
58
|
} @else {
|
52
59
|
@return true;
|
53
60
|
}
|
54
61
|
}
|
55
|
-
$current-
|
56
|
-
|
62
|
+
$current-range: map-get($current-browser-versions, $browser);
|
63
|
+
$current-min: if($current-range, nth($current-range, 1), null);
|
64
|
+
$current-max: if($current-range, nth($current-range, 2), null);
|
65
|
+
@if not ($version and $current-max) {
|
57
66
|
// We don't have any versions to compare
|
58
67
|
@return false;
|
59
68
|
} @else {
|
60
69
|
// If the version is less than the current min, it is not supported
|
61
|
-
$too-old: compare-browser-versions($browser, $version, $current-
|
70
|
+
$too-old: compare-browser-versions($browser, $version, $current-max) < 0;
|
62
71
|
@if $too-old {
|
63
72
|
@if $debug-browser-support {
|
64
|
-
@return "The current scope only works with #{$browser
|
73
|
+
@return "The current scope only works with #{display-browser-range($browser, $current-min, $current-max)}.";
|
65
74
|
} @else {
|
66
75
|
@return true;
|
67
76
|
}
|
@@ -73,48 +82,60 @@ $css-sel2-support-threshold: $critical-usage-threshold !default;
|
|
73
82
|
|
74
83
|
// Check whether the browser is supported according to the declared minimum support
|
75
84
|
// and usage thresholds.
|
76
|
-
@function support-legacy-browser($browser, $version, $threshold: $critical-usage-threshold) {
|
85
|
+
@function support-legacy-browser($browser, $min-version, $max-version: null, $threshold: $critical-usage-threshold) {
|
77
86
|
// Check agaist usage stats and declared minimums
|
78
|
-
$min-version: map-get($browser-minimum-versions, $browser);
|
79
|
-
|
80
|
-
|
87
|
+
$min-required-version: map-get($browser-minimum-versions, $browser);
|
88
|
+
$usage: if($max-version,
|
89
|
+
omitted-usage($browser, $min-version, $max-version),
|
90
|
+
omitted-usage($browser, $min-version));
|
91
|
+
@return $usage > $threshold or
|
92
|
+
($min-required-version and
|
93
|
+
compare-browser-versions($browser, $max-version or $min-version, $min-required-version) >= 0);
|
81
94
|
}
|
82
95
|
|
83
96
|
// Include content for a legacy browser
|
84
97
|
// Version can be a single version string or a list of versions ordered from oldest to newest.
|
85
|
-
@mixin for-legacy-browser($browser, $version, $
|
86
|
-
|
87
|
-
|
88
|
-
|
98
|
+
@mixin for-legacy-browser($browser, $min-version, $max-version: $min-version,
|
99
|
+
$threshold: $critical-usage-threshold,
|
100
|
+
$ranges: ($browser: $min-version $max-version)) {
|
101
|
+
@if not browser-out-of-scope($browser, $max-version) and
|
102
|
+
support-legacy-browser($browser, $min-version, $max-version, $threshold)
|
89
103
|
{
|
90
104
|
@if $debug-browser-support {
|
91
105
|
/* Content for #{$browser} #{$version}.
|
92
106
|
Min version: #{map-get($browser-minimum-versions, $browser) or unspecified}.
|
93
107
|
User threshold to keep: #{$threshold}%. If #{$browser} #{$version} and below are omitted: #{omitted-usage($browser, $version)}%. */
|
94
108
|
}
|
95
|
-
@include with-browser-
|
109
|
+
@include with-browser-ranges(intersect-browser-ranges($current-browser-versions, $ranges)) {
|
96
110
|
@content;
|
97
111
|
}
|
98
|
-
} @else if $debug-browser-support and browser-out-of-scope($browser, $
|
99
|
-
/* Content for #{$browser
|
100
|
-
Not allowed in the current scope: #{browser-out-of-scope($browser, $
|
101
|
-
} @else if $debug-browser-support and not
|
102
|
-
|
103
|
-
|
104
|
-
|
112
|
+
} @else if $debug-browser-support and browser-out-of-scope($browser, $max-version) {
|
113
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
|
114
|
+
Not allowed in the current scope: #{browser-out-of-scope($browser, $max-version)} */
|
115
|
+
} @else if $debug-browser-support and not
|
116
|
+
support-legacy-browser($browser, $min-version, $max-version, $threshold) {
|
117
|
+
@if omitted-usage($browser, $min-version, $max-version) > $threshold {
|
118
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
|
119
|
+
User threshold to keep: #{$threshold}%. If #{display-browser-range($browser, $min-version, $max-version)} and below are omitted: #{omitted-usage($browser, $min-version, $max-version)}%. */
|
105
120
|
} @else {
|
106
|
-
/* Content for #{$browser
|
121
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
|
107
122
|
Minimum support is #{map-get($browser-minimum-versions, $browser)}. */
|
108
123
|
}
|
109
124
|
}
|
110
125
|
}
|
111
126
|
|
127
|
+
@function display-browser-range($browser, $min-version, $max-version: $min-version) {
|
128
|
+
@return "#{unquote($browser)} #{unquote($min-version)}#{if($max-version != $min-version, unquote(' -') unquote($max-version), null)}";
|
129
|
+
}
|
130
|
+
|
131
|
+
|
112
132
|
// Renders the content once if any of the legacy browsers are supported.
|
133
|
+
// $browsers is a map of browser name to version ranges
|
113
134
|
@mixin for-legacy-browsers($browsers, $threshold: $critical-usage-threshold) {
|
114
135
|
$rendered: false;
|
115
|
-
@each $browser, $
|
136
|
+
@each $browser, $range in $browsers {
|
116
137
|
@if not $rendered {
|
117
|
-
@include for-legacy-browser($browser, $
|
138
|
+
@include for-legacy-browser($browser, $range..., $threshold: $threshold, $ranges: $browsers) {
|
118
139
|
$rendered: true;
|
119
140
|
@content;
|
120
141
|
}
|
@@ -125,16 +146,44 @@ $css-sel2-support-threshold: $critical-usage-threshold !default;
|
|
125
146
|
// If there's a prefix context in scope, this will only output the content if the prefix matches.
|
126
147
|
// Otherwise, sets the current prefix scope and outputs the content.
|
127
148
|
@mixin with-prefix($prefix) {
|
128
|
-
@if $current-prefix {
|
129
|
-
@if $current-prefix == $prefix {
|
149
|
+
@if $current-prefix or $prefix-context {
|
150
|
+
@if $current-prefix == $prefix or $prefix-context == $prefix {
|
151
|
+
@if $debug-browser-support {
|
152
|
+
@if $prefix {
|
153
|
+
/* content for #{$prefix} because #{$current-prefix or $prefix-context} is already in scope. */
|
154
|
+
} @else {
|
155
|
+
/* unprefixed content. #{$current-prefix or $prefix-context} is already in scope. */
|
156
|
+
}
|
157
|
+
}
|
158
|
+
$old-prefix-context: $prefix-context;
|
159
|
+
$old-prefix: $current-prefix;
|
160
|
+
$prefix-context: $prefix-context or $current-prefix !global;
|
161
|
+
$current-prefix: $prefix !global;
|
162
|
+
@content;
|
163
|
+
$prefix-context: $old-prefix-context !global;
|
164
|
+
$current-prefix: $old-prefix !global;
|
165
|
+
} @else if $prefix == null {
|
166
|
+
$old-prefix-context: $prefix-context;
|
167
|
+
$prefix-context: $prefix-context or $current-prefix !global;
|
168
|
+
$current-prefix: null !global;
|
169
|
+
@if $debug-browser-support {
|
170
|
+
/* Content for official syntax. Prefix context is still #{$prefix-context}. */
|
171
|
+
}
|
130
172
|
@content;
|
173
|
+
$current-prefix: $prefix-context !global;
|
174
|
+
$prefix-context: $old-prefix-context !global;
|
131
175
|
} @else if $debug-browser-support {
|
132
176
|
/* Omitting content for #{$prefix} because #{$current-prefix} is already in scope. */
|
133
177
|
}
|
134
178
|
} @else {
|
179
|
+
@if $debug-browser-support and $prefix {
|
180
|
+
/* Creating new #{$prefix} context. */
|
181
|
+
}
|
182
|
+
$prefix-context: $prefix !global;
|
135
183
|
$current-prefix: $prefix !global;
|
136
184
|
@content;
|
137
185
|
$current-prefix: null !global;
|
186
|
+
$prefix-context: null !global;
|
138
187
|
}
|
139
188
|
}
|
140
189
|
|
@@ -157,32 +206,44 @@ $css-sel2-support-threshold: $critical-usage-threshold !default;
|
|
157
206
|
@if $debug-browser-support and type-of($should-use-prefix) == list {
|
158
207
|
/* Capability #{$capability} is prefixed with #{$prefix} because #{$should-use-prefix} is required. */
|
159
208
|
} @else if $debug-browser-support and type-of($should-use-prefix) == number {
|
160
|
-
/* Capability #{$capability} is prefixed with #{$prefix} because
|
209
|
+
/* Capability #{$capability} is prefixed with #{$prefix} because #{$should-use-prefix}% of users need it which is more than the threshold of #{$threshold}%. */
|
161
210
|
}
|
162
211
|
@include with-prefix($prefix) {
|
163
|
-
@include with-browser-
|
212
|
+
@include with-browser-ranges($capability) {
|
164
213
|
@content;
|
165
214
|
}
|
166
215
|
}
|
216
|
+
} @else if $debug-browser-support {
|
217
|
+
/* Capability #{$capability} is not prefixed with #{$prefix} because #{prefix-usage($prefix, $capability, $capability-options)}% of users are affected which is less than the threshold of #{$threshold}. */
|
167
218
|
}
|
168
219
|
}
|
169
|
-
@
|
170
|
-
@include with-browser-
|
220
|
+
@include with-prefix(null) {
|
221
|
+
@include with-browser-ranges($capability) {
|
171
222
|
@content;
|
172
223
|
}
|
173
|
-
} @else if $debug-browser-support {
|
174
|
-
/* Not including prefix-free content for #{$capability} because the #{$current-prefix} prefix is in scope. */
|
175
224
|
}
|
176
225
|
}
|
177
226
|
|
178
|
-
// Returns true if at least one browser-version pair in $subset-
|
179
|
-
// is a higher (or same) version than the browser-version pairs in
|
180
|
-
|
227
|
+
// Returns true if at least one browser-version pair in $subset-ranges
|
228
|
+
// is a higher (or same) version than the browser-version pairs in
|
229
|
+
// $ranges.
|
230
|
+
@function has-browser-subset($ranges, $subset-ranges) {
|
181
231
|
$found-mismatch: false;
|
182
|
-
@each $browser, $subset-
|
183
|
-
$
|
184
|
-
@if $
|
185
|
-
|
232
|
+
@each $browser, $subset-range in $subset-ranges {
|
233
|
+
$range: map-get($ranges, $browser);
|
234
|
+
@if $range {
|
235
|
+
$min-1: nth($subset-range, 1);
|
236
|
+
$max-1: nth($subset-range, 2);
|
237
|
+
$min-2: nth($range, 1);
|
238
|
+
$max-2: nth($range, 2);
|
239
|
+
@if (compare-browser-versions($browser, $min-2, $min-1) <= 0 and
|
240
|
+
compare-browser-versions($browser, $min-1, $max-2) <= 0) or
|
241
|
+
(compare-browser-versions($browser, $min-2, $max-1) <= 0 and
|
242
|
+
compare-browser-versions($browser, $max-1, $max-2) <= 0) or
|
243
|
+
(compare-browser-versions($browser, $min-1, $min-2) <= 0 and
|
244
|
+
compare-browser-versions($browser, $max-1, $max-2) >= 0) or
|
245
|
+
(compare-browser-versions($browser, $min-1, $min-2) >= 0 and
|
246
|
+
compare-browser-versions($browser, $max-1, $max-2) <= 0) {
|
186
247
|
@return true;
|
187
248
|
} @else {
|
188
249
|
$found-mismatch: true
|
@@ -192,40 +253,53 @@ $css-sel2-support-threshold: $critical-usage-threshold !default;
|
|
192
253
|
@return not $found-mismatch;
|
193
254
|
}
|
194
255
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
256
|
+
// When the same browser is in both maps, then the minimum will be set
|
257
|
+
// to the maximum of the two minimum versions, and the maximum will be
|
258
|
+
// set to the minmum of the two maximum versions.
|
259
|
+
@function intersect-browser-ranges($ranges, $new-ranges) {
|
260
|
+
@each $browser, $new-range in $new-ranges {
|
261
|
+
$old-range: map-get($ranges, $browser);
|
262
|
+
@if $old-range {
|
263
|
+
$old-min: nth($old-range, 1);
|
264
|
+
$old-max: nth($old-range, 2);
|
265
|
+
$new-min: nth($new-range, 1);
|
266
|
+
$new-max: nth($new-range, 2);
|
267
|
+
$maximin: if(compare-browser-versions($browser, $old-min, $new-min) > 0,
|
200
268
|
$old-min, $new-min);
|
201
|
-
$
|
269
|
+
$minimax: if(compare-browser-versions($browser, $old-max, $new-max) < 0,
|
270
|
+
$old-max, $new-max);
|
271
|
+
$ranges: map-merge($ranges, ($browser: $maximin $minimax));
|
202
272
|
} @else {
|
203
|
-
$
|
273
|
+
$ranges: map-merge($ranges, ($browser: $new-range));
|
204
274
|
}
|
205
275
|
}
|
206
|
-
@return $
|
276
|
+
@return $ranges;
|
207
277
|
}
|
208
278
|
|
209
|
-
// If passed a map, that will be the new browser
|
210
|
-
// Otherwise a
|
211
|
-
// using the `browser-
|
279
|
+
// If passed a map, that will be the new browser ranges.
|
280
|
+
// Otherwise a range map will be created based on the given capability and prefix
|
281
|
+
// using the `browser-ranges($capability, $prefix)` function.
|
282
|
+
//
|
283
|
+
// If there are current ranges in scope and the new ranges have some overlap
|
284
|
+
// with the current,
|
212
285
|
//
|
213
|
-
// If there are current minimums in scope and the new minimums have some overlap
|
214
|
-
// with the current, then the minimums will be set to the max version of each browser.
|
215
286
|
// If there is no overlap, then the content will not be rendered.
|
216
|
-
@mixin with-browser-
|
217
|
-
$new-
|
287
|
+
@mixin with-browser-ranges($capability, $prefix: $current-prefix) {
|
288
|
+
$new-ranges: null;
|
218
289
|
@if type-of($capability) == map {
|
219
|
-
$new-
|
290
|
+
$new-ranges: $capability;
|
220
291
|
} @else {
|
221
|
-
$new-
|
292
|
+
$new-ranges: browser-ranges($capability, $prefix);
|
222
293
|
}
|
223
294
|
|
224
|
-
@if has-browser-subset($current-browser-
|
225
|
-
$old-
|
226
|
-
$current-browser-
|
295
|
+
@if has-browser-subset($current-browser-versions, $new-ranges) {
|
296
|
+
$old-ranges: $current-browser-versions;
|
297
|
+
$current-browser-versions: intersect-browser-ranges($old-ranges, $new-ranges) !global;
|
227
298
|
@content;
|
228
|
-
$current-browser-
|
299
|
+
$current-browser-versions: $old-ranges !global;
|
300
|
+
} @else if $debug-browser-support {
|
301
|
+
/* Excluding content because #{inspect($new-ranges)} is not included within
|
302
|
+
#{inspect($current-browser-versions)} */
|
229
303
|
}
|
230
304
|
}
|
231
305
|
|
@@ -54,7 +54,7 @@ $default-box-shadow-inset: null !default;
|
|
54
54
|
$inset : $default-box-shadow-inset
|
55
55
|
) {
|
56
56
|
// Handle legacy argument order
|
57
|
-
@if $hoff
|
57
|
+
@if not ($hoff == none or $hoff == null) and type-of($hoff) != number {
|
58
58
|
@warn "The $color argument for single-box-shadow is now the 5th argument instead of the 1st.";
|
59
59
|
$tmp-color: $color;
|
60
60
|
$color: $hoff;
|
@@ -61,6 +61,14 @@ $flexbox-capability-options: (
|
|
61
61
|
(partial-support: true, spec-versions: 3)
|
62
62
|
);
|
63
63
|
|
64
|
+
// This is the underlying implementation for all the other mixins in this module.
|
65
|
+
// It is the only way to access prefix support for older versions of the spec.
|
66
|
+
//
|
67
|
+
// `$properties`: map of property-value pairs that should be prefixed
|
68
|
+
|
69
|
+
// `$version1: the version of the spec to use when considering what prefix
|
70
|
+
// to appply. Defaults to the most recent (spec version 3). Only the most
|
71
|
+
// recent version of the spec outputs an unprefixed version.
|
64
72
|
@mixin flexbox($properties, $version: null) {
|
65
73
|
$capability-options: $flexbox-capability-options;
|
66
74
|
@if $version {
|
@@ -81,8 +89,9 @@ $flexbox-capability-options: (
|
|
81
89
|
}
|
82
90
|
}
|
83
91
|
|
84
|
-
|
85
|
-
|
92
|
+
// Values for $display are: flex (default), inline-flex
|
93
|
+
@mixin display-flex($display: flex) {
|
94
|
+
@include flexbox((display: $display));
|
86
95
|
}
|
87
96
|
|
88
97
|
// Values: row | row-reverse | column | column-reverse
|
@@ -12,7 +12,7 @@ $inline-block-alignment: middle !default;
|
|
12
12
|
// Provides a cross-browser method to implement `display: inline-block;`
|
13
13
|
@mixin inline-block($alignment: $inline-block-alignment, $ie-alignment: auto) {
|
14
14
|
// legacy support for VERY old firefox
|
15
|
-
@if support-legacy-browser("firefox", "2", $inline-block-support-threshold) {
|
15
|
+
@if support-legacy-browser("firefox", "2", $threshold: $inline-block-support-threshold) {
|
16
16
|
display: -moz-inline-stack;
|
17
17
|
}
|
18
18
|
// standard
|
@@ -21,7 +21,7 @@ $inline-block-alignment: middle !default;
|
|
21
21
|
vertical-align: $alignment;
|
22
22
|
}
|
23
23
|
// legacy IE support
|
24
|
-
@if support-legacy-browser("ie", "7", $inline-block-support-threshold) {
|
24
|
+
@if support-legacy-browser("ie", "7", $threshold: $inline-block-support-threshold) {
|
25
25
|
@if $ie-alignment and $ie-alignment != none {
|
26
26
|
*vertical-align: $ie-alignment;
|
27
27
|
}
|
@@ -10,7 +10,7 @@ $opacity-usage-threshold: $graceful-usage-threshold;
|
|
10
10
|
// A number between 0 and 1, where 0 is transparent and 1 is opaque.
|
11
11
|
|
12
12
|
@mixin opacity($opacity) {
|
13
|
-
@include for-legacy-browser("ie", "8", $opacity-usage-threshold) {
|
13
|
+
@include for-legacy-browser("ie", "8", $threshold: $opacity-usage-threshold) {
|
14
14
|
filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
|
15
15
|
}
|
16
16
|
opacity: $opacity;
|
@@ -57,7 +57,7 @@ $input-placeholder-support-threshold: $graceful-usage-threshold !default;
|
|
57
57
|
}
|
58
58
|
@elseif $current-prefix == -moz {
|
59
59
|
// for Firefox 19 and below
|
60
|
-
@if support-legacy-browser("firefox", "19", $input-placeholder-support-threshold) {
|
60
|
+
@if support-legacy-browser("firefox", "4", "19", $threshold: $input-placeholder-support-threshold) {
|
61
61
|
&:-moz-placeholder { @content; }
|
62
62
|
}
|
63
63
|
// for Firefox 20 and above
|
@@ -46,9 +46,9 @@
|
|
46
46
|
left: $padding;
|
47
47
|
right: $padding;
|
48
48
|
}
|
49
|
-
&:first-child #{if(support-legacy-browser("ie", "6", $css-sel2-support-threshold), ', &.first', '')} { padding-#{$direction}: 0; }
|
49
|
+
&:first-child #{if(support-legacy-browser("ie", "6", $threshold: $css-sel2-support-threshold), ', &.first', '')} { padding-#{$direction}: 0; }
|
50
50
|
&:last-child { padding-#{opposite-position($direction)}: 0; }
|
51
|
-
@if support-legacy-browser("ie", "7", $css-sel2-support-threshold) {
|
51
|
+
@if support-legacy-browser("ie", "7", $threshold: $css-sel2-support-threshold) {
|
52
52
|
&.last { padding-#{opposite-position($direction)}: 0; } }
|
53
53
|
}
|
54
54
|
}
|
@@ -18,7 +18,7 @@ $legacy-float-support-threshold: $critical-usage-threshold !default;
|
|
18
18
|
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
19
19
|
@mixin float($side: left) {
|
20
20
|
float: unquote($side);
|
21
|
-
@if support-legacy-browser("ie", "6", $legacy-float-support-threshold) {
|
21
|
+
@if support-legacy-browser("ie", "6", $threshold: $legacy-float-support-threshold) {
|
22
22
|
display: inline; } }
|
23
23
|
|
24
24
|
// Resets floated elements back to their default of `float: none` and defaults
|
@@ -34,5 +34,5 @@ $legacy-float-support-threshold: $critical-usage-threshold !default;
|
|
34
34
|
// +reset-float
|
35
35
|
@mixin reset-float($display: block) {
|
36
36
|
float: none;
|
37
|
-
@if support-legacy-browser("ie", "6", $legacy-float-support-threshold) {
|
38
|
-
display: $display; } }
|
37
|
+
@if support-legacy-browser("ie", "6", $threshold: $legacy-float-support-threshold) {
|
38
|
+
display: $display; } }
|
@@ -13,7 +13,7 @@ $default-has-layout-approach: zoom !default;
|
|
13
13
|
// to gain the "hasLayout" property in internet explorer.
|
14
14
|
// More information on [hasLayout](http://reference.sitepoint.com/css/haslayout).
|
15
15
|
@mixin has-layout($approach: $default-has-layout-approach) {
|
16
|
-
@if support-legacy-browser("ie", "7", $has-layout-support-threshold) {
|
16
|
+
@if support-legacy-browser("ie", "7", $threshold: $has-layout-support-threshold) {
|
17
17
|
@if $approach == zoom {
|
18
18
|
@include has-layout-zoom;
|
19
19
|
} @else if $approach == block {
|
@@ -26,13 +26,13 @@ $default-has-layout-approach: zoom !default;
|
|
26
26
|
}
|
27
27
|
|
28
28
|
@mixin has-layout-zoom {
|
29
|
-
@if support-legacy-browser("ie", "7", $has-layout-support-threshold) {
|
29
|
+
@if support-legacy-browser("ie", "7", $threshold: $has-layout-support-threshold) {
|
30
30
|
*zoom: 1;
|
31
31
|
}
|
32
32
|
}
|
33
33
|
|
34
34
|
@mixin has-layout-block {
|
35
|
-
@if support-legacy-browser("ie", "7", $has-layout-support-threshold) {
|
35
|
+
@if support-legacy-browser("ie", "7", $threshold: $has-layout-support-threshold) {
|
36
36
|
// This makes ie6 get layout
|
37
37
|
display: inline-block;
|
38
38
|
// and this puts it back to block
|
@@ -48,7 +48,7 @@ $ie6-attribute-hack-support-threshold: $critical-usage-threshold !default;
|
|
48
48
|
// A hack to supply IE6 (and below) with a different property value.
|
49
49
|
// [Read more](http://www.cssportal.com/css-hacks/#in_css-important).
|
50
50
|
@mixin bang-hack($property, $value, $ie6-value) {
|
51
|
-
@if support-legacy-browser("ie", "6", $ie6-attribute-hack-support-threshold) {
|
51
|
+
@if support-legacy-browser("ie", "6", $threshold: $ie6-attribute-hack-support-threshold) {
|
52
52
|
@warn "it's recommended to use the underscore-hack() mixin instead of bang-hack()";
|
53
53
|
#{$property}: #{$value} !important;
|
54
54
|
#{$property}: #{$ie6-value};
|
@@ -58,8 +58,8 @@ $ie6-attribute-hack-support-threshold: $critical-usage-threshold !default;
|
|
58
58
|
// A hack to supply IE6 (and below) with a different property value.
|
59
59
|
// [Read more](http://www.paulirish.com/2009/browser-specific-css-hacks/)
|
60
60
|
@mixin underscore-hack($property, $value, $ie6-value) {
|
61
|
-
@if support-legacy-browser("ie", "6", $ie6-attribute-hack-support-threshold) {
|
61
|
+
@if support-legacy-browser("ie", "6", $threshold: $ie6-attribute-hack-support-threshold) {
|
62
62
|
#{$property}: #{$value};
|
63
63
|
_#{$property}: #{$ie6-value};
|
64
64
|
}
|
65
|
-
}
|
65
|
+
}
|