compass 0.12.7 → 0.13.alpha.4
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.
- data/README.markdown +1 -1
- data/Rakefile +14 -9
- data/VERSION.yml +6 -0
- data/features/command_line.feature +8 -50
- data/features/step_definitions/command_line_steps.rb +3 -2
- data/frameworks/compass/stylesheets/compass/_css3.scss +2 -0
- data/frameworks/compass/stylesheets/compass/_support.scss +4 -4
- data/frameworks/compass/stylesheets/compass/css3/_animation.scss +121 -0
- data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +10 -6
- data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +32 -36
- data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +32 -35
- data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +12 -15
- data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +27 -48
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +22 -35
- data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +12 -8
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +57 -82
- data/frameworks/compass/stylesheets/compass/css3/_columns.scss +104 -71
- data/frameworks/compass/stylesheets/compass/css3/_filter.scss +38 -18
- data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +294 -0
- data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +4 -4
- data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +13 -22
- data/frameworks/compass/stylesheets/compass/css3/_images.scss +45 -48
- data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +1 -1
- data/frameworks/compass/stylesheets/compass/css3/_regions.scss +12 -8
- data/frameworks/compass/stylesheets/compass/css3/_selection.scss +31 -0
- data/frameworks/compass/stylesheets/compass/css3/_shared.scss +226 -2
- data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +21 -26
- data/frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss +3 -3
- data/frameworks/compass/stylesheets/compass/css3/_transform.scss +8 -8
- data/frameworks/compass/stylesheets/compass/css3/_transition.scss +3 -3
- data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +43 -4
- data/frameworks/compass/stylesheets/compass/typography/_units.scss +152 -0
- data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +180 -102
- data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +5 -3
- data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +6 -3
- data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +1 -1
- data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +7 -3
- data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +2 -2
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +32 -13
- data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +14 -9
- data/lib/compass/actions.rb +3 -1
- data/lib/compass/commands/update_project.rb +1 -2
- data/lib/compass/commands/watch_project.rb +11 -113
- data/lib/compass/commands.rb +1 -1
- data/lib/compass/compiler.rb +8 -1
- data/lib/compass/configuration/data.rb +1 -1
- data/lib/compass/configuration/helpers.rb +2 -0
- data/lib/compass/exec/project_options_parser.rb +8 -0
- data/lib/compass/logger.rb +2 -0
- data/lib/compass/sass_extensions/functions/cross_browser_support.rb +1 -1
- data/lib/compass/sass_extensions/functions/env.rb +18 -0
- data/lib/compass/sass_extensions/functions/gradient_support.rb +101 -29
- data/lib/compass/sass_extensions/functions/image_size.rb +2 -1
- data/lib/compass/sass_extensions/functions/math.rb +13 -1
- data/lib/compass/sass_extensions/functions/sprites.rb +82 -22
- data/lib/compass/sass_extensions/functions/urls.rb +37 -6
- data/lib/compass/sass_extensions/functions/utility.rb +10 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +11 -9
- data/lib/compass/sass_extensions/sprites/image.rb +7 -2
- data/lib/compass/sass_extensions/sprites/image_methods.rb +5 -1
- data/lib/compass/sass_extensions/sprites/images.rb +29 -0
- data/lib/compass/sass_extensions/sprites/layout/diagonal.rb +42 -0
- data/lib/compass/sass_extensions/sprites/layout/horizontal.rb +66 -0
- data/lib/compass/sass_extensions/sprites/layout/smart.rb +33 -0
- data/lib/compass/sass_extensions/sprites/layout/vertical.rb +68 -0
- data/lib/compass/sass_extensions/sprites/layout.rb +39 -0
- data/lib/compass/sass_extensions/sprites/layout_methods.rb +9 -115
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +5 -1
- data/lib/compass/sass_extensions/sprites/sprite_methods.rb +8 -14
- data/lib/compass/sass_extensions/sprites.rb +2 -0
- data/lib/compass/sprite_importer/content.erb +29 -24
- data/lib/compass/sprite_importer.rb +7 -11
- data/lib/compass/version.rb +10 -13
- data/lib/compass/watcher/compiler.rb +59 -0
- data/lib/compass/watcher/project_watcher.rb +111 -0
- data/lib/compass/watcher/watch.rb +33 -0
- data/lib/compass/watcher.rb +11 -0
- data/lib/compass.rb +2 -2
- data/test/fixtures/sprites/public/images/numeric/200.png +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
- data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +7 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/feed.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/grid.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/sub/dk.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/sass/screen.sass +11 -0
- data/test/fixtures/stylesheets/busted_font_urls/tmp/screen.css +7 -0
- data/test/fixtures/stylesheets/busted_image_urls/tmp/screen.css +9 -0
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +33 -0
- data/test/fixtures/stylesheets/compass/css/animation.css +33 -0
- data/test/fixtures/stylesheets/compass/css/background-clip.css +5 -0
- data/test/fixtures/stylesheets/compass/css/background-origin.css +15 -0
- data/test/fixtures/stylesheets/compass/css/background-size.css +24 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +27 -63
- data/test/fixtures/stylesheets/compass/css/flexbox.css +121 -0
- data/test/fixtures/stylesheets/compass/css/fonts.css +1 -1
- data/test/fixtures/stylesheets/compass/css/gradients.css +64 -36
- data/test/fixtures/stylesheets/compass/css/grid_background.css +7 -14
- data/test/fixtures/stylesheets/compass/css/hyphenation.css +4 -2
- data/test/fixtures/stylesheets/compass/css/lists.css +5 -5
- data/test/fixtures/stylesheets/compass/css/pie.css +0 -3
- data/test/fixtures/stylesheets/compass/css/regions.css +4 -2
- data/test/fixtures/stylesheets/compass/css/selection.css +13 -0
- data/test/fixtures/stylesheets/compass/css/sprites.css +251 -250
- data/test/fixtures/stylesheets/compass/css/text_shadow.css +6 -6
- data/test/fixtures/stylesheets/compass/css/transition.css +6 -0
- data/test/fixtures/stylesheets/compass/css/units.css +30 -0
- data/test/fixtures/stylesheets/compass/css/user-interface.css +22 -1
- data/test/fixtures/stylesheets/compass/css/utilities.css +15 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +177 -8
- data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +19 -0
- data/test/fixtures/stylesheets/compass/sass/animation.scss +13 -0
- data/test/fixtures/stylesheets/compass/sass/background-clip.scss +4 -2
- data/test/fixtures/stylesheets/compass/sass/background-origin.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/background-size.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/columns.scss +9 -9
- data/test/fixtures/stylesheets/compass/sass/flexbox.scss +44 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +31 -0
- data/test/fixtures/stylesheets/compass/sass/selection.scss +13 -0
- data/test/fixtures/stylesheets/compass/sass/transition.scss +1 -1
- data/test/fixtures/stylesheets/compass/sass/units.scss +45 -0
- data/test/fixtures/stylesheets/compass/sass/user-interface.scss +13 -1
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +208 -7
- data/test/fixtures/stylesheets/envtest/css/env.css +8 -0
- data/test/fixtures/stylesheets/envtest/sass/env.scss +16 -0
- data/test/fixtures/stylesheets/envtest/tmp/env.css +14 -0
- data/test/fixtures/stylesheets/valid/css/simple.css +4 -0
- data/test/helpers/diff.rb +1 -1
- data/test/integrations/compass_test.rb +23 -14
- data/test/integrations/sprites_test.rb +305 -63
- data/test/test_helper.rb +5 -15
- data/test/units/command_line_test.rb +0 -2
- data/test/units/compass_module_test.rb +1 -1
- data/test/units/configuration_test.rb +12 -0
- data/test/units/regressions_test.rb +8 -8
- data/test/units/sass_extensions_test.rb +2 -0
- data/test/units/sass_extenstions/gradients_test.rb +33 -0
- data/test/units/sprites/image_test.rb +5 -0
- data/test/units/sprites/images_test.rb +46 -0
- data/test/units/sprites/layout_test.rb +29 -4
- data/test/units/watcher/compiler_test.rb +39 -0
- data/test/units/watcher/project_watcher_test.rb +73 -0
- data/test/units/watcher/watch_test.rb +42 -0
- metadata +171 -236
- checksums.yaml +0 -7
- data/frameworks/blueprint/stylesheets/_blueprint.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +0 -101
- data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +0 -36
- data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +0 -28
- data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +0 -88
- data/frameworks/blueprint/stylesheets/blueprint/_form.scss +0 -66
- data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +0 -258
- data/frameworks/blueprint/stylesheets/blueprint/_ie.scss +0 -111
- data/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +0 -66
- data/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +0 -152
- data/frameworks/blueprint/stylesheets/blueprint/_print.scss +0 -86
- data/frameworks/blueprint/stylesheets/blueprint/_reset.scss +0 -3
- data/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +0 -121
- data/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +0 -52
- data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +0 -90
- data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +0 -83
- data/frameworks/blueprint/templates/basic/grid.png +0 -0
- data/frameworks/blueprint/templates/basic/ie.sass +0 -4
- data/frameworks/blueprint/templates/basic/manifest.rb +0 -30
- data/frameworks/blueprint/templates/basic/partials/_base.sass +0 -10
- data/frameworks/blueprint/templates/basic/print.sass +0 -4
- data/frameworks/blueprint/templates/basic/screen.sass +0 -12
- data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons.sass +0 -49
- data/frameworks/blueprint/templates/buttons/manifest.rb +0 -17
- data/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons.sass +0 -13
- data/frameworks/blueprint/templates/link_icons/manifest.rb +0 -23
- data/frameworks/blueprint/templates/project/grid.png +0 -0
- data/frameworks/blueprint/templates/project/ie.sass +0 -16
- data/frameworks/blueprint/templates/project/manifest.rb +0 -30
- data/frameworks/blueprint/templates/project/partials/_base.sass +0 -11
- data/frameworks/blueprint/templates/project/print.sass +0 -8
- data/frameworks/blueprint/templates/project/screen.sass +0 -46
- data/frameworks/blueprint/templates/semantic/grid.png +0 -0
- data/frameworks/blueprint/templates/semantic/ie.sass +0 -16
- data/frameworks/blueprint/templates/semantic/manifest.rb +0 -33
- data/frameworks/blueprint/templates/semantic/partials/_base.sass +0 -10
- data/frameworks/blueprint/templates/semantic/partials/_form.sass +0 -6
- data/frameworks/blueprint/templates/semantic/partials/_page.sass +0 -17
- data/frameworks/blueprint/templates/semantic/partials/_two_col.sass +0 -38
- data/frameworks/blueprint/templates/semantic/print.sass +0 -5
- data/frameworks/blueprint/templates/semantic/screen.sass +0 -14
- data/lib/compass/commands/generate_grid_background.rb +0 -96
- data/lib/compass/grid_builder.rb +0 -102
- data/test/fixtures/stylesheets/blueprint/config.rb +0 -14
- data/test/fixtures/stylesheets/blueprint/css/ie.css +0 -76
- data/test/fixtures/stylesheets/blueprint/css/print.css +0 -56
- data/test/fixtures/stylesheets/blueprint/css/screen.css +0 -815
- data/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css +0 -56
- data/test/fixtures/stylesheets/blueprint/css/single-imports/colors.css +0 -80
- data/test/fixtures/stylesheets/blueprint/css/single-imports/debug.css +0 -11
- data/test/fixtures/stylesheets/blueprint/css/single-imports/fancy-type.css +0 -30
- data/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +0 -42
- data/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +0 -435
- data/test/fixtures/stylesheets/blueprint/css/single-imports/ie.css +0 -76
- data/test/fixtures/stylesheets/blueprint/css/single-imports/interaction.css +0 -46
- data/test/fixtures/stylesheets/blueprint/css/single-imports/link-icons.css +0 -40
- data/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css +0 -651
- data/test/fixtures/stylesheets/blueprint/css/single-imports/print.css +0 -60
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset-utilities.css +0 -75
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset.css +0 -42
- data/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +0 -437
- data/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +0 -45
- data/test/fixtures/stylesheets/blueprint/css/single-imports/typography.css +0 -146
- data/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +0 -35
- data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/doc.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/email.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/external.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/feed.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/im.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/pdf.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/visited.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/xls.png +0 -0
- data/test/fixtures/stylesheets/blueprint/sass/ie.sass +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/print.sass +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +0 -18
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/buttons.scss +0 -4
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/colors.scss +0 -34
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/debug.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/fancy-type.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/form.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/grid.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/ie.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/interaction.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/link-icons.scss +0 -13
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/liquid.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/print.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset-utilities.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset.scss +0 -1
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/rtl.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss +0 -3
- data/test/fixtures/stylesheets/compass/images/flag-s4798b5a210.png +0 -0
- data/test/units/compass_png_test.rb +0 -46
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
@import "compass/layout/grid-background";
|
|
2
|
+
@import "compass/typography/units";
|
|
2
3
|
|
|
3
|
-
// The
|
|
4
|
+
// The default font size for all text in pixels
|
|
4
5
|
$base-font-size: 16px !default;
|
|
5
6
|
|
|
6
|
-
// The
|
|
7
|
+
// The distance between text baselines (vertical rhythm) in pixels.
|
|
7
8
|
$base-line-height: 24px !default;
|
|
8
9
|
|
|
9
|
-
//
|
|
10
|
-
|
|
10
|
+
// The length unit in which to output rhythm values.
|
|
11
|
+
// Supported values: px, em, rem. Percent units can't be used since they
|
|
12
|
+
// make calculating padding and margins impractical, and percentage borders are
|
|
13
|
+
// not valid or supported in css.
|
|
14
|
+
$rhythm-unit: 'em' !default;
|
|
11
15
|
|
|
12
|
-
//
|
|
13
|
-
$
|
|
16
|
+
// Whether to output fallback values in px when using rem as the rhythm-unit.
|
|
17
|
+
$rem-with-px-fallback: true !default;
|
|
14
18
|
|
|
15
|
-
//
|
|
16
|
-
|
|
19
|
+
// Default values for rhythm borders properties.
|
|
20
|
+
// Supports style alone eg. `solid` or list of style and color eg. `solid #aaa`;
|
|
21
|
+
$default-rhythm-border-width: 1px !default;
|
|
22
|
+
$default-rhythm-border-style: solid !default;
|
|
17
23
|
|
|
18
24
|
// Allows the `adjust-font-size-to` mixin and the `lines-for-font-size` function
|
|
19
25
|
// to round the line height to the nearest half line height instead of the
|
|
@@ -24,66 +30,113 @@ $round-to-nearest-half-line: false !default;
|
|
|
24
30
|
// of vertical padding above and below the text.
|
|
25
31
|
$min-line-padding: 2px !default;
|
|
26
32
|
|
|
27
|
-
// $base-font-size but in your output unit of choice.
|
|
28
|
-
// Defaults to 1em when `$relative-font-sizing` is true.
|
|
29
|
-
$font-unit: if($relative-font-sizing, 1em, $base-font-size) !default;
|
|
30
|
-
|
|
31
|
-
// The basic unit of font rhythm.
|
|
32
|
-
$base-rhythm-unit: $base-line-height / $base-font-size * $font-unit;
|
|
33
|
-
|
|
34
33
|
// The leader is the amount of whitespace in a line.
|
|
35
34
|
// It might be useful in your calculations.
|
|
36
|
-
$base-leader: ($base-line-height - $base-font-size
|
|
35
|
+
$base-leader: convert-length($base-line-height - $base-font-size, $rhythm-unit, $base-font-size);
|
|
37
36
|
|
|
38
37
|
// The half-leader is the amount of whitespace above and below a line.
|
|
39
38
|
// It might be useful in your calculations.
|
|
40
39
|
$base-half-leader: $base-leader / 2;
|
|
41
40
|
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
// @private Whether the rhythm output is in absolute units (px) or not (em, rem)
|
|
42
|
+
$relative-font-sizing: if($rhythm-unit == px, false, true);
|
|
43
|
+
|
|
44
|
+
// Validate units
|
|
45
|
+
@if unit($base-font-size) != 'px' { @warn "$base-font-size must resolve to a pixel unit."; }
|
|
46
|
+
@if unit($base-line-height) != 'px' { @warn "$base-line-height must resolve to a pixel unit."; }
|
|
47
|
+
@if $rhythm-unit != 'px' and $rhythm-unit != 'em' and $rhythm-unit != 'rem' {
|
|
48
|
+
@warn "$rhythm-unit must be `px`, `em` or `rem`.";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// Calculate rhythm units.
|
|
53
|
+
@function rhythm($lines: 1, $font-size: $base-font-size, $offset: 0) {
|
|
54
|
+
$rhythm: convert-length($lines * $base-line-height - $offset, $rhythm-unit, $font-size);
|
|
55
|
+
@if unit($rhythm) == px {
|
|
56
|
+
$rhythm: floor($rhythm);
|
|
57
|
+
}
|
|
58
|
+
@return $rhythm;
|
|
45
59
|
}
|
|
46
60
|
|
|
47
|
-
//
|
|
48
|
-
@function
|
|
49
|
-
|
|
61
|
+
// Calculate the minimum multiple of rhythm units needed to contain the font-size.
|
|
62
|
+
@function lines-for-font-size($font-size) {
|
|
63
|
+
$lines: if($round-to-nearest-half-line,
|
|
64
|
+
ceil(2 * $font-size / $base-line-height) / 2,
|
|
65
|
+
ceil($font-size / $base-line-height));
|
|
66
|
+
// If lines are cramped include some extra lead.
|
|
67
|
+
@if ($lines * $base-line-height - $font-size) < ($min-line-padding * 2) {
|
|
68
|
+
$lines: $lines + if($round-to-nearest-half-line, 0.5, 1);
|
|
69
|
+
}
|
|
70
|
+
@return $lines;
|
|
50
71
|
}
|
|
51
72
|
|
|
52
|
-
|
|
53
|
-
|
|
73
|
+
|
|
74
|
+
// @private Outputs rhythm values. For rem units, outputs pixel fallbacks
|
|
75
|
+
// by default.
|
|
76
|
+
@mixin output-rhythm($property, $values) {
|
|
77
|
+
@if $rhythm-unit == rem and $rem-with-px-fallback {
|
|
78
|
+
@include rem($property, $values);
|
|
79
|
+
}
|
|
80
|
+
@else {
|
|
81
|
+
$output: ();
|
|
82
|
+
@each $value in $values {
|
|
83
|
+
@if unit($value) == px {
|
|
84
|
+
// Ensure all pixel values are rounded to the nearest pixel.
|
|
85
|
+
$output: join($output, round($value));
|
|
86
|
+
}
|
|
87
|
+
@else {
|
|
88
|
+
$output: join($output, $value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
#{$property}: $output;
|
|
92
|
+
}
|
|
54
93
|
}
|
|
55
94
|
|
|
56
95
|
// Establishes a font baseline for the given font-size.
|
|
57
96
|
@mixin establish-baseline($font-size: $base-font-size) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
97
|
+
$relative-size: 100% * ($font-size / $browser-default-font-size);
|
|
98
|
+
|
|
99
|
+
@if $legacy-support-for-ie6 and (not $relative-font-sizing) {
|
|
100
|
+
// IE 6 refuses to resize fonts set in pixels and it weirdly resizes fonts
|
|
101
|
+
// whose root is set in ems. So we set the root font size in percentages of
|
|
102
|
+
// the default font size, even if we are using absolute sizes elsewhere.
|
|
103
|
+
* html { font-size: $relative-size; }
|
|
63
104
|
}
|
|
64
105
|
html {
|
|
65
|
-
font-size: $font-size;
|
|
66
|
-
|
|
106
|
+
font-size: if($relative-font-sizing, $relative-size, $font-size);
|
|
107
|
+
|
|
108
|
+
// Webkit has a bug that prevents line-height being set in rem on <html>;
|
|
109
|
+
// To work around this and simplify output, we can set initial line-height
|
|
110
|
+
// in ems for all relative rhythm units, even when $rhythm-unit is `rem`.
|
|
111
|
+
@if $relative-font-sizing {
|
|
112
|
+
line-height: convert-length($base-line-height, em);
|
|
113
|
+
}
|
|
114
|
+
@else {
|
|
115
|
+
line-height: round($base-line-height);
|
|
116
|
+
}
|
|
67
117
|
}
|
|
68
118
|
}
|
|
69
119
|
|
|
70
|
-
// Resets the
|
|
120
|
+
// Resets the baseline to 1 rhythm unit
|
|
71
121
|
// Does not work on elements whose font-size is different from $base-font-size.
|
|
72
122
|
//
|
|
73
123
|
// @deprecated This mixin will be removed in the next release.
|
|
74
|
-
// Please use
|
|
75
|
-
@mixin reset-baseline {
|
|
76
|
-
@include adjust-leading-to(1,
|
|
124
|
+
// Please use `adjust-leading-to(1)` instead.
|
|
125
|
+
@mixin reset-baseline($font-size: $base-font-size) {
|
|
126
|
+
@include adjust-leading-to(1, $font-size);
|
|
77
127
|
}
|
|
78
128
|
|
|
79
129
|
// Show a background image that can be used to debug your alignments.
|
|
130
|
+
// As this is a development feature, this mixin never outputs pixel fallbacks
|
|
131
|
+
// for rem output.
|
|
80
132
|
// Include the $img argument if you would rather use your own image than the
|
|
81
133
|
// Compass default gradient image.
|
|
82
134
|
@mixin debug-vertical-alignment($img: false) {
|
|
83
135
|
@if $img {
|
|
84
136
|
background: image-url($img);
|
|
85
|
-
}
|
|
86
|
-
|
|
137
|
+
}
|
|
138
|
+
@else {
|
|
139
|
+
@include baseline-grid-background(rhythm());
|
|
87
140
|
}
|
|
88
141
|
}
|
|
89
142
|
|
|
@@ -92,12 +145,13 @@ $base-half-leader: $base-leader / 2;
|
|
|
92
145
|
// of this font should use up. It does not have to be an integer, but it
|
|
93
146
|
// defaults to the smallest integer that is large enough to fit the font.
|
|
94
147
|
// Use $from-size to adjust from a font-size other than the base font-size.
|
|
95
|
-
@mixin adjust-font-size-to($to-size, $lines:
|
|
96
|
-
|
|
97
|
-
|
|
148
|
+
@mixin adjust-font-size-to($to-size, $lines: auto, $from-size: $base-font-size) {
|
|
149
|
+
$to-size: convert-length($to-size, px, $from-size);
|
|
150
|
+
@if $lines == auto {
|
|
151
|
+
$lines: lines-for-font-size($to-size);
|
|
98
152
|
}
|
|
99
|
-
font-size
|
|
100
|
-
@include adjust-leading-to($lines,
|
|
153
|
+
@include output-rhythm(font-size, convert-length($to-size, $rhythm-unit, $from-size));
|
|
154
|
+
@include adjust-leading-to($lines, $to-size);
|
|
101
155
|
}
|
|
102
156
|
|
|
103
157
|
// Adjust a block to have different line height to maintain the rhythm.
|
|
@@ -105,117 +159,141 @@ $base-half-leader: $base-leader / 2;
|
|
|
105
159
|
// font should use up. It does not have to be an integer, but it defaults to the
|
|
106
160
|
// smallest integer that is large enough to fit the font.
|
|
107
161
|
@mixin adjust-leading-to($lines, $font-size: $base-font-size) {
|
|
108
|
-
line-height
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Calculate rhythm units.
|
|
112
|
-
@function rhythm(
|
|
113
|
-
$lines: 1,
|
|
114
|
-
$font-size: $base-font-size,
|
|
115
|
-
$offset: 0
|
|
116
|
-
) {
|
|
117
|
-
@if not $relative-font-sizing and $font-size != $base-font-size {
|
|
118
|
-
@warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function";
|
|
119
|
-
}
|
|
120
|
-
$rhythm: $font-unit * ($lines * $base-line-height - $offset) / $font-size;
|
|
121
|
-
// Round the pixels down to nearest integer.
|
|
122
|
-
@if unit($rhythm) == px {
|
|
123
|
-
$rhythm: floor($rhythm);
|
|
124
|
-
}
|
|
125
|
-
@return $rhythm;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Calculate the minimum multiple of rhythm units needed to contain the font-size.
|
|
129
|
-
@function lines-for-font-size($font-size) {
|
|
130
|
-
$lines: if($round-to-nearest-half-line,
|
|
131
|
-
ceil(2 * $font-size / $base-line-height) / 2,
|
|
132
|
-
ceil($font-size / $base-line-height));
|
|
133
|
-
@if $lines * $base-line-height - $font-size < $min-line-padding * 2 {
|
|
134
|
-
$lines: $lines + if($round-to-nearest-half-line, 0.5, 1);
|
|
135
|
-
}
|
|
136
|
-
@return $lines;
|
|
162
|
+
@include output-rhythm(line-height, rhythm($lines, $font-size));
|
|
137
163
|
}
|
|
138
164
|
|
|
139
165
|
// Apply leading whitespace. The $property can be margin or padding.
|
|
140
166
|
@mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) {
|
|
141
|
-
#{$property}-top
|
|
167
|
+
@include output-rhythm(#{$property}-top, rhythm($lines, $font-size));
|
|
142
168
|
}
|
|
143
169
|
|
|
144
170
|
// Apply leading whitespace as padding.
|
|
145
171
|
@mixin padding-leader($lines: 1, $font-size: $base-font-size) {
|
|
146
|
-
padding-top
|
|
172
|
+
@include output-rhythm(padding-top, rhythm($lines, $font-size));
|
|
147
173
|
}
|
|
148
174
|
|
|
149
175
|
// Apply leading whitespace as margin.
|
|
150
176
|
@mixin margin-leader($lines: 1, $font-size: $base-font-size) {
|
|
151
|
-
margin-top
|
|
177
|
+
@include output-rhythm(margin-top, rhythm($lines, $font-size));
|
|
152
178
|
}
|
|
153
179
|
|
|
154
180
|
// Apply trailing whitespace. The $property can be margin or padding.
|
|
155
181
|
@mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) {
|
|
156
|
-
#{$property}-bottom
|
|
182
|
+
@include output-rhythm(#{$property}-bottom, rhythm($lines, $font-size));
|
|
157
183
|
}
|
|
158
184
|
|
|
159
185
|
// Apply trailing whitespace as padding.
|
|
160
186
|
@mixin padding-trailer($lines: 1, $font-size: $base-font-size) {
|
|
161
|
-
padding-bottom
|
|
187
|
+
@include output-rhythm(padding-bottom, rhythm($lines, $font-size));
|
|
162
188
|
}
|
|
163
189
|
|
|
164
190
|
// Apply trailing whitespace as margin.
|
|
165
191
|
@mixin margin-trailer($lines: 1, $font-size: $base-font-size) {
|
|
166
|
-
margin-bottom
|
|
192
|
+
@include output-rhythm(margin-bottom, rhythm($lines, $font-size));
|
|
167
193
|
}
|
|
168
194
|
|
|
169
195
|
// Shorthand mixin to apply whitespace for top and bottom margins and padding.
|
|
170
|
-
@mixin rhythm(
|
|
196
|
+
@mixin rhythm(
|
|
197
|
+
$leader: 1,
|
|
198
|
+
$padding-leader: 0,
|
|
199
|
+
$padding-trailer: $padding-leader,
|
|
200
|
+
$trailer: $leader,
|
|
201
|
+
$font-size: $base-font-size
|
|
202
|
+
) {
|
|
171
203
|
@include leader($leader, $font-size);
|
|
172
204
|
@include padding-leader($padding-leader, $font-size);
|
|
173
205
|
@include padding-trailer($padding-trailer, $font-size);
|
|
174
206
|
@include trailer($trailer, $font-size);
|
|
175
207
|
}
|
|
176
208
|
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
width: $font-unit * $width / $font-size;
|
|
186
|
-
};
|
|
187
|
-
padding-#{$side}: rhythm($lines, $font-size, $offset: $width);
|
|
209
|
+
// Shorthand mixin to apply whitespace for top and bottom margins.
|
|
210
|
+
@mixin rhythm-margins(
|
|
211
|
+
$leader: 1,
|
|
212
|
+
$trailer: $leader,
|
|
213
|
+
$font-size: $base-font-size
|
|
214
|
+
) {
|
|
215
|
+
@include leader($leader, $font-size);
|
|
216
|
+
@include trailer($trailer, $font-size);
|
|
188
217
|
}
|
|
189
218
|
|
|
190
|
-
//
|
|
191
|
-
@mixin rhythm-
|
|
192
|
-
|
|
193
|
-
|
|
219
|
+
// Shorthand mixin to apply whitespace for top and bottom padding.
|
|
220
|
+
@mixin rhythm-padding(
|
|
221
|
+
$padding-leader: 1,
|
|
222
|
+
$padding-trailer: $padding-leader,
|
|
223
|
+
$font-size: $base-font-size
|
|
224
|
+
) {
|
|
225
|
+
@include padding-leader($padding-leader, $font-size);
|
|
226
|
+
@include padding-trailer($padding-trailer, $font-size);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Apply a border and whitespace to any side without destroying the vertical
|
|
230
|
+
// rhythm. The whitespace must be greater than the width of the border.
|
|
231
|
+
@mixin apply-side-rhythm-border(
|
|
232
|
+
$side,
|
|
233
|
+
$width: $default-rhythm-border-width,
|
|
234
|
+
$lines: 1,
|
|
235
|
+
$font-size: $base-font-size,
|
|
236
|
+
$border-style: $default-rhythm-border-style
|
|
237
|
+
) {
|
|
238
|
+
// If applying borders to all sides, use shorthand properties
|
|
239
|
+
$border-prop: if($side == all, border, border-#{$side});
|
|
240
|
+
@include output-rhythm(#{$border-prop}-width, convert-length($width, $rhythm-unit, $font-size));
|
|
241
|
+
#{$border-prop}-style: nth($border-style, 1);
|
|
242
|
+
@if type-of($border-style) == list and length($border-style) > 1 {
|
|
243
|
+
#{$border-prop}-color: nth($border-style, 2);
|
|
194
244
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
width: $font-unit * $width / $font-size;
|
|
198
|
-
};
|
|
199
|
-
padding: rhythm($lines, $font-size, $offset: $width);
|
|
245
|
+
$padding-prop: if($side == all, padding, padding-#{$side});
|
|
246
|
+
@include output-rhythm(#{$padding-prop}, rhythm($lines, $font-size, $offset: $width));
|
|
200
247
|
}
|
|
201
248
|
|
|
202
249
|
// Apply a leading border.
|
|
203
|
-
|
|
250
|
+
// $border-style and $width are deprecated and will be removed in a future version of Compass.
|
|
251
|
+
@mixin leading-border(
|
|
252
|
+
$width: $default-rhythm-border-width,
|
|
253
|
+
$lines: 1,
|
|
254
|
+
$font-size: $base-font-size,
|
|
255
|
+
$border-style: $default-rhythm-border-style
|
|
256
|
+
) {
|
|
204
257
|
@include apply-side-rhythm-border(top, $width, $lines, $font-size, $border-style);
|
|
205
258
|
}
|
|
206
259
|
|
|
207
260
|
// Apply a trailing border.
|
|
208
|
-
@mixin trailing-border(
|
|
261
|
+
@mixin trailing-border(
|
|
262
|
+
$width: $default-rhythm-border-width,
|
|
263
|
+
$lines: 1,
|
|
264
|
+
$font-size: $base-font-size,
|
|
265
|
+
$border-style: $default-rhythm-border-style
|
|
266
|
+
) {
|
|
209
267
|
@include apply-side-rhythm-border(bottom, $width, $lines, $font-size, $border-style);
|
|
210
268
|
}
|
|
211
269
|
|
|
212
270
|
// Apply both leading and trailing borders.
|
|
213
|
-
@mixin horizontal-borders(
|
|
271
|
+
@mixin horizontal-borders(
|
|
272
|
+
$width: $default-rhythm-border-width,
|
|
273
|
+
$lines: 1,
|
|
274
|
+
$font-size: $base-font-size,
|
|
275
|
+
$border-style: $default-rhythm-border-style
|
|
276
|
+
) {
|
|
214
277
|
@include leading-border($width, $lines, $font-size, $border-style);
|
|
215
278
|
@include trailing-border($width, $lines, $font-size, $border-style);
|
|
216
279
|
}
|
|
217
280
|
|
|
218
281
|
// Alias for `horizontal-borders` mixin.
|
|
219
|
-
@mixin h-borders(
|
|
282
|
+
@mixin h-borders(
|
|
283
|
+
$width: $default-rhythm-border-width,
|
|
284
|
+
$lines: 1,
|
|
285
|
+
$font-size: $base-font-size,
|
|
286
|
+
$border-style: $default-rhythm-border-style
|
|
287
|
+
) {
|
|
220
288
|
@include horizontal-borders($width, $lines, $font-size, $border-style);
|
|
221
289
|
}
|
|
290
|
+
|
|
291
|
+
// Apply borders and whitespace equally to all sides.
|
|
292
|
+
@mixin rhythm-borders(
|
|
293
|
+
$width: $default-rhythm-border-width,
|
|
294
|
+
$lines: 1,
|
|
295
|
+
$font-size: $base-font-size,
|
|
296
|
+
$border-style: $default-rhythm-border-style
|
|
297
|
+
) {
|
|
298
|
+
@include apply-side-rhythm-border(all, $width, $lines, $font-size, $border-style);
|
|
299
|
+
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
@import "compass/utilities/general/clearfix";
|
|
20
20
|
@import "compass/utilities/general/reset";
|
|
21
21
|
@import "compass/utilities/general/float";
|
|
22
|
+
@import "compass/support";
|
|
22
23
|
|
|
23
24
|
// Can be mixed into any selector that target a ul or ol that is meant
|
|
24
25
|
// to have a horizontal layout. Used to implement +horizontal-list.
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
//
|
|
32
33
|
// :last-child is not fully supported
|
|
33
34
|
// see http://www.quirksmode.org/css/contents.html#t29 for the support matrix
|
|
34
|
-
//
|
|
35
|
+
//
|
|
35
36
|
// IE8 ignores rules that are included on the same line as :last-child
|
|
36
37
|
// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
|
|
37
38
|
//
|
|
@@ -45,9 +46,10 @@
|
|
|
45
46
|
left: $padding;
|
|
46
47
|
right: $padding;
|
|
47
48
|
}
|
|
48
|
-
&:first-child, &.first { padding-#{$direction}: 0; }
|
|
49
|
+
&:first-child #{if($legacy-support-for-ie6, ', &.first', '')} { padding-#{$direction}: 0; }
|
|
49
50
|
&:last-child { padding-#{opposite-position($direction)}: 0; }
|
|
50
|
-
|
|
51
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
|
|
52
|
+
&.last { padding-#{opposite-position($direction)}: 0; } }
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
@import "compass/support";
|
|
2
2
|
|
|
3
|
+
// makes a list inline.
|
|
3
4
|
@mixin inline-list {
|
|
4
5
|
list-style-type: none;
|
|
5
6
|
&, & li {
|
|
@@ -30,8 +31,10 @@
|
|
|
30
31
|
&:last-child {
|
|
31
32
|
&:after { content: ""; }
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
|
|
35
|
+
&.last {
|
|
36
|
+
&:after { content: ""; }
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
@@ -19,7 +19,7 @@ $use-mozilla-ellipsis-binding: false !default;
|
|
|
19
19
|
not -khtml,
|
|
20
20
|
official
|
|
21
21
|
);
|
|
22
|
-
@if $
|
|
22
|
+
@if $legacy-support-for-mozilla and $use-mozilla-ellipsis-binding {
|
|
23
23
|
-moz-binding: stylesheet-url(unquote("xml/ellipsis.xml#ellipsis"));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "compass/support";
|
|
2
|
+
|
|
1
3
|
// Implementation of float:left with fix for the
|
|
2
4
|
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
|
3
5
|
@mixin float-left {
|
|
@@ -11,8 +13,9 @@
|
|
|
11
13
|
// Direction independent float mixin that fixes the
|
|
12
14
|
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
|
13
15
|
@mixin float($side: left) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
float: unquote($side);
|
|
17
|
+
@if $legacy-support-for-ie6 {
|
|
18
|
+
display: inline; } }
|
|
16
19
|
|
|
17
20
|
// Resets floated elements back to their default of `float: none` and defaults
|
|
18
21
|
// to `display: block` unless you pass `inline` as an argument
|
|
@@ -27,4 +30,5 @@
|
|
|
27
30
|
// +reset-float
|
|
28
31
|
@mixin reset-float($display: block) {
|
|
29
32
|
float: none;
|
|
30
|
-
|
|
33
|
+
@if $legacy-support-for-ie6 {
|
|
34
|
+
display: $display; } }
|
|
@@ -9,7 +9,7 @@ $default-has-layout-approach: zoom !default;
|
|
|
9
9
|
// to gain the "hasLayout" property in internet explorer.
|
|
10
10
|
// More information on [hasLayout](http://reference.sitepoint.com/css/haslayout).
|
|
11
11
|
@mixin has-layout($approach: $default-has-layout-approach) {
|
|
12
|
-
@if $legacy-support-for-
|
|
12
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
|
|
13
13
|
@if $approach == zoom {
|
|
14
14
|
@include has-layout-zoom;
|
|
15
15
|
} @else if $approach == block {
|
|
@@ -28,7 +28,7 @@ $default-has-layout-approach: zoom !default;
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
@mixin has-layout-block {
|
|
31
|
-
@if $legacy-support-for-
|
|
31
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
|
|
32
32
|
// This makes ie6 get layout
|
|
33
33
|
display: inline-block;
|
|
34
34
|
// and this puts it back to block
|
|
@@ -11,8 +11,12 @@ $sprite-selectors: hover, target, active !default;
|
|
|
11
11
|
// Set the background position of the given sprite `$map` to display the
|
|
12
12
|
// sprite of the given `$sprite` name. You can move the image relative to its
|
|
13
13
|
// natural position by passing `$offset-x` and `$offset-y`.
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// The background-position will be returned in pixels. By passing `true
|
|
15
|
+
// for `$use_percentages`, you get percentages instead.
|
|
16
|
+
@mixin sprite-background-position($map, $sprite, $offset-x: 0, $offset-y: 0,
|
|
17
|
+
$use-percentages: false) {
|
|
18
|
+
background-position: sprite-position($map, $sprite, $offset-x, $offset-y,
|
|
19
|
+
$use-percentages);
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
|
|
@@ -24,24 +28,32 @@ $disable-magic-sprite-selectors:false !default;
|
|
|
24
28
|
// class or you can specify the `sprite-url` explicitly like this:
|
|
25
29
|
//
|
|
26
30
|
// background: $map no-repeat;
|
|
27
|
-
@mixin sprite($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0
|
|
28
|
-
|
|
31
|
+
@mixin sprite($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0,
|
|
32
|
+
$use-percentages: false) {
|
|
33
|
+
@include sprite-background-position($map, $sprite, $offset-x, $offset-y,
|
|
34
|
+
$use-percentages);
|
|
29
35
|
@if $dimensions {
|
|
30
36
|
@include sprite-dimensions($map, $sprite);
|
|
31
37
|
}
|
|
32
38
|
@if not $disable-magic-sprite-selectors {
|
|
33
|
-
@include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y
|
|
39
|
+
@include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y,
|
|
40
|
+
$use-percentages);
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
// Include the selectors for the `$sprite` given the `$map` and the
|
|
38
45
|
// `$full-sprite-name`
|
|
39
46
|
// @private
|
|
40
|
-
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0,
|
|
47
|
+
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0,
|
|
48
|
+
$offset-y: 0, $use-percentages: false) {
|
|
41
49
|
@each $selector in $sprite-selectors {
|
|
42
50
|
@if sprite_has_selector($map, $sprite-name, $selector) {
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
@if sprite_has_valid_selector("#{$full-sprite-name}-#{$selector}") {
|
|
52
|
+
&:#{$selector}, &.#{$full-sprite-name}-#{$selector} {
|
|
53
|
+
@include sprite-background-position($map,
|
|
54
|
+
"#{$sprite-name}_#{$selector}", $offset-x, $offset-y,
|
|
55
|
+
$use-percentages);
|
|
56
|
+
}
|
|
45
57
|
}
|
|
46
58
|
}
|
|
47
59
|
}
|
|
@@ -53,14 +65,21 @@ $disable-magic-sprite-selectors:false !default;
|
|
|
53
65
|
// If a base class is provided, then each class will extend it.
|
|
54
66
|
//
|
|
55
67
|
// If `$dimensions` is `true`, the sprite dimensions will specified.
|
|
56
|
-
|
|
68
|
+
// Positions are returned in pixel units. Set `$use_percentages` to true to
|
|
69
|
+
// instead get percentages.
|
|
70
|
+
@mixin sprites($map, $sprite-names, $base-class: false, $dimensions: false,
|
|
71
|
+
$prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0, $use-percentages:
|
|
72
|
+
false) {
|
|
57
73
|
@each $sprite-name in $sprite-names {
|
|
58
74
|
@if sprite_does_not_have_parent($map, $sprite-name) {
|
|
59
75
|
$full-sprite-name: "#{$prefix}-#{$sprite-name}";
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
@if sprite_has_valid_selector($full-sprite-name) {
|
|
77
|
+
.#{$full-sprite-name} {
|
|
78
|
+
@if $base-class { @extend #{$base-class}; }
|
|
79
|
+
@include sprite($map, $sprite-name, $dimensions, $offset-x, $offset-y,
|
|
80
|
+
$use-percentages);
|
|
81
|
+
}
|
|
63
82
|
}
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
|
-
}
|
|
85
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "compass/support";
|
|
2
|
+
|
|
1
3
|
@mixin outer-table-borders($width: 2px, $color: black) {
|
|
2
4
|
border: $width solid $color;
|
|
3
5
|
thead {
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
th, td {
|
|
8
10
|
border-top: $width solid $color; } }
|
|
9
11
|
th {
|
|
10
|
-
&:first-child {
|
|
12
|
+
&:first-child #{if($legacy-support-for-ie6, ', &.first', '')} {
|
|
11
13
|
border-right: $width solid $color; } } }
|
|
12
14
|
|
|
13
15
|
@mixin inner-table-borders($width: 2px, $color: black) {
|
|
@@ -17,17 +19,20 @@
|
|
|
17
19
|
bottom: $width solid $color;
|
|
18
20
|
left-width: 0px;
|
|
19
21
|
top-width: 0px; };
|
|
20
|
-
&:last-child
|
|
21
|
-
|
|
22
|
-
border-right-width: 0px; } }
|
|
22
|
+
&:last-child {
|
|
23
|
+
border-right-width: 0px; }
|
|
23
24
|
|
|
24
|
-
// IE8 ignores rules that are included on the same line as :last-child
|
|
25
|
-
// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
|
|
25
|
+
// IE8 ignores rules that are included on the same line as :last-child
|
|
26
|
+
// see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
|
|
27
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 {
|
|
28
|
+
&.last {
|
|
29
|
+
border-right-width: 0px; } } }
|
|
26
30
|
|
|
27
31
|
tbody, tfoot {
|
|
28
32
|
tr:last-child {
|
|
29
33
|
th, td {
|
|
30
34
|
border-bottom-width: 0px; } }
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 {
|
|
36
|
+
tr.last {
|
|
37
|
+
th, td {
|
|
38
|
+
border-bottom-width: 0px; } } } } }
|
data/lib/compass/actions.rb
CHANGED
|
@@ -55,7 +55,9 @@ module Compass
|
|
|
55
55
|
if skip_write
|
|
56
56
|
FileUtils.touch file_name unless options[:dry_run]
|
|
57
57
|
else
|
|
58
|
-
|
|
58
|
+
mode = "w"
|
|
59
|
+
mode << "b" if binary
|
|
60
|
+
open(file_name, mode) do |file|
|
|
59
61
|
file.write(contents)
|
|
60
62
|
end
|
|
61
63
|
end
|
|
@@ -48,7 +48,7 @@ module Compass
|
|
|
48
48
|
|
|
49
49
|
def check_for_sass_files!(compiler)
|
|
50
50
|
if compiler.sass_files.empty? && !dry_run?
|
|
51
|
-
message = "
|
|
51
|
+
message = "Compass can't find any Sass files to compile.\nIs your compass configuration correct?.\nIf you're trying to start a new project, you have left off the directory argument.\n"
|
|
52
52
|
message << "Run \"compass -h\" to get help."
|
|
53
53
|
raise Compass::Error, message
|
|
54
54
|
end
|
|
@@ -129,7 +129,6 @@ module Compass
|
|
|
129
129
|
parser.options[:project_name] = arguments.shift if File.directory?(arguments.first)
|
|
130
130
|
unless arguments.empty?
|
|
131
131
|
parser.options[:sass_files] = arguments.dup
|
|
132
|
-
parser.options[:force] = true
|
|
133
132
|
end
|
|
134
133
|
end
|
|
135
134
|
end
|