compass 0.10.6 → 0.11.alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -6
- data/VERSION.yml +3 -3
- data/examples/blueprint_default/parts/forms.html.haml +8 -0
- data/examples/css3/src/main.scss +4 -0
- data/features/command_line.feature +20 -3
- data/features/step_definitions/command_line_steps.rb +7 -1
- data/frameworks/blueprint/stylesheets/_blueprint.scss +2 -12
- data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +34 -34
- data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +32 -28
- data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +3 -3
- data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +2 -2
- data/frameworks/blueprint/stylesheets/blueprint/_form.scss +14 -16
- data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +39 -37
- data/frameworks/blueprint/stylesheets/blueprint/_ie.scss +17 -15
- data/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +53 -44
- data/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +26 -26
- data/frameworks/blueprint/stylesheets/blueprint/_print.scss +13 -20
- data/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +32 -44
- data/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +10 -12
- data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +18 -32
- data/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +50 -25
- data/frameworks/compass/stylesheets/compass/_css3.scss +1 -15
- data/frameworks/compass/stylesheets/compass/_layout.scss +1 -0
- data/frameworks/compass/stylesheets/compass/_support.scss +4 -0
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow-v2.scss +98 -0
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +7 -40
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +0 -1
- data/frameworks/compass/stylesheets/compass/css3/_columns.scss +23 -18
- data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +2 -3
- data/frameworks/compass/stylesheets/compass/css3/_gradient.scss +66 -42
- data/frameworks/compass/stylesheets/compass/css3/_images.scss +52 -0
- data/frameworks/compass/stylesheets/compass/css3/_shared.scss +1 -1
- data/frameworks/compass/stylesheets/compass/css3/_text-shadow-v2.scss +72 -0
- data/frameworks/compass/stylesheets/compass/css3/_transform-v2.scss +584 -0
- data/frameworks/compass/stylesheets/compass/css3/_version-1.scss +16 -0
- data/frameworks/compass/stylesheets/compass/css3/_version-2.scss +16 -0
- data/frameworks/compass/stylesheets/compass/layout/_stretching.scss +24 -0
- data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +4 -4
- data/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +5 -1
- data/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +7 -1
- data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +7 -1
- data/lib/compass/actions.rb +1 -1
- data/lib/compass/app_integration/rails/actionpack3/railtie.rb +18 -0
- data/lib/compass/app_integration/rails/configuration_defaults.rb +22 -0
- data/lib/compass/app_integration/rails/installer.rb +77 -34
- data/lib/compass/app_integration/rails/runtime.rb +3 -0
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +1 -1
- data/lib/compass/commands/print_version.rb +1 -1
- data/lib/compass/commands/update_project.rb +2 -2
- data/lib/compass/commands/write_configuration.rb +10 -1
- data/lib/compass/compiler.rb +1 -5
- data/lib/compass/configuration.rb +2 -1
- data/lib/compass/configuration/adapters.rb +2 -1
- data/lib/compass/configuration/comments.rb +34 -1
- data/lib/compass/configuration/helpers.rb +3 -7
- data/lib/compass/configuration/paths.rb +1 -1
- data/lib/compass/exec/project_options_parser.rb +4 -0
- data/lib/compass/installers/base.rb +1 -1
- data/lib/compass/logger.rb +4 -2
- data/lib/compass/sass_extensions/functions.rb +6 -3
- data/lib/compass/sass_extensions/functions/colors.rb +58 -0
- data/lib/compass/sass_extensions/functions/constants.rb +1 -1
- data/lib/compass/sass_extensions/functions/display.rb +4 -2
- data/lib/compass/sass_extensions/functions/gradient_support.rb +343 -25
- data/lib/compass/sass_extensions/functions/if.rb +9 -0
- data/lib/compass/sass_extensions/functions/inline_image.rb +9 -3
- data/lib/compass/sass_extensions/functions/trig.rb +27 -0
- data/lib/compass/version.rb +6 -1
- data/lib/rails/init.rb +2 -0
- data/test/command_line_test.rb +6 -9
- data/test/compass_test.rb +2 -0
- data/test/configuration_test.rb +20 -0
- data/test/fixtures/stylesheets/blueprint/css/ie.css +16 -0
- data/test/fixtures/stylesheets/blueprint/css/screen.css +37 -34
- data/test/fixtures/stylesheets/blueprint/css/single-imports/colors.css +5 -5
- data/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +7 -5
- data/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +5 -5
- data/test/fixtures/stylesheets/blueprint/css/single-imports/ie.css +16 -0
- data/test/fixtures/stylesheets/blueprint/css/single-imports/interaction.css +12 -9
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset-utilities.css +23 -64
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset.css +13 -37
- data/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +5 -5
- data/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +4 -4
- data/test/fixtures/stylesheets/blueprint/css/single-imports/typography.css +12 -15
- data/test/fixtures/stylesheets/compass/config.rb +2 -0
- data/test/fixtures/stylesheets/compass/css/box.css +6 -13
- data/test/fixtures/stylesheets/compass/css/box_shadow.css +17 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +47 -0
- data/test/fixtures/stylesheets/compass/css/gradients.css +240 -25
- data/test/fixtures/stylesheets/compass/css/lists.css +12 -4
- data/test/fixtures/stylesheets/compass/css/print.css +1 -1
- data/test/fixtures/stylesheets/compass/css/reset.css +2 -2
- data/test/fixtures/stylesheets/compass/css/stretching.css +66 -0
- data/test/fixtures/stylesheets/compass/css/transform.css +305 -0
- data/test/fixtures/stylesheets/compass/sass/box_shadow.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/columns.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +151 -19
- data/test/fixtures/stylesheets/compass/sass/stretching.sass +34 -0
- data/test/fixtures/stylesheets/compass/sass/transform.scss +87 -0
- data/test/sass_extensions_test.rb +44 -0
- metadata +42 -96
- data/frameworks/_blueprint_deprecated_imports/stylesheets/_blueprint.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_buttons.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_colors.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_debug.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_fancy_type.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_form.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_grid.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_ie.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_interaction.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_link_icons.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_liquid.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_print.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_reset.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_rtl.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_scaffolding.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_screen.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_typography.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/_utilities.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_buttons.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_colors.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_debug.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_fancy_type.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_form.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_grid.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_interaction.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_link_icons.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_liquid.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_reset.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_rtl.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_scaffolding.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_typography.sass +0 -2
- data/frameworks/_blueprint_deprecated_imports/stylesheets/blueprint/modules/_utilities.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/_compass.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/_css3.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/_layout.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/_misc.sass +0 -1
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/_misc.scss +0 -22
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/_reset.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/_utilities.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_background_clip.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_background_origin.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_background_size.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_border_radius.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_box_shadow.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_box_sizing.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_columns.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_font_face.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_gradient.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_inline_block.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_opacity.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_text_shadow.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_transform.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/css3/_transition.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/layout/_sticky_footer.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_general.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_links.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_lists.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_print.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_sprites.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_tables.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/_text.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_clearfix.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_float.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_hacks.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_min.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_reset.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_tabs.sass +0 -0
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/general/_tag_cloud.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/links/_hover_link.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/links/_link_colors.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/links/_unstyled_link.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/lists/_bullets.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/lists/_horizontal_list.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/lists/_inline_list.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/sprites/_sprite_img.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/tables/_borders.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/tables/_scaffolding.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/text/_ellipsis.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/text/_nowrap.sass +0 -2
- data/frameworks/_compass_deprecated_imports/stylesheets/compass/utilities/text/_replacement.sass +0 -2
@@ -1,82 +1,106 @@
|
|
1
|
-
@import "
|
1
|
+
@import "compass/utilities/general/hacks";
|
2
|
+
@import "images";
|
2
3
|
|
3
|
-
//
|
4
|
+
// The linear gradient mixin works best across browsers if you use percentage-based color stops.
|
4
5
|
//
|
5
|
-
//
|
6
|
+
// Examples:
|
6
7
|
//
|
7
|
-
// This yields a linear gradient spanning from
|
8
|
+
// // This yields a linear gradient spanning from top to bottom
|
9
|
+
// +linear-gradient(color-stops(white, black))
|
8
10
|
//
|
11
|
+
// // This yields a linear gradient spanning from bottom to top
|
9
12
|
// +linear-gradient(color-stops(white, black), bottom)
|
10
13
|
//
|
11
|
-
// This yields a linear gradient spanning from left to right
|
12
|
-
//
|
14
|
+
// // This yields a linear gradient spanning from left to right
|
13
15
|
// +linear-gradient(color-stops(white, black), left)
|
14
16
|
//
|
15
|
-
// This yields a linear gradient starting at white passing
|
16
|
-
// thru blue at 33% down and then to black
|
17
|
-
//
|
17
|
+
// // This yields a linear gradient starting at white passing
|
18
|
+
// // thru blue at 33% down and then to black
|
18
19
|
// +linear-gradient(color-stops(white, blue 33%, black))
|
19
20
|
//
|
20
|
-
// This yields a linear gradient starting at white passing
|
21
|
-
// thru blue at 33% down and then to black at 67% until the end
|
22
|
-
//
|
21
|
+
// // This yields a linear gradient starting at white passing
|
22
|
+
// // thru blue at 33% down and then to black at 67% until the end
|
23
23
|
// +linear-gradient(color-stops(white, blue 33%, black 67%))
|
24
24
|
//
|
25
|
-
// This yields a
|
26
|
-
//
|
25
|
+
// // This yields a background image on top of the gradient; requires an image
|
26
|
+
// // with an alpha-layer.
|
27
27
|
// +linear-gradient(color_stops(white,black), top, image-url('noise.png'))
|
28
|
+
//
|
28
29
|
// Browsers Supported:
|
29
30
|
//
|
30
31
|
// - Chrome
|
31
32
|
// - Safari
|
32
33
|
// - Firefox 3.6
|
34
|
+
// - Opera
|
33
35
|
|
34
|
-
@mixin linear-gradient($color-stops, $start:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
@
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
@mixin linear-gradient($color-stops, $start: false, $image: false) {
|
37
|
+
@if $image {
|
38
|
+
@if $start {
|
39
|
+
@warn "The linear-gradient mixin is deprecated. Instead use: @include background-image(#{$image}, linear-gradient(#{$start}, #{$color-stops}))";
|
40
|
+
} @else {
|
41
|
+
@warn "The linear-gradient mixin is deprecated. Instead use: @include background-image(#{$image}, linear-gradient(#{$color-stops}))";
|
42
|
+
}
|
43
|
+
} @else {
|
44
|
+
@if $start {
|
45
|
+
@warn "The linear-gradient mixin is deprecated. Instead use: @include background-image(linear-gradient(#{$start}, #{$color-stops}))";
|
46
|
+
} @else {
|
47
|
+
@warn "The linear-gradient mixin is deprecated. Instead use: @include background-image(linear-gradient(#{$color-stops}))";
|
48
|
+
}
|
46
49
|
}
|
47
|
-
|
50
|
+
@if not $start { $start: top; }
|
51
|
+
@include background-image($image, linear-gradient($start, $color-stops));
|
48
52
|
}
|
49
53
|
|
50
|
-
//
|
54
|
+
// Emit a IE-Specific filters that renders a simple linear gradient.
|
55
|
+
// For use in IE 6 - 8. Best practice would have you apply this via a
|
56
|
+
// conditional IE stylesheet, but if you must, you should place this before
|
57
|
+
// any background-image properties that you have specified.
|
58
|
+
@mixin filter-gradient($start-color, $end-color, $orientation: vertical) {
|
59
|
+
@include has-layout;
|
60
|
+
$gradient-type: if($orientation == vertical, 0, 1);
|
61
|
+
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}');
|
62
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}')";
|
63
|
+
}
|
64
|
+
|
65
|
+
// Because of webkit's limitations, the radial gradient mixin works best if you use
|
51
66
|
// pixel-based color stops.
|
52
67
|
//
|
53
68
|
// Examples:
|
54
69
|
//
|
55
70
|
// // Defaults to a centered, 100px radius gradient
|
56
71
|
// +radial-gradient(color-stops(#c00, #00c))
|
72
|
+
//
|
57
73
|
// // 100px radius gradient in the top left corner
|
58
74
|
// +radial-gradient(color-stops(#c00, #00c), top left)
|
75
|
+
//
|
59
76
|
// // Three colors, ending at 50px and passing thru #fff at 25px
|
60
77
|
// +radial-gradient(color-stops(#c00, #fff, #00c 50px))
|
61
|
-
//
|
62
|
-
// //
|
78
|
+
//
|
79
|
+
// // A background image on top of a 100px radius gradient; requires an image
|
80
|
+
// // with an alpha-layer.
|
63
81
|
// +radial-gradient(color_stops(#c00, #fff), top left, image-url("noise.png")))
|
82
|
+
//
|
64
83
|
// Browsers Supported:
|
65
84
|
//
|
66
85
|
// - Chrome
|
67
86
|
// - Safari
|
68
87
|
// - Firefox 3.6
|
88
|
+
// - Opera
|
69
89
|
|
70
|
-
@mixin radial-gradient($color-stops, $center-position:
|
71
|
-
$
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
90
|
+
@mixin radial-gradient($color-stops, $center-position: false, $image: false) {
|
91
|
+
@if $image {
|
92
|
+
@if $center-position {
|
93
|
+
@warn "The radial-gradient mixin is deprecated. Instead use: @include background-image(#{$image}, radial-gradient(#{$center-position}, #{$color-stops}))";
|
94
|
+
} @else {
|
95
|
+
@warn "The radial-gradient mixin is deprecated. Instead use: @include background-image(#{$image}, radial-gradient(#{$color-stops}))";
|
96
|
+
}
|
97
|
+
} @else {
|
98
|
+
@if $center-position {
|
99
|
+
@warn "The radial-gradient mixin is deprecated. Instead use: @include background-image(radial-gradient(#{$center-position}, #{$color-stops}))";
|
100
|
+
} @else {
|
101
|
+
@warn "The radial-gradient mixin is deprecated. Instead use: @include background-image(radial-gradient(#{$color-stops}))";
|
102
|
+
}
|
77
103
|
}
|
78
|
-
@if $
|
79
|
-
|
80
|
-
|
81
|
-
background-image: #{$background}radial-gradient($center-position, circle, $color-stops);
|
82
|
-
}
|
104
|
+
@if not $center-position { $center-position: center center; }
|
105
|
+
@include background-image($image, radial-gradient($center-position, $color-stops));
|
106
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
@import "shared";
|
2
|
+
|
3
|
+
|
4
|
+
@mixin background-image(
|
5
|
+
$image-1,
|
6
|
+
$image-2: false,
|
7
|
+
$image-3: false,
|
8
|
+
$image-4: false,
|
9
|
+
$image-5: false,
|
10
|
+
$image-6: false,
|
11
|
+
$image-7: false,
|
12
|
+
$image-8: false,
|
13
|
+
$image-9: false,
|
14
|
+
$image-10: false
|
15
|
+
) {
|
16
|
+
$images: compact($image-1, $image-2, $image-3, $image-4, $image-5, $image-6, $image-7, $image-8, $image-9, $image-10);
|
17
|
+
|
18
|
+
@if $experimental-support-for-svg and prefixed(-svg, $images) { background-image: -svg($images); }
|
19
|
+
@if $experimental-support-for-webkit and prefixed(-webkit, $images) { background-image: -webkit($images); }
|
20
|
+
@if $experimental-support-for-mozilla and prefixed(-moz, $images) { background-image: -moz($images); }
|
21
|
+
background-image: $images;
|
22
|
+
}
|
23
|
+
|
24
|
+
@mixin border-image($value) {
|
25
|
+
@if $experimental-support-for-mozilla { -moz-border-image: -moz(-compass-list($value)); }
|
26
|
+
@if $experimental-support-for-webkit { -webkit-border-image: -webkit(-compass-list($value)); }
|
27
|
+
@if $experimental-support-for-svg { border-image: -svg(-compass-list($value)); }
|
28
|
+
border-image: $value;
|
29
|
+
}
|
30
|
+
|
31
|
+
@mixin list-style-image($image) {
|
32
|
+
@if $experimental-support-for-mozilla and prefixed(-moz, $image) { list-style-image: -moz($image); }
|
33
|
+
@if $experimental-support-for-webkit and prefixed(-webkit, $image) { list-style-image: -webkit($image); }
|
34
|
+
@if $experimental-support-for-svg and prefixed(-svg, $image) { list-style-image: -svg($image); }
|
35
|
+
list-style-image: $image ;
|
36
|
+
}
|
37
|
+
|
38
|
+
@mixin list-style($value) {
|
39
|
+
$value: -compass-list($value);
|
40
|
+
@if $experimental-support-for-mozilla and prefixed(-moz, $value) { list-style-image: -moz($value); }
|
41
|
+
@if $experimental-support-for-webkit and prefixed(-webkit, $value) { list-style-image: -webkit($value); }
|
42
|
+
@if $experimental-support-for-svg and prefixed(-svg, $value) { list-style-image: -svg($value); }
|
43
|
+
list-style-image: $value ;
|
44
|
+
}
|
45
|
+
|
46
|
+
@mixin content($value) {
|
47
|
+
$value: -compass-list($value);
|
48
|
+
@if $experimental-support-for-mozilla and prefixed(-moz, $value) { content: -moz($value); }
|
49
|
+
@if $experimental-support-for-webkit and prefixed(-webkit, $value) { content: -webkit($value); }
|
50
|
+
@if $experimental-support-for-svg and prefixed(-svg, $value) { content: -svg($value); }
|
51
|
+
content: $value ;
|
52
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
@import "shared";
|
2
|
+
|
3
|
+
// These defaults make the arguments optional for this mixin
|
4
|
+
// If you like, set different defaults in your project
|
5
|
+
|
6
|
+
$default-text-shadow-color: #aaa !default;
|
7
|
+
$default-text-shadow-h-offset: 0px !default;
|
8
|
+
$default-text-shadow-v-offset: 0px !default;
|
9
|
+
$default-text-shadow-blur: 1px !default;
|
10
|
+
|
11
|
+
// Provides CSS text shadows.
|
12
|
+
// Arguments are color, horizontal offset, vertical offset, and blur
|
13
|
+
@mixin single-text-shadow(
|
14
|
+
$color: $default-text-shadow-color,
|
15
|
+
$hoff: $default-text-shadow-h-offset,
|
16
|
+
$voff: $default-text-shadow-v-offset,
|
17
|
+
$blur: $default-text-shadow-blur
|
18
|
+
) {
|
19
|
+
// XXX I'm surprised we don't need experimental support for this property.
|
20
|
+
@if $color == none {
|
21
|
+
text-shadow: none;
|
22
|
+
} @else {
|
23
|
+
text-shadow: $color $hoff $voff $blur;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
// Provides cross-browser text shadows when one or more shadows are needed.
|
28
|
+
@mixin multiple-text-shadows(
|
29
|
+
$shadow-1 : $default-text-shadow-color $default-text-shadow-h-offset $default-text-shadow-v-offset $default-text-shadow-blur,
|
30
|
+
$shadow-2 : false,
|
31
|
+
$shadow-3 : false,
|
32
|
+
$shadow-4 : false,
|
33
|
+
$shadow-5 : false,
|
34
|
+
$shadow-6 : false,
|
35
|
+
$shadow-7 : false,
|
36
|
+
$shadow-8 : false,
|
37
|
+
$shadow-9 : false,
|
38
|
+
$shadow-10: false
|
39
|
+
) {
|
40
|
+
// Ugh. Sass needs variable argument support.
|
41
|
+
$shadow : $shadow-1;
|
42
|
+
@if $shadow-2 { $shadow: $shadow, $shadow-2; }
|
43
|
+
@if $shadow-3 { $shadow: $shadow, $shadow-3; }
|
44
|
+
@if $shadow-4 { $shadow: $shadow, $shadow-4; }
|
45
|
+
@if $shadow-5 { $shadow: $shadow, $shadow-5; }
|
46
|
+
@if $shadow-6 { $shadow: $shadow, $shadow-6; }
|
47
|
+
@if $shadow-7 { $shadow: $shadow, $shadow-7; }
|
48
|
+
@if $shadow-8 { $shadow: $shadow, $shadow-8; }
|
49
|
+
@if $shadow-9 { $shadow: $shadow, $shadow-9; }
|
50
|
+
@if $shadow-10 { $shadow: $shadow, $shadow-10; }
|
51
|
+
// Anticlimactic, we know.
|
52
|
+
text-shadow: $shadow
|
53
|
+
}
|
54
|
+
|
55
|
+
@mixin text-shadow(
|
56
|
+
$shadow-1 : $default-text-shadow-color $default-text-shadow-h-offset $default-text-shadow-v-offset $default-text-shadow-blur,
|
57
|
+
$shadow-2 : false,
|
58
|
+
$shadow-3 : false,
|
59
|
+
$shadow-4 : false,
|
60
|
+
$shadow-5 : false,
|
61
|
+
$shadow-6 : false,
|
62
|
+
$shadow-7 : false,
|
63
|
+
$shadow-8 : false,
|
64
|
+
$shadow-9 : false,
|
65
|
+
$shadow-10: false
|
66
|
+
) {
|
67
|
+
@include multiple-text-shadows(
|
68
|
+
$shadow-1, $shadow-2, $shadow-3,
|
69
|
+
$shadow-4, $shadow-5, $shadow-6,
|
70
|
+
$shadow-7, $shadow-8, $shadow-9, $shadow-10
|
71
|
+
);
|
72
|
+
}
|
@@ -0,0 +1,584 @@
|
|
1
|
+
@import "shared";
|
2
|
+
|
3
|
+
// @doc off
|
4
|
+
// Note ----------------------------------------------------------------------
|
5
|
+
// Safari is the only browser that currently supports 3D transforms.
|
6
|
+
// Because of that it can be important to control whether a given 2D transform
|
7
|
+
// uses the full range of experimental browser prefixes, or only the 3D list.
|
8
|
+
// To make that easy, all 2D transforms include an browser-targeting toggle ($only3d)
|
9
|
+
// to switch between the two support lists. The toggle defaults to 'false' (2D),
|
10
|
+
// and also accepts 'true' (3D). Currently the lists are as follows:
|
11
|
+
// 2D: Mozilla, Webkit, Opera, Official
|
12
|
+
// 3D: Webkit, Official **(Only Safari Supports 3D perspective)**
|
13
|
+
|
14
|
+
// Available Transforms ------------------------------------------------------
|
15
|
+
// - Scale (2d and 3d)
|
16
|
+
// - Rotate (2d and 3d)
|
17
|
+
// - Translate (2d and 3d)
|
18
|
+
// - Skew (2d only)
|
19
|
+
|
20
|
+
// Transform Parameters ------------------------------------------------------
|
21
|
+
// - Transform Origin (2d and 3d)
|
22
|
+
// - Perspective (3d)
|
23
|
+
// - Perspective Origin (3d)
|
24
|
+
// - Transform Style (3d)
|
25
|
+
// - Backface Visibility (3d)
|
26
|
+
|
27
|
+
// Mixins --------------------------------------------------------------------
|
28
|
+
// transform-origin
|
29
|
+
// - shortcuts: transform-origin2d, transform-origin3d
|
30
|
+
// - helpers: apply-origin
|
31
|
+
// transform
|
32
|
+
// - shortcuts: transform2d, transform3d
|
33
|
+
// - helpers: simple-transform, create-transform
|
34
|
+
// perspective
|
35
|
+
// - helpers: perspective-origin
|
36
|
+
// transform-style
|
37
|
+
// backface-visibility
|
38
|
+
// scale
|
39
|
+
// - shortcuts: scaleX, scaleY, scaleZ, scale3d
|
40
|
+
// rotate
|
41
|
+
// - shortcuts: rotateX, rotateY, rotate3d
|
42
|
+
// translate
|
43
|
+
// - shortcuts: translateX, translateY, translateZ, translate3d
|
44
|
+
// skew
|
45
|
+
// - shortcuts: skewX, skewY
|
46
|
+
|
47
|
+
// Defaults ------------------------------------------------------------------
|
48
|
+
// @doc on
|
49
|
+
|
50
|
+
// Transform Origin
|
51
|
+
$default-origin-x : 50% !default;
|
52
|
+
$default-origin-y : 50% !default;
|
53
|
+
$default-origin-z : 50% !default;
|
54
|
+
|
55
|
+
// Scale
|
56
|
+
$default-scale-x : 1.25 !default;
|
57
|
+
$default-scale-y : $default-scale-x !default;
|
58
|
+
$default-scale-z : $default-scale-x !default;
|
59
|
+
|
60
|
+
// Rotate
|
61
|
+
$default-rotate : 45deg !default;
|
62
|
+
|
63
|
+
// Rotate3d
|
64
|
+
$default-vector-x : 1 !default;
|
65
|
+
$default-vector-y : 1 !default;
|
66
|
+
$default-vector-z : 1 !default;
|
67
|
+
|
68
|
+
// Translate
|
69
|
+
$default-translate-x : 1em !default;
|
70
|
+
$default-translate-y : $default-translate-x !default;
|
71
|
+
$default-translate-z : $default-translate-x !default;
|
72
|
+
|
73
|
+
// Skew
|
74
|
+
$default-skew-x : 5deg !default;
|
75
|
+
$default-skew-y : 5deg !default;
|
76
|
+
|
77
|
+
|
78
|
+
// **Transform-origin**
|
79
|
+
// Transform-origin sent as a complete string
|
80
|
+
//
|
81
|
+
// @include apply-origin( origin [, 3D-only ] )
|
82
|
+
//
|
83
|
+
// where 'origin' is a space separated list containing 1-3 (x/y/z) coordinates
|
84
|
+
// in percentages, absolute (px, cm, in, em etc..) or relative
|
85
|
+
// (left, top, right, bottom, center) units
|
86
|
+
//
|
87
|
+
// @param only3d Set this to true to only apply this
|
88
|
+
// mixin where browsers have 3D support.
|
89
|
+
@mixin apply-origin($origin, $only3d) {
|
90
|
+
$only3d: $only3d or -compass-list-size(-compass-list($origin)) > 2;
|
91
|
+
@if $only3d {
|
92
|
+
@include experimental(transform-origin, $origin,
|
93
|
+
not -moz, -webkit, not -o, not -ms, not -khtml, official
|
94
|
+
);
|
95
|
+
} @else {
|
96
|
+
@include experimental(transform-origin, $origin,
|
97
|
+
-moz, -webkit, -o, not -ms, not -khtml, official
|
98
|
+
);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
// Transform-origin sent as individual arguments:
|
103
|
+
//
|
104
|
+
// @include transform-origin( [ origin-x, origin-y, origin-z, 3D-only ] )
|
105
|
+
//
|
106
|
+
// where the 3 'origin-' arguments represent x/y/z coordinates.
|
107
|
+
//
|
108
|
+
// **NOTE:** setting z coordinates triggers 3D support list, leave false for 2D support
|
109
|
+
@mixin transform-origin(
|
110
|
+
$origin-x: $default-origin-x,
|
111
|
+
$origin-y: $default-origin-y,
|
112
|
+
$origin-z: false,
|
113
|
+
$only3d: false
|
114
|
+
) {
|
115
|
+
$origin: unquote('');
|
116
|
+
@if $origin-x or $origin-y or $origin-z {
|
117
|
+
@if $origin-x { $origin: $origin-x; } @else { $origin: 50%; }
|
118
|
+
@if $origin-y { $origin: $origin $origin-y; } @else { @if $origin-z { $origin: $origin 50%; }}
|
119
|
+
@if $origin-z { $origin: $origin $origin-z; }
|
120
|
+
@include apply-origin($origin, $only3d);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
|
125
|
+
// Transform sent as a complete string:
|
126
|
+
//
|
127
|
+
// @include transform( transforms [, 3D-only ] )
|
128
|
+
//
|
129
|
+
// where 'transforms' is a space separated list of all the transforms to be applied
|
130
|
+
@mixin transform(
|
131
|
+
$transform,
|
132
|
+
$only3d: false
|
133
|
+
) {
|
134
|
+
@if $only3d {
|
135
|
+
@include experimental(transform, $transform,
|
136
|
+
not -moz, -webkit, not -o, not -ms, not -khtml, official
|
137
|
+
);
|
138
|
+
} @else {
|
139
|
+
@include experimental(transform, $transform,
|
140
|
+
-moz, -webkit, -o, not -ms, not -khtml, official
|
141
|
+
);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
// Shortcut to target all browsers with 2D transform support
|
146
|
+
@mixin transform2d($trans) {
|
147
|
+
@include transform($trans, false);
|
148
|
+
}
|
149
|
+
|
150
|
+
// Shortcut to target only browsers with 3D transform support
|
151
|
+
@mixin transform3d($trans) {
|
152
|
+
@include transform($trans, true);
|
153
|
+
}
|
154
|
+
|
155
|
+
// @doc off
|
156
|
+
// 3D Parameters -------------------------------------------------------------
|
157
|
+
// @doc on
|
158
|
+
|
159
|
+
// Set the perspective of 3D transforms on the children of an element:
|
160
|
+
//
|
161
|
+
// @include perspective( perspective )
|
162
|
+
//
|
163
|
+
// where 'perspective' is a uniless number representing the depth of the z-axis
|
164
|
+
// the higher the perspective, the more exagerated the foreshortening.
|
165
|
+
// values from 500 to 1000 are more-or-less "normal" - a good starting-point.
|
166
|
+
@mixin perspective($p) {
|
167
|
+
@include experimental(perspective, $p,
|
168
|
+
not -moz, -webkit, not -o, not -ms, not -khtml, official
|
169
|
+
);
|
170
|
+
}
|
171
|
+
|
172
|
+
// Set the origin position for the perspective
|
173
|
+
//
|
174
|
+
// @include perspective-origin(origin-x [origin-y])
|
175
|
+
//
|
176
|
+
// where the two arguments represent x/y coordinates
|
177
|
+
@mixin perspective-origin($origin: 50%) {
|
178
|
+
@include experimental(perspective-origin, $origin,
|
179
|
+
not -moz, -webkit, not -o, not -ms, not -khtml, official
|
180
|
+
);
|
181
|
+
}
|
182
|
+
|
183
|
+
// Determine whether a 3D objects children also live in the given 3D space
|
184
|
+
//
|
185
|
+
// @include transform-style( [ style ] )
|
186
|
+
//
|
187
|
+
// where `style` can be either `flat` or `preserves-3d`
|
188
|
+
// browsers default to `flat`, mixin defaults to `preserves-3d`
|
189
|
+
@mixin transform-style($style: preserves-3d) {
|
190
|
+
@include experimental(perspective-origin, $style,
|
191
|
+
not -moz, -webkit, not -o, not -ms, not -khtml, official
|
192
|
+
);
|
193
|
+
}
|
194
|
+
|
195
|
+
// Determine the visibility of an element when it's back is turned
|
196
|
+
//
|
197
|
+
// @include backface-visibility( [ visibility ] )
|
198
|
+
//
|
199
|
+
// where `visibility` can be either `visible` or `hidden`
|
200
|
+
// browsers default to visible, mixin defaults to hidden
|
201
|
+
@mixin backface-visibility($visibility: hidden) {
|
202
|
+
@include experimental(backface-visibility, $visibility,
|
203
|
+
not -moz, -webkit, not -o, not -ms, not -khtml, official
|
204
|
+
);
|
205
|
+
}
|
206
|
+
|
207
|
+
// @doc off
|
208
|
+
// Transform Partials --------------------------------------------------------
|
209
|
+
// These work well on their own, but they don't add to each other, they override.
|
210
|
+
// Use along with transform parameter mixins to adjust origin, perspective and style
|
211
|
+
// ---------------------------------------------------------------------------
|
212
|
+
|
213
|
+
|
214
|
+
// Scale ---------------------------------------------------------------------
|
215
|
+
// @doc on
|
216
|
+
|
217
|
+
// Scale an object along the x and y axis:
|
218
|
+
//
|
219
|
+
// @include scale( [ scale-x, scale-y, perspective, 3D-only ] )
|
220
|
+
//
|
221
|
+
// where the 'scale-' arguments are unitless multipliers of the x and y dimensions
|
222
|
+
// and perspective, which works the same as the stand-alone perspective property/mixin
|
223
|
+
// but applies to the individual element (multiplied with any parent perspective)
|
224
|
+
//
|
225
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
226
|
+
@mixin scale(
|
227
|
+
$scale-x: $default-scale-x,
|
228
|
+
$scale-y: $scale-x,
|
229
|
+
$perspective: false,
|
230
|
+
$only3d: false
|
231
|
+
) {
|
232
|
+
$trans: scale($scale-x, $scale-y);
|
233
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
234
|
+
@include transform($trans, $only3d);
|
235
|
+
}
|
236
|
+
|
237
|
+
// Scale an object along the x axis
|
238
|
+
// @include scaleX( [ scale-x, perspective, 3D-only ] )
|
239
|
+
//
|
240
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
241
|
+
@mixin scaleX(
|
242
|
+
$scale: $default-scale-x,
|
243
|
+
$perspective: false,
|
244
|
+
$only3d: false
|
245
|
+
) {
|
246
|
+
$trans: scaleX($scale);
|
247
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
248
|
+
@include transform($trans, $only3d);
|
249
|
+
}
|
250
|
+
|
251
|
+
// Scale an object along the y axis
|
252
|
+
// @include scaleY( [ scale-y, perspective, 3D-only ] )
|
253
|
+
//
|
254
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
255
|
+
@mixin scaleY(
|
256
|
+
$scale: $default-scale-y,
|
257
|
+
$perspective: false,
|
258
|
+
$only3d: false
|
259
|
+
) {
|
260
|
+
$trans: scaleY($scale);
|
261
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
262
|
+
@include transform($trans, $only3d);
|
263
|
+
}
|
264
|
+
|
265
|
+
// Scale an object along the z axis
|
266
|
+
// @include scaleZ( [ scale-z, perspective ] )
|
267
|
+
//
|
268
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
269
|
+
@mixin scaleZ(
|
270
|
+
$scale: $default-scale-z,
|
271
|
+
$perspective: false
|
272
|
+
) {
|
273
|
+
$trans: scaleZ($scale);
|
274
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
275
|
+
@include transform3d($trans);
|
276
|
+
}
|
277
|
+
|
278
|
+
// Scale and object along all three axis
|
279
|
+
// @include scale3d( [ scale-x, scale-y, scale-z, perspective ] )
|
280
|
+
//
|
281
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
282
|
+
@mixin scale3d(
|
283
|
+
$scale-x: $default-scale-x,
|
284
|
+
$scale-y: $default-scale-y,
|
285
|
+
$scale-z: $default-scale-z,
|
286
|
+
$perspective: false
|
287
|
+
) {
|
288
|
+
$trans: scale3d($scale-x, $scale-y, $scale-z);
|
289
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
290
|
+
@include transform3d($trans);
|
291
|
+
}
|
292
|
+
|
293
|
+
// @doc off
|
294
|
+
// Rotate --------------------------------------------------------------------
|
295
|
+
// @doc on
|
296
|
+
|
297
|
+
// Rotate an object around the z axis (2D)
|
298
|
+
// @include rotate( [ rotation, perspective, 3D-only ] )
|
299
|
+
// where 'rotation' is an angle set in degrees (deg) or radian (rad) units
|
300
|
+
//
|
301
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
302
|
+
@mixin rotate(
|
303
|
+
$rotate: $default-rotate,
|
304
|
+
$perspective: false,
|
305
|
+
$only3d: false
|
306
|
+
) {
|
307
|
+
$trans: rotate($rotate);
|
308
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
309
|
+
@include transform($trans, $only3d);
|
310
|
+
}
|
311
|
+
|
312
|
+
// A longcut for 'rotate' in case you forget that 'z' is implied
|
313
|
+
//
|
314
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
315
|
+
@mixin rotateZ(
|
316
|
+
$rotate: $default-rotate,
|
317
|
+
$perspective: false,
|
318
|
+
$only3d: false
|
319
|
+
) {
|
320
|
+
@include rotate($rotate, $perspective, $only3d);
|
321
|
+
}
|
322
|
+
|
323
|
+
// Rotate an object around the x axis (3D)
|
324
|
+
// @include rotateX( [ rotation, perspective ] )
|
325
|
+
//
|
326
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
327
|
+
@mixin rotateX(
|
328
|
+
$rotate: $default-rotate,
|
329
|
+
$perspective: false
|
330
|
+
) {
|
331
|
+
$trans: rotateX($rotate);
|
332
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
333
|
+
@include transform3d($trans);
|
334
|
+
}
|
335
|
+
|
336
|
+
// Rotate an object around the y axis (3D)
|
337
|
+
// @include rotate( [ rotation, perspective ] )
|
338
|
+
//
|
339
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
340
|
+
@mixin rotateY(
|
341
|
+
$rotate: $default-rotate,
|
342
|
+
$perspective: false
|
343
|
+
) {
|
344
|
+
$trans: rotateY($rotate);
|
345
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
346
|
+
@include transform3d($trans);
|
347
|
+
}
|
348
|
+
|
349
|
+
// Rotate an object around an arbitrary axis (3D)
|
350
|
+
// @include rotate( [ vector-x, vector-y, vector-z, rotation, perspective ] )
|
351
|
+
// where the 'vector-' arguments accept unitless numbers
|
352
|
+
// these numbers are not important on their own, but in relation to one another
|
353
|
+
// creating an axis from your transform-origin, along the axis of Xx = Yy = Zz
|
354
|
+
//
|
355
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
356
|
+
@mixin rotate3d(
|
357
|
+
$vector-x: $default-vector-x,
|
358
|
+
$vector-y: $default-vector-y,
|
359
|
+
$vector-z: $default-vector-z,
|
360
|
+
$rotate: $default-rotate,
|
361
|
+
$perspective: false
|
362
|
+
) {
|
363
|
+
$trans: rotate3d($vector-x, $vector-y, $vector-z, $rotate);
|
364
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
365
|
+
@include transform3d($trans);
|
366
|
+
}
|
367
|
+
|
368
|
+
// @doc off
|
369
|
+
// Translate -----------------------------------------------------------------
|
370
|
+
// @doc on
|
371
|
+
|
372
|
+
// Move an object along the x or y axis (2D)
|
373
|
+
// @include translate( [ translate-x, translate-y, perspective, 3D-only ] )
|
374
|
+
// where the 'translate-' arguments accept any distance in percentages or absolute (px, cm, in, em etc..) units
|
375
|
+
//
|
376
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
377
|
+
@mixin translate(
|
378
|
+
$translate-x: $default-translate-x,
|
379
|
+
$translate-y: $default-translate-y,
|
380
|
+
$perspective: false,
|
381
|
+
$only3d: false
|
382
|
+
) {
|
383
|
+
$trans: translate($translate-x, $translate-y);
|
384
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
385
|
+
@include transform($trans, $only3d);
|
386
|
+
}
|
387
|
+
|
388
|
+
// Move an object along the x axis (2D)
|
389
|
+
// @include translate( [ translate-x, perspective, 3D-only ] )
|
390
|
+
//
|
391
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
392
|
+
@mixin translateX(
|
393
|
+
$trans-x: $default-translate-x,
|
394
|
+
$perspective: false,
|
395
|
+
$only3d: false
|
396
|
+
) {
|
397
|
+
$trans: translateX($trans-x);
|
398
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
399
|
+
@include transform($trans, $only3d);
|
400
|
+
}
|
401
|
+
|
402
|
+
// Move an object along the y axis (2D)
|
403
|
+
// @include translate( [ translate-y, perspective, 3D-only ] )
|
404
|
+
//
|
405
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
406
|
+
@mixin translateY(
|
407
|
+
$trans-y: $default-translate-y,
|
408
|
+
$perspective: false,
|
409
|
+
$only3d: false
|
410
|
+
) {
|
411
|
+
$trans: translateY($trans-y);
|
412
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
413
|
+
@include transform($trans, $only3d);
|
414
|
+
}
|
415
|
+
|
416
|
+
// Move an object along the z axis (3D)
|
417
|
+
// @include translate( [ translate-z, perspective ] )
|
418
|
+
//
|
419
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
420
|
+
@mixin translateZ(
|
421
|
+
$trans-z: $default-translate-z,
|
422
|
+
$perspective: false
|
423
|
+
) {
|
424
|
+
$trans: translateZ($trans-z);
|
425
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
426
|
+
@include transform3d($trans);
|
427
|
+
}
|
428
|
+
|
429
|
+
// Move an object along the x, y and z axis (3D)
|
430
|
+
// @include translate( [ translate-x, translate-y, translate-z, perspective ] )
|
431
|
+
//
|
432
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
433
|
+
@mixin translate3d(
|
434
|
+
$translate-x: $default-translate-x,
|
435
|
+
$translate-y: $default-translate-y,
|
436
|
+
$translate-z: $default-translate-z,
|
437
|
+
$perspective: false
|
438
|
+
) {
|
439
|
+
$trans: translate3d($translate-x, $translate-y, $translate-z);
|
440
|
+
@if $perspective { $trans: perspective($perspective) $trans; }
|
441
|
+
@include transform3d($trans);
|
442
|
+
}
|
443
|
+
|
444
|
+
// @doc off
|
445
|
+
// Skew ----------------------------------------------------------------------
|
446
|
+
// @doc on
|
447
|
+
|
448
|
+
// Skew an element:
|
449
|
+
//
|
450
|
+
// @include skew( [ skew-x, skew-y, 3D-only ] )
|
451
|
+
//
|
452
|
+
// where the 'skew-' arguments accept css angles in degrees (deg) or radian (rad) units
|
453
|
+
//
|
454
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
455
|
+
@mixin skew(
|
456
|
+
$skew-x: $default-skew-x,
|
457
|
+
$skew-y: $default-skew-y,
|
458
|
+
$only3d: false
|
459
|
+
) {
|
460
|
+
$trans: skew($skew-x, $skew-y);
|
461
|
+
@include transform($trans, $only3d);
|
462
|
+
}
|
463
|
+
|
464
|
+
// Skew an element along the x axiz
|
465
|
+
//
|
466
|
+
// @include skew( [ skew-x, 3D-only ] )
|
467
|
+
//
|
468
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
469
|
+
@mixin skewX(
|
470
|
+
$skew-x: $default-skew-x,
|
471
|
+
$only3d: false
|
472
|
+
) {
|
473
|
+
$trans: skewX($skew-x);
|
474
|
+
@include transform($trans, $only3d);
|
475
|
+
}
|
476
|
+
|
477
|
+
// Skew an element along the y axis
|
478
|
+
//
|
479
|
+
// @include skew( [ skew-y, 3D-only ] )
|
480
|
+
//
|
481
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
482
|
+
@mixin skewY(
|
483
|
+
$skew-y: $default-skew-y,
|
484
|
+
$only3d: false
|
485
|
+
) {
|
486
|
+
$trans: skewY($skew-y);
|
487
|
+
@include transform($trans, $only3d);
|
488
|
+
}
|
489
|
+
|
490
|
+
|
491
|
+
// Full transform mixins
|
492
|
+
// For settings any combination of transforms as arguments
|
493
|
+
// These are complex and not highly recommended for daily use
|
494
|
+
// They are mainly here for backwards-compatability purposes
|
495
|
+
//
|
496
|
+
// * they include origin adjustments
|
497
|
+
// * scale takes a multiplier (unitless), rotate and skew take degrees (deg)
|
498
|
+
//
|
499
|
+
// **Note** This mixin cannot be combined with other transform mixins.
|
500
|
+
@mixin create-transform(
|
501
|
+
$perspective: false,
|
502
|
+
$scale-x: false,
|
503
|
+
$scale-y: false,
|
504
|
+
$scale-z: false,
|
505
|
+
$rotate-x: false,
|
506
|
+
$rotate-y: false,
|
507
|
+
$rotate-z: false,
|
508
|
+
$rotate3d: false,
|
509
|
+
$trans-x: false,
|
510
|
+
$trans-y: false,
|
511
|
+
$trans-z: false,
|
512
|
+
$skew-x: false,
|
513
|
+
$skew-y: false,
|
514
|
+
$origin-x: false,
|
515
|
+
$origin-y: false,
|
516
|
+
$origin-z: false,
|
517
|
+
$only3d: false
|
518
|
+
) {
|
519
|
+
$trans: unquote("");
|
520
|
+
|
521
|
+
// perspective
|
522
|
+
@if $perspective { $trans: perspective($perspective) ; }
|
523
|
+
|
524
|
+
// scale
|
525
|
+
@if $scale-x and $scale-y {
|
526
|
+
@if $scale-z { $trans: $trans scale3d($scale-x, $scale-y, $scale-z); }
|
527
|
+
@else { $trans: $trans scale($scale-x, $scale-y); }
|
528
|
+
} @else {
|
529
|
+
@if $scale-x { $trans: $trans scaleX($scale-x); }
|
530
|
+
@if $scale-y { $trans: $trans scaleY($scale-y); }
|
531
|
+
@if $scale-z { $trans: $trans scaleZ($scale-z); }
|
532
|
+
}
|
533
|
+
|
534
|
+
// rotate
|
535
|
+
@if $rotate-x { $trans: $trans rotateX($rotate-x); }
|
536
|
+
@if $rotate-y { $trans: $trans rotateY($rotate-y); }
|
537
|
+
@if $rotate-z { $trans: $trans rotateZ($rotate-z); }
|
538
|
+
@if $rotate3d { $trans: $trans rotate3d($rotate3d); }
|
539
|
+
|
540
|
+
// translate
|
541
|
+
@if $trans-x and $trans-y {
|
542
|
+
@if $trans-z { $trans: $trans translate3d($trans-x, $trans-y, $trans-z); }
|
543
|
+
@else { $trans: $trans translate($trans-x, $trans-y); }
|
544
|
+
} @else {
|
545
|
+
@if $trans-x { $trans: $trans translateX($trans-x); }
|
546
|
+
@if $trans-y { $trans: $trans translateY($trans-y); }
|
547
|
+
@if $trans-z { $trans: $trans translateZ($trans-z); }
|
548
|
+
}
|
549
|
+
|
550
|
+
// skew
|
551
|
+
@if $skew-x and $skew-y { $trans: $trans skew($skew-x, $skew-y); }
|
552
|
+
@else {
|
553
|
+
@if $skew-x { $trans: $trans skewX($skew-x); }
|
554
|
+
@if $skew-y { $trans: $trans skewY($skew-y); }
|
555
|
+
}
|
556
|
+
|
557
|
+
// apply it!
|
558
|
+
@include transform($trans, $only3d);
|
559
|
+
@include transform-origin($origin-x, $origin-y, $origin-z, $only3d);
|
560
|
+
}
|
561
|
+
|
562
|
+
|
563
|
+
// A simplified set of options
|
564
|
+
// backwards-compatible with the previous version of the 'transform' mixin
|
565
|
+
@mixin simple-transform(
|
566
|
+
$scale: false,
|
567
|
+
$rotate: false,
|
568
|
+
$trans-x: false,
|
569
|
+
$trans-y: false,
|
570
|
+
$skew-x: false,
|
571
|
+
$skew-y: false,
|
572
|
+
$origin-x: false,
|
573
|
+
$origin-y: false
|
574
|
+
) {
|
575
|
+
@include create-transform(
|
576
|
+
false,
|
577
|
+
$scale, $scale, false,
|
578
|
+
false, false, $rotate, false,
|
579
|
+
$trans-x, $trans-y, false,
|
580
|
+
$skew-x, $skew-y,
|
581
|
+
$origin-x, $origin-y, false,
|
582
|
+
false
|
583
|
+
);
|
584
|
+
}
|