compass 0.13.alpha.4 → 0.13.alpha.5
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 +7 -0
- data/README.markdown +2 -3
- data/Rakefile +91 -5
- data/VERSION.yml +1 -1
- data/examples/compass/images/emblem-a043c4f148.png +0 -0
- data/examples/compass/images/flag-03c3b29b35.png +0 -0
- data/examples/compass/images/flag-21cfbfbfc8.png +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/Prociono.otf +0 -0
- data/features/command_line.feature +2 -6
- data/features/step_definitions/command_line_steps.rb +1 -0
- data/frameworks/compass/stylesheets/compass/_css3.scss +0 -1
- data/frameworks/compass/stylesheets/compass/_support.scss +353 -35
- data/frameworks/compass/stylesheets/compass/css3/_animation.scss +49 -48
- data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +4 -8
- data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +15 -19
- data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +17 -19
- data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +4 -8
- data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +37 -39
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +45 -20
- data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +6 -8
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +12 -13
- data/frameworks/compass/stylesheets/compass/css3/_columns.scss +46 -26
- data/frameworks/compass/stylesheets/compass/css3/_deprecated-support.scss +272 -0
- data/frameworks/compass/stylesheets/compass/css3/_filter.scss +17 -10
- data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +134 -281
- data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +5 -5
- data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +14 -11
- data/frameworks/compass/stylesheets/compass/css3/_images.scss +77 -67
- data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +15 -6
- data/frameworks/compass/stylesheets/compass/css3/_opacity.scss +6 -2
- data/frameworks/compass/stylesheets/compass/css3/_pie.scss +1 -73
- data/frameworks/compass/stylesheets/compass/css3/_regions.scss +7 -6
- data/frameworks/compass/stylesheets/compass/css3/_selection.scss +45 -17
- data/frameworks/compass/stylesheets/compass/css3/_shared.scss +4 -261
- data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +1 -1
- data/frameworks/compass/stylesheets/compass/css3/_transform.scss +24 -32
- data/frameworks/compass/stylesheets/compass/css3/_transition.scss +102 -152
- data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +42 -27
- data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +2 -1
- data/frameworks/compass/stylesheets/compass/typography/links/_hover-link.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/typography/text/_ellipsis.scss +1 -1
- data/frameworks/compass/stylesheets/compass/utilities/_sass.scss +2 -0
- data/frameworks/compass/stylesheets/compass/utilities/color/_brightness.scss +12 -0
- data/frameworks/compass/stylesheets/compass/utilities/color/_contrast.scss +36 -12
- data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +6 -2
- data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +23 -4
- data/frameworks/compass/stylesheets/compass/utilities/general/_min.scss +1 -1
- data/frameworks/compass/stylesheets/compass/utilities/sass/_lists.scss +16 -0
- data/frameworks/compass/stylesheets/compass/utilities/sass/_maps.scss +19 -0
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +25 -18
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +3 -1
- data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +3 -3
- data/lib/compass.rb +1 -1
- data/lib/compass/browser_support.rb +1 -1
- data/lib/compass/caniuse.rb +247 -0
- data/lib/compass/configuration/adapters.rb +7 -1
- data/lib/compass/sass_extensions/functions.rb +5 -0
- data/lib/compass/sass_extensions/functions/constants.rb +2 -2
- data/lib/compass/sass_extensions/functions/cross_browser_support.rb +176 -1
- data/lib/compass/sass_extensions/functions/display.rb +24 -19
- data/lib/compass/sass_extensions/functions/env.rb +37 -8
- data/lib/compass/sass_extensions/functions/gradient_support.rb +10 -13
- data/lib/compass/sass_extensions/functions/math.rb +31 -13
- data/lib/compass/sass_extensions/functions/sprites.rb +48 -25
- data/lib/compass/sass_extensions/monkey_patches/browser_support.rb +42 -13
- data/lib/compass/sass_extensions/sprites/image.rb +14 -4
- data/lib/compass/sass_extensions/sprites/image_methods.rb +19 -3
- data/lib/compass/sprite_importer/content.erb +8 -7
- data/lib/compass/watcher/project_watcher.rb +75 -42
- data/lib/compass/watcher/watch.rb +35 -17
- data/test/fixtures/sprites/public/images/focus/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_active.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_focus.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_hover.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_target.png +0 -0
- data/test/fixtures/stylesheets/compass/config.rb +1 -0
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +1 -9
- data/test/fixtures/stylesheets/compass/css/animation.css +1 -9
- data/test/fixtures/stylesheets/compass/css/appearance.css +3 -0
- data/test/fixtures/stylesheets/compass/css/background-clip.css +4 -8
- data/test/fixtures/stylesheets/compass/css/background-origin.css +4 -8
- data/test/fixtures/stylesheets/compass/css/background-size.css +3 -10
- data/test/fixtures/stylesheets/compass/css/border_radius.css +3 -3
- data/test/fixtures/stylesheets/compass/css/{box-sizeing.css → box-sizing.css} +2 -2
- data/test/fixtures/stylesheets/compass/css/box_shadow.css +15 -5
- data/test/fixtures/stylesheets/compass/css/brightness.css +14 -0
- data/test/fixtures/stylesheets/compass/css/browser-support.css +306 -0
- data/test/fixtures/stylesheets/compass/css/color.css +18 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +27 -18
- data/test/fixtures/stylesheets/compass/css/filters.css +6 -6
- data/test/fixtures/stylesheets/compass/css/flexbox.css +84 -111
- data/test/fixtures/stylesheets/compass/css/fonts.css +1 -1
- data/test/fixtures/stylesheets/compass/css/gradients.css +53 -53
- data/test/fixtures/stylesheets/compass/css/grid_background.css +11 -11
- data/test/fixtures/stylesheets/compass/css/hyphenation.css +2 -4
- data/test/fixtures/stylesheets/compass/css/lists.css +6 -12
- data/test/fixtures/stylesheets/compass/css/regions.css +2 -2
- data/test/fixtures/stylesheets/compass/css/selection.css +41 -4
- data/test/fixtures/stylesheets/compass/css/sprites_with_explicit_separator.css +16 -0
- data/test/fixtures/stylesheets/compass/css/support.css +62 -0
- data/test/fixtures/stylesheets/compass/css/transform.css +64 -136
- data/test/fixtures/stylesheets/compass/css/transition.css +27 -45
- data/test/fixtures/stylesheets/compass/css/typography/links/hover-link.css +4 -0
- data/test/fixtures/stylesheets/compass/css/user-interface.css +34 -7
- data/test/fixtures/stylesheets/compass/css/utilities.css +7 -7
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +6 -9
- data/test/fixtures/stylesheets/compass/images/flag_states-sc42d7bf926.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_active.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_focus.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_hover.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_target.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +1 -3
- data/test/fixtures/stylesheets/compass/sass/appearance.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-clip.scss +0 -5
- data/test/fixtures/stylesheets/compass/sass/background-origin.scss +0 -5
- data/test/fixtures/stylesheets/compass/sass/background-size.scss +0 -5
- data/test/fixtures/stylesheets/compass/sass/{box-sizeing.scss → box-sizing.scss} +1 -1
- data/test/fixtures/stylesheets/compass/sass/box_shadow.scss +2 -0
- data/test/fixtures/stylesheets/compass/sass/brightness.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/browser-support.scss +30 -0
- data/test/fixtures/stylesheets/compass/sass/color.scss +22 -0
- data/test/fixtures/stylesheets/compass/sass/filters.scss +1 -0
- data/test/fixtures/stylesheets/compass/sass/flexbox.scss +84 -40
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +3 -2
- data/test/fixtures/stylesheets/compass/sass/selection.scss +29 -4
- data/test/fixtures/stylesheets/compass/sass/sprites_with_explicit_separator.scss +7 -0
- data/test/fixtures/stylesheets/compass/sass/support.scss +137 -0
- data/test/fixtures/stylesheets/compass/sass/transition.scss +0 -3
- data/test/fixtures/stylesheets/compass/sass/typography/links/hover-link.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/user-interface.scss +16 -5
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +4 -4
- data/test/fixtures/stylesheets/envtest/css/env.css +4 -4
- data/test/fixtures/stylesheets/envtest/tmp/env.css +4 -4
- data/test/integrations/sprites_test.rb +30 -1
- data/test/test_helper.rb +2 -2
- data/test/units/caniuse_test.rb +115 -0
- data/test/units/command_line_test.rb +1 -0
- data/test/units/sass_extensions_test.rb +5 -0
- data/test/units/sprites/image_test.rb +12 -0
- data/test/units/sprites/sprite_map_test.rb +11 -0
- data/test/units/watcher/project_watcher_test.rb +26 -18
- metadata +96 -42
- data/examples/compass/src/pie.scss +0 -110
- data/frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss +0 -87
- data/frameworks/compass/templates/pie/LICENSE +0 -12
- data/frameworks/compass/templates/pie/LICENSE-APACHE2.txt +0 -13
- data/frameworks/compass/templates/pie/LICENSE-GPL2.txt +0 -278
- data/frameworks/compass/templates/pie/PIE.htc +0 -96
- data/frameworks/compass/templates/pie/manifest.rb +0 -39
- data/frameworks/compass/templates/pie/pie.scss +0 -74
- data/lib/compass/sass_extensions/functions/utility.rb +0 -10
- data/test/fixtures/stylesheets/compass/css/pie.css +0 -23
- data/test/fixtures/stylesheets/compass/sass/pie.scss +0 -47
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
// they become available in browsers:
|
|
4
4
|
// http://www.w3.org/TR/2000/WD-css3-userint-20000216
|
|
5
5
|
|
|
6
|
-
@import "
|
|
7
|
-
|
|
8
|
-
// @private css3-feature-support variables must always include a list of five boolean values
|
|
9
|
-
// representing in order: -moz, -webkit, -ms, -o, -khtml
|
|
10
|
-
// - mozilla support handled seperately below
|
|
11
|
-
$userselect-support: not -moz, -webkit, -ms, not -o, -khtml;
|
|
6
|
+
@import "compass/support";
|
|
12
7
|
|
|
8
|
+
// The prefixed support threshold for user-select.
|
|
9
|
+
// Defaults to the $graceful-usage-threshold.
|
|
10
|
+
$userselect-support-threshold: $graceful-usage-threshold !default;
|
|
13
11
|
|
|
14
12
|
// This property controls the selection model and granularity of an element.
|
|
15
13
|
//
|
|
@@ -18,39 +16,56 @@ $userselect-support: not -moz, -webkit, -ms, not -o, -khtml;
|
|
|
18
16
|
@mixin user-select($select) {
|
|
19
17
|
$select: unquote($select);
|
|
20
18
|
|
|
21
|
-
@
|
|
22
|
-
|
|
19
|
+
@include with-each-prefix(user-select-none, $userselect-support-threshold) {
|
|
20
|
+
// old Firefox used a proprietary `-moz-none` value, starting with Firefox 21 `none` behaves like `-moz-none`
|
|
21
|
+
// @link https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
|
|
22
|
+
@include prefix-prop(user-select, if($current-prefix == -moz and $select == 'none', -moz-none, $select));
|
|
23
23
|
}
|
|
24
|
-
@include experimental(user-select, $select, $userselect-support...);
|
|
25
24
|
}
|
|
26
25
|
|
|
26
|
+
// The prefixed support threshold for input-placeholder.
|
|
27
|
+
// Defaults to the $graceful-usage-threshold.
|
|
28
|
+
$input-placeholder-support-threshold: $graceful-usage-threshold !default;
|
|
29
|
+
|
|
27
30
|
// Style the html5 input placeholder in browsers that support it.
|
|
28
31
|
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
32
|
+
// The styles for the input placeholder are passed as mixin content
|
|
33
|
+
// and the selector comes from the mixin's context.
|
|
31
34
|
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
+
// For example:
|
|
36
|
+
//
|
|
37
|
+
// #{elements-of-type(text-input)} {
|
|
38
|
+
// @include input-placeholder {
|
|
39
|
+
// color: #bfbfbf;
|
|
40
|
+
// font-style: italic;
|
|
41
|
+
// }
|
|
35
42
|
// }
|
|
36
43
|
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
44
|
+
// if you want to apply the placeholder styles to all elements supporting
|
|
45
|
+
// the `input-placeholder` psuedoclass (beware of performance impacts):
|
|
39
46
|
//
|
|
40
|
-
//
|
|
41
|
-
// @include input-placeholder
|
|
47
|
+
// * {
|
|
48
|
+
// @include input-placeholder {
|
|
42
49
|
// color: #bfbfbf;
|
|
43
50
|
// font-style: italic;
|
|
44
51
|
// }
|
|
45
52
|
// }
|
|
46
|
-
@mixin input-placeholder
|
|
47
|
-
@
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
@mixin input-placeholder {
|
|
54
|
+
@include with-each-prefix(css-placeholder, $input-placeholder-support-threshold) {
|
|
55
|
+
@if $current-prefix == -webkit {
|
|
56
|
+
&::-webkit-input-placeholder { @content; }
|
|
57
|
+
}
|
|
58
|
+
@elseif $current-prefix == -moz {
|
|
59
|
+
// for Firefox 19 and below
|
|
60
|
+
@if support-legacy-browser("firefox", "19", $input-placeholder-support-threshold) {
|
|
61
|
+
&:-moz-placeholder { @content; }
|
|
62
|
+
}
|
|
63
|
+
// for Firefox 20 and above
|
|
64
|
+
&::-moz-placeholder { @content; }
|
|
65
|
+
}
|
|
66
|
+
@elseif $current-prefix == -ms {
|
|
67
|
+
&:-ms-input-placeholder { @content; }
|
|
68
|
+
}
|
|
55
69
|
}
|
|
70
|
+
// This is not standardized yet so no official selector is generated.
|
|
56
71
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import "compass/support";
|
|
1
2
|
@import "compass/layout/grid-background";
|
|
2
3
|
@import "compass/typography/units";
|
|
3
4
|
|
|
@@ -96,7 +97,7 @@ $relative-font-sizing: if($rhythm-unit == px, false, true);
|
|
|
96
97
|
@mixin establish-baseline($font-size: $base-font-size) {
|
|
97
98
|
$relative-size: 100% * ($font-size / $browser-default-font-size);
|
|
98
99
|
|
|
99
|
-
@if
|
|
100
|
+
@if support-legacy-browser(ie, "6") and (not $relative-font-sizing) {
|
|
100
101
|
// IE 6 refuses to resize fonts set in pixels and it weirdly resizes fonts
|
|
101
102
|
// whose root is set in ems. So we set the root font size in percentages of
|
|
102
103
|
// the default font size, even if we are using absolute sizes elsewhere.
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
left: $padding;
|
|
47
47
|
right: $padding;
|
|
48
48
|
}
|
|
49
|
-
&:first-child #{if(
|
|
49
|
+
&:first-child #{if(support-legacy-browser("ie", "6", $css-sel2-support-threshold), ', &.first', '')} { padding-#{$direction}: 0; }
|
|
50
50
|
&:last-child { padding-#{opposite-position($direction)}: 0; }
|
|
51
|
-
@if
|
|
51
|
+
@if support-legacy-browser("ie", "7", $css-sel2-support-threshold) {
|
|
52
52
|
&.last { padding-#{opposite-position($direction)}: 0; } }
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Computes the "brightness" of a color
|
|
2
|
+
//
|
|
3
|
+
// Brightness is similiar to lightness in HSL but more closely approximates
|
|
4
|
+
// how humans perceive the intensity of the different RGB components of
|
|
5
|
+
// a color. Brightness is sometimes called luminance.
|
|
6
|
+
//
|
|
7
|
+
// Returns a number between 0% and 100%, where 100% is fully bright
|
|
8
|
+
// (white) and 0% is fully dark (black).
|
|
9
|
+
@function brightness($color) {
|
|
10
|
+
@return ((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)) / 255 * 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -1,28 +1,52 @@
|
|
|
1
|
+
@import "compass/utilities/color/brightness";
|
|
2
|
+
|
|
1
3
|
$contrasted-dark-default: #000 !default;
|
|
2
4
|
$contrasted-light-default: #fff !default;
|
|
3
|
-
$contrasted-lightness-threshold: 30% !default;
|
|
4
5
|
|
|
5
|
-
// Returns the `$light`
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// Returns either the `$light` or `$dark` color
|
|
7
|
+
// by deciding which contrasts more with `$color`.
|
|
8
|
+
//
|
|
9
|
+
// E.g. This can be used to select the more readable foreground color
|
|
10
|
+
// for a given background color.
|
|
11
|
+
//
|
|
12
|
+
// `$dark` defaults to black and `$light` defaults to white.
|
|
13
|
+
//
|
|
14
|
+
// When `$color` is `null`, this function returns `null`.
|
|
9
15
|
@function contrast-color(
|
|
10
16
|
$color,
|
|
11
17
|
$dark: $contrasted-dark-default,
|
|
12
18
|
$light: $contrasted-light-default,
|
|
13
|
-
$threshold:
|
|
19
|
+
$threshold: null
|
|
14
20
|
) {
|
|
15
|
-
@
|
|
21
|
+
@if $threshold {
|
|
22
|
+
// Deprecated in Compass 0.13
|
|
23
|
+
@warn "The $threshold argment to contrast-color is no longer needed and will be removed in the next release."
|
|
24
|
+
}
|
|
25
|
+
@if $color == null {
|
|
26
|
+
@return null;
|
|
27
|
+
}
|
|
28
|
+
@else {
|
|
29
|
+
$color-brightness: brightness($color);
|
|
30
|
+
$dark-text-brightness: brightness($dark);
|
|
31
|
+
$light-text-brightness: brightness($light);
|
|
32
|
+
|
|
33
|
+
@return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark);
|
|
34
|
+
}
|
|
16
35
|
}
|
|
17
36
|
|
|
18
|
-
// Sets the specified background color and calculates a dark or light
|
|
19
|
-
// The arguments are passed through to the
|
|
37
|
+
// Sets the specified background color and calculates a dark or light
|
|
38
|
+
// contrasted text color. The arguments are passed through to the
|
|
39
|
+
// [contrast-color function](#function-contrast-color).
|
|
20
40
|
@mixin contrasted(
|
|
21
41
|
$background-color,
|
|
22
42
|
$dark: $contrasted-dark-default,
|
|
23
43
|
$light: $contrasted-light-default,
|
|
24
|
-
$threshold:
|
|
44
|
+
$threshold: null
|
|
25
45
|
) {
|
|
46
|
+
@if $threshold {
|
|
47
|
+
// Deprecated in Compass 0.13
|
|
48
|
+
@warn "The $threshold argment to contrasted is no longer needed and will be removed in the next release."
|
|
49
|
+
}
|
|
26
50
|
background-color: $background-color;
|
|
27
|
-
color: contrast-color($background-color, $dark, $light
|
|
28
|
-
}
|
|
51
|
+
color: contrast-color($background-color, $dark, $light);
|
|
52
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@import "compass/support";
|
|
2
2
|
|
|
3
|
+
// The legacy support threshold for float.
|
|
4
|
+
// Defaults to the $critical-usage-threshold.
|
|
5
|
+
$legacy-float-support-threshold: $critical-usage-threshold !default;
|
|
6
|
+
|
|
3
7
|
// Implementation of float:left with fix for the
|
|
4
8
|
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
|
5
9
|
@mixin float-left {
|
|
@@ -14,7 +18,7 @@
|
|
|
14
18
|
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
|
15
19
|
@mixin float($side: left) {
|
|
16
20
|
float: unquote($side);
|
|
17
|
-
@if $legacy-support-
|
|
21
|
+
@if support-legacy-browser("ie", "6", $legacy-float-support-threshold) {
|
|
18
22
|
display: inline; } }
|
|
19
23
|
|
|
20
24
|
// Resets floated elements back to their default of `float: none` and defaults
|
|
@@ -30,5 +34,5 @@
|
|
|
30
34
|
// +reset-float
|
|
31
35
|
@mixin reset-float($display: block) {
|
|
32
36
|
float: none;
|
|
33
|
-
@if $legacy-support-
|
|
37
|
+
@if support-legacy-browser("ie", "6", $legacy-float-support-threshold) {
|
|
34
38
|
display: $display; } }
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
@import "compass/support";
|
|
2
2
|
|
|
3
|
+
// The legacy support threshold for has-layout.
|
|
4
|
+
// Defaults to the $critical-usage-threshold.
|
|
5
|
+
$has-layout-support-threshold: $critical-usage-threshold !default;
|
|
6
|
+
|
|
3
7
|
// The `zoom` approach generates less CSS but does not validate.
|
|
4
8
|
// Set this to `block` to use the display-property to hack the
|
|
5
9
|
// element to gain layout.
|
|
@@ -9,7 +13,7 @@ $default-has-layout-approach: zoom !default;
|
|
|
9
13
|
// to gain the "hasLayout" property in internet explorer.
|
|
10
14
|
// More information on [hasLayout](http://reference.sitepoint.com/css/haslayout).
|
|
11
15
|
@mixin has-layout($approach: $default-has-layout-approach) {
|
|
12
|
-
@if
|
|
16
|
+
@if support-legacy-browser("ie", "7", $has-layout-support-threshold) {
|
|
13
17
|
@if $approach == zoom {
|
|
14
18
|
@include has-layout-zoom;
|
|
15
19
|
} @else if $approach == block {
|
|
@@ -22,13 +26,13 @@ $default-has-layout-approach: zoom !default;
|
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
@mixin has-layout-zoom {
|
|
25
|
-
@if
|
|
29
|
+
@if support-legacy-browser("ie", "7", $has-layout-support-threshold) {
|
|
26
30
|
*zoom: 1;
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
@mixin has-layout-block {
|
|
31
|
-
@if
|
|
35
|
+
@if support-legacy-browser("ie", "7", $has-layout-support-threshold) {
|
|
32
36
|
// This makes ie6 get layout
|
|
33
37
|
display: inline-block;
|
|
34
38
|
// and this puts it back to block
|
|
@@ -36,11 +40,26 @@ $default-has-layout-approach: zoom !default;
|
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
43
|
+
|
|
44
|
+
// The legacy support threshold for IE6 attribute hack.
|
|
45
|
+
// Defaults to the $critical-usage-threshold.
|
|
46
|
+
$ie6-attribute-hack-support-threshold: $critical-usage-threshold !default;
|
|
47
|
+
|
|
39
48
|
// A hack to supply IE6 (and below) with a different property value.
|
|
40
49
|
// [Read more](http://www.cssportal.com/css-hacks/#in_css-important).
|
|
41
50
|
@mixin bang-hack($property, $value, $ie6-value) {
|
|
42
|
-
@if
|
|
51
|
+
@if support-legacy-browser("ie", "6", $ie6-attribute-hack-support-threshold) {
|
|
52
|
+
@warn "it's recommended to use the underscore-hack() mixin instead of bang-hack()";
|
|
43
53
|
#{$property}: #{$value} !important;
|
|
44
54
|
#{$property}: #{$ie6-value};
|
|
45
55
|
}
|
|
46
56
|
}
|
|
57
|
+
|
|
58
|
+
// A hack to supply IE6 (and below) with a different property value.
|
|
59
|
+
// [Read more](http://www.paulirish.com/2009/browser-specific-css-hacks/)
|
|
60
|
+
@mixin underscore-hack($property, $value, $ie6-value) {
|
|
61
|
+
@if support-legacy-browser("ie", "6", $ie6-attribute-hack-support-threshold) {
|
|
62
|
+
#{$property}: #{$value};
|
|
63
|
+
_#{$property}: #{$ie6-value};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@function newline() {
|
|
2
|
+
@return "
|
|
3
|
+
";
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Joins a list into a string with the separator given.
|
|
7
|
+
@function list-join($list, $separator: ", ") {
|
|
8
|
+
$result: "";
|
|
9
|
+
@each $value in $list {
|
|
10
|
+
@if str-length($result) > 0 {
|
|
11
|
+
$result: $result + $separator;
|
|
12
|
+
}
|
|
13
|
+
$result: $result + #{$value};
|
|
14
|
+
}
|
|
15
|
+
@return $result;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Returns true if a $map is a superset of $sub-map.
|
|
2
|
+
@function map-contains-all($map, $sub-map) {
|
|
3
|
+
@each $key, $value in $sub-map {
|
|
4
|
+
@if not (map-has-key($map, $key) and map-get($map, $key) == $value) {
|
|
5
|
+
@return false;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
@return true;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Returns true if a $map has any key-value pair in $sub-map.
|
|
12
|
+
@function map-contains-any($map, $sub-map) {
|
|
13
|
+
@each $key, $value in $sub-map {
|
|
14
|
+
@if map-has-key($map, $key) and map-get($map, $key) == $value {
|
|
15
|
+
@return true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
@return false;
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Determines those states for which you want to enable magic sprite selectors
|
|
2
|
-
$sprite-selectors: hover, target, active !default;
|
|
2
|
+
$sprite-selectors: hover, target, active, focus !default;
|
|
3
3
|
|
|
4
4
|
// Set the width and height of an element to the original
|
|
5
5
|
// dimensions of an image before it was included in the sprite.
|
|
@@ -21,7 +21,10 @@ $use-percentages: false) {
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
// Determines if you want to include magic selectors in your sprites
|
|
24
|
-
$disable-magic-sprite-selectors:false !default;
|
|
24
|
+
$disable-magic-sprite-selectors: false !default;
|
|
25
|
+
|
|
26
|
+
// Set this to underscore if you prefer
|
|
27
|
+
$default-sprite-separator: "-" !default;
|
|
25
28
|
|
|
26
29
|
// Include the position and (optionally) dimensions of this `$sprite`
|
|
27
30
|
// in the given sprite `$map`. The sprite url should come from either a base
|
|
@@ -29,15 +32,17 @@ $disable-magic-sprite-selectors:false !default;
|
|
|
29
32
|
//
|
|
30
33
|
// background: $map no-repeat;
|
|
31
34
|
@mixin sprite($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0,
|
|
32
|
-
$use-percentages: false
|
|
35
|
+
$use-percentages: false,
|
|
36
|
+
$use-magic-selectors: not $disable-magic-sprite-selectors,
|
|
37
|
+
$separator: $default-sprite-separator) {
|
|
33
38
|
@include sprite-background-position($map, $sprite, $offset-x, $offset-y,
|
|
34
|
-
|
|
39
|
+
$use-percentages);
|
|
35
40
|
@if $dimensions {
|
|
36
41
|
@include sprite-dimensions($map, $sprite);
|
|
37
42
|
}
|
|
38
|
-
@if
|
|
43
|
+
@if $use-magic-selectors {
|
|
39
44
|
@include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y,
|
|
40
|
-
|
|
45
|
+
$use-percentages, $separator);
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
|
|
@@ -45,14 +50,15 @@ $use-percentages: false) {
|
|
|
45
50
|
// `$full-sprite-name`
|
|
46
51
|
// @private
|
|
47
52
|
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0,
|
|
48
|
-
$offset-y: 0, $use-percentages: false
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
$
|
|
53
|
+
$offset-y: 0, $use-percentages: false,
|
|
54
|
+
$separator: $default-sprite-separator) {
|
|
55
|
+
@each $state in $sprite-selectors {
|
|
56
|
+
$sprite-class: "#{$full-sprite-name}#{$separator}#{$state}";
|
|
57
|
+
@if sprite_has_selector($map, $sprite-name, $state) {
|
|
58
|
+
@if sprite_has_valid_selector($sprite-class) {
|
|
59
|
+
&:#{$state}, &.#{$sprite-class} {
|
|
60
|
+
@include sprite-background-position($map, sprite_selector_file($map, $sprite-name, $state),
|
|
61
|
+
$offset-x, $offset-y, $use-percentages);
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
}
|
|
@@ -68,16 +74,17 @@ $offset-y: 0, $use-percentages: false) {
|
|
|
68
74
|
// Positions are returned in pixel units. Set `$use_percentages` to true to
|
|
69
75
|
// instead get percentages.
|
|
70
76
|
@mixin sprites($map, $sprite-names, $base-class: false, $dimensions: false,
|
|
71
|
-
$prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0,
|
|
72
|
-
false
|
|
77
|
+
$prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0,
|
|
78
|
+
$use-percentages: false,
|
|
79
|
+
$separator: $default-sprite-separator) {
|
|
73
80
|
@each $sprite-name in $sprite-names {
|
|
74
81
|
@if sprite_does_not_have_parent($map, $sprite-name) {
|
|
75
|
-
$full-sprite-name: "#{$prefix}
|
|
82
|
+
$full-sprite-name: "#{$prefix}#{$separator}#{$sprite-name}";
|
|
76
83
|
@if sprite_has_valid_selector($full-sprite-name) {
|
|
77
84
|
.#{$full-sprite-name} {
|
|
78
85
|
@if $base-class { @extend #{$base-class}; }
|
|
79
86
|
@include sprite($map, $sprite-name, $dimensions, $offset-x, $offset-y,
|
|
80
|
-
|
|
87
|
+
$use-percentages, $separator: $separator);
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
}
|