compass 0.11.beta.2 → 0.11.beta.3

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.
Files changed (68) hide show
  1. data/VERSION.yml +1 -1
  2. data/examples/compass/src/utilities.scss +2 -2
  3. data/features/step_definitions/command_line_steps.rb +1 -1
  4. data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +1 -1
  5. data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +1 -1
  6. data/frameworks/compass/stylesheets/_compass.scss +1 -0
  7. data/frameworks/compass/stylesheets/compass/_css3.scss +1 -0
  8. data/frameworks/compass/stylesheets/compass/_reset-legacy.scss +3 -0
  9. data/frameworks/compass/stylesheets/compass/_typography.scss +4 -0
  10. data/frameworks/compass/stylesheets/compass/_utilities.scss +6 -3
  11. data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +13 -0
  12. data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +10 -10
  13. data/frameworks/compass/stylesheets/compass/reset/_utilities-legacy.scss +135 -0
  14. data/frameworks/compass/stylesheets/compass/reset/_utilities.scss +34 -28
  15. data/frameworks/compass/stylesheets/compass/typography/_links.scss +3 -0
  16. data/frameworks/compass/stylesheets/compass/typography/_lists.scss +4 -0
  17. data/frameworks/compass/stylesheets/compass/typography/_text.scss +3 -0
  18. data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +124 -0
  19. data/frameworks/compass/stylesheets/compass/typography/links/_hover-link.scss +5 -0
  20. data/frameworks/compass/stylesheets/compass/typography/links/_link-colors.scss +28 -0
  21. data/frameworks/compass/stylesheets/compass/typography/links/_unstyled-link.scss +7 -0
  22. data/frameworks/compass/stylesheets/compass/typography/lists/_bullets.scss +34 -0
  23. data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +61 -0
  24. data/frameworks/compass/stylesheets/compass/typography/lists/_inline-block-list.scss +47 -0
  25. data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +44 -0
  26. data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +25 -0
  27. data/frameworks/compass/stylesheets/compass/typography/text/_nowrap.scss +2 -0
  28. data/frameworks/compass/stylesheets/compass/typography/text/_replacement.scss +34 -0
  29. data/frameworks/compass/stylesheets/compass/utilities/_color.scss +1 -0
  30. data/frameworks/compass/stylesheets/compass/utilities/_links.scss +5 -3
  31. data/frameworks/compass/stylesheets/compass/utilities/_lists.scss +6 -4
  32. data/frameworks/compass/stylesheets/compass/utilities/_text.scss +5 -3
  33. data/frameworks/compass/stylesheets/compass/utilities/color/_contrast.scss +28 -0
  34. data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
  35. data/frameworks/compass/stylesheets/compass/utilities/links/_hover-link.scss +3 -5
  36. data/frameworks/compass/stylesheets/compass/utilities/links/_link-colors.scss +2 -27
  37. data/frameworks/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +3 -7
  38. data/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss +2 -33
  39. data/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +2 -60
  40. data/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +2 -46
  41. data/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +2 -34
  42. data/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.scss +2 -24
  43. data/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.scss +3 -2
  44. data/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +2 -33
  45. data/frameworks/compass/templates/ellipsis/ellipsis.sass +1 -1
  46. data/frameworks/compass/templates/pie/manifest.rb +1 -1
  47. data/lib/compass.rb +2 -0
  48. data/lib/compass/compiler.rb +18 -4
  49. data/lib/compass/configuration.rb +1 -1
  50. data/lib/compass/configuration/data.rb +10 -0
  51. data/lib/compass/configuration/file_data.rb +43 -0
  52. data/lib/compass/configuration/helpers.rb +8 -2
  53. data/lib/compass/configuration/inheritance.rb +2 -2
  54. data/lib/compass/configuration/serialization.rb +51 -76
  55. data/lib/compass/sass_extensions/functions/colors.rb +1 -1
  56. data/lib/compass/sass_extensions/functions/sprites.rb +9 -5
  57. data/test/compass_test.rb +35 -7
  58. data/test/fixtures/stylesheets/blueprint/css/screen.css +18 -14
  59. data/test/fixtures/stylesheets/compass/css/fonts.css +2 -6
  60. data/test/fixtures/stylesheets/compass/css/lists.css +0 -6
  61. data/test/fixtures/stylesheets/compass/css/reset.css +18 -14
  62. data/test/fixtures/stylesheets/compass/css/utilities.css +13 -0
  63. data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +42 -0
  64. data/test/fixtures/stylesheets/compass/sass/fonts.sass +1 -1
  65. data/test/fixtures/stylesheets/compass/sass/lists.scss +2 -2
  66. data/test/fixtures/stylesheets/compass/sass/utilities.scss +5 -0
  67. data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +14 -0
  68. metadata +30 -31
@@ -0,0 +1,5 @@
1
+ // a link that only has an underline when you hover over it
2
+ @mixin hover-link {
3
+ text-decoration: none;
4
+ &:hover {
5
+ text-decoration: underline; } }
@@ -0,0 +1,28 @@
1
+ // Set all the colors for a link with one mixin call.
2
+ // Order of arguments is:
3
+ //
4
+ // 1. normal
5
+ // 2. hover
6
+ // 3. active
7
+ // 4. visited
8
+ // 5. focus
9
+ //
10
+ // Those states not specified will inherit.
11
+ // Mixin to an anchor link like so:
12
+ // a
13
+ // +link-colors(#00c, #0cc, #c0c, #ccc, #cc0)
14
+
15
+ @mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) {
16
+ color: $normal;
17
+ @if $visited {
18
+ &:visited {
19
+ color: $visited; } }
20
+ @if $focus {
21
+ &:focus {
22
+ color: $focus; } }
23
+ @if $hover {
24
+ &:hover {
25
+ color: $hover; } }
26
+ @if $active {
27
+ &:active {
28
+ color: $active; } } }
@@ -0,0 +1,7 @@
1
+ // A link that looks and acts like the text it is contained within
2
+ @mixin unstyled-link {
3
+ color: inherit;
4
+ text-decoration: inherit;
5
+ cursor: inherit;
6
+ &:active, &:focus {
7
+ outline: none; } }
@@ -0,0 +1,34 @@
1
+ // Turn off the bullet for an element of a list
2
+ @mixin no-bullet {
3
+ list-style-image : none;
4
+ list-style-type : none;
5
+ margin-left : 0px;
6
+ }
7
+
8
+ // turns off the bullets for an entire list
9
+ @mixin no-bullets {
10
+ list-style: none;
11
+ li { @include no-bullet; }
12
+ }
13
+
14
+ // Make a list(ul/ol) have an image bullet.
15
+ //
16
+ // The mixin should be used like this for an icon that is 5x7:
17
+ //
18
+ // ul.pretty
19
+ // +pretty-bullets("my-icon.png", 5px, 7px)
20
+ //
21
+ // Additionally, if the image dimensions are not provided,
22
+ // The image dimensions will be extracted from the image itself.
23
+ //
24
+ // ul.pretty
25
+ // +pretty-bullets("my-icon.png")
26
+ //
27
+ @mixin pretty-bullets($bullet-icon, $width: image-width($bullet-icon), $height: image-height($bullet-icon), $line-height: 18px, $padding: 14px) {
28
+ margin-left: 0;
29
+ li {
30
+ padding-left: $padding;
31
+ background: image-url($bullet-icon) no-repeat ($padding - $width) / 2 ($line-height - $height) / 2;
32
+ list-style-type: none;
33
+ }
34
+ }
@@ -0,0 +1,61 @@
1
+ // Horizontal list layout module.
2
+ //
3
+ // Easy mode using simple descendant li selectors:
4
+ //
5
+ // ul.nav
6
+ // +horizontal-list
7
+ //
8
+ // Advanced mode:
9
+ // If you need to target the list items using a different selector then use
10
+ // +horizontal-list-container on your ul/ol and +horizontal-list-item on your li.
11
+ // This may help when working on layouts involving nested lists. For example:
12
+ //
13
+ // ul.nav
14
+ // +horizontal-list-container
15
+ // > li
16
+ // +horizontal-list-item
17
+
18
+ @import "bullets";
19
+ @import "compass/utilities/general/clearfix";
20
+ @import "compass/utilities/general/reset";
21
+ @import "compass/utilities/general/float";
22
+
23
+ // Can be mixed into any selector that target a ul or ol that is meant
24
+ // to have a horizontal layout. Used to implement +horizontal-list.
25
+ @mixin horizontal-list-container {
26
+ @include reset-box-model;
27
+ @include clearfix; }
28
+
29
+ // Can be mixed into any li selector that is meant to participate in a horizontal layout.
30
+ // Used to implement +horizontal-list.
31
+ //
32
+ // :last-child is not fully supported
33
+ // see http://www.quirksmode.org/css/contents.html#t29 for the support matrix
34
+ //
35
+ // IE8 ignores rules that are included on the same line as :last-child
36
+ // see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
37
+ //
38
+ // Setting `$padding` to `false` disables the padding between list elements
39
+ @mixin horizontal-list-item($padding: 4px, $direction: left) {
40
+ @include no-bullet;
41
+ white-space: nowrap;
42
+ @include float($direction);
43
+ @if $padding {
44
+ padding: {
45
+ left: $padding;
46
+ right: $padding;
47
+ }
48
+ &:first-child, &.first { padding-#{$direction}: 0; }
49
+ &:last-child { padding-#{opposite-position($direction)}: 0; }
50
+ &.last { padding-#{opposite-position($direction)}: 0; }
51
+ }
52
+ }
53
+
54
+ // A list(ol,ul) that is layed out such that the elements are floated left and won't wrap.
55
+ // This is not an inline list.
56
+ //
57
+ // Setting `$padding` to `false` disables the padding between list elements
58
+ @mixin horizontal-list($padding: 4px, $direction: left) {
59
+ @include horizontal-list-container;
60
+ li {
61
+ @include horizontal-list-item($padding, $direction); } }
@@ -0,0 +1,47 @@
1
+ // Inline-Block list layout module.
2
+ //
3
+ // Easy mode using simple descendant li selectors:
4
+ //
5
+ // ul.nav
6
+ // +inline-block-list
7
+ //
8
+ // Advanced mode:
9
+ // If you need to target the list items using a different selector then use
10
+ // +inline-block-list-container on your ul/ol and +inline-block-list-item on your li.
11
+ // This may help when working on layouts involving nested lists. For example:
12
+ //
13
+ // ul.nav
14
+ // +inline-block-list-container
15
+ // > li
16
+ // +inline-block-list-item
17
+
18
+ @import "bullets";
19
+ @import "horizontal-list";
20
+ @import "compass/utilities/general/float";
21
+ @import "compass/css3/inline-block";
22
+
23
+ // Can be mixed into any selector that target a ul or ol that is meant
24
+ // to have an inline-block layout. Used to implement +inline-block-list.
25
+ @mixin inline-block-list-container {
26
+ @include horizontal-list-container; }
27
+
28
+ // Can be mixed into any li selector that is meant to participate in a horizontal layout.
29
+ // Used to implement +inline-block-list.
30
+
31
+ @mixin inline-block-list-item($padding: false) {
32
+ @include no-bullet;
33
+ @include inline-block;
34
+ white-space: nowrap;
35
+ @if $padding {
36
+ padding: {
37
+ left: $padding;
38
+ right: $padding;
39
+ };
40
+ }
41
+ }
42
+
43
+ // A list(ol,ul) that is layed out such that the elements are inline-block and won't wrap.
44
+ @mixin inline-block-list($padding: false) {
45
+ @include inline-block-list-container;
46
+ li {
47
+ @include inline-block-list-item($padding); } }
@@ -0,0 +1,44 @@
1
+ // makes a list inline.
2
+
3
+ @mixin inline-list {
4
+ list-style-type: none;
5
+ &, & li {
6
+ margin: 0px;
7
+ padding: 0px;
8
+ display: inline;
9
+ }
10
+ }
11
+
12
+ // makes an inline list delimited with the passed string.
13
+ // Defaults to making a comma-separated list.
14
+ //
15
+ // Please make note of the browser support issues before using this mixin:
16
+ //
17
+ // use of `content` and `:after` is not fully supported in all browsers.
18
+ // See quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t15)
19
+ //
20
+ // `:last-child` is not fully supported.
21
+ // see quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t29).
22
+ //
23
+ // IE8 ignores rules that are included on the same line as :last-child
24
+ // see http://www.richardscarrott.co.uk/posts/view/ie8-last-child-bug for details
25
+
26
+ @mixin delimited-list($separator: ", ") {
27
+ @include inline-list;
28
+ li {
29
+ &:after { content: $separator; }
30
+ &:last-child {
31
+ &:after { content: ""; }
32
+ }
33
+ &.last {
34
+ &:after { content: ""; }
35
+ }
36
+ }
37
+ }
38
+
39
+ // See [delimited-list](#mixin-delimited-list)
40
+ // @deprecated
41
+ @mixin comma-delimited-list {
42
+ @warn "comma-delimited-list is deprecated. Please use delimited-list instead.";
43
+ @include delimited-list;
44
+ }
@@ -0,0 +1,25 @@
1
+ @import "compass/css3/shared";
2
+
3
+ // To get full firefox support, you must install the ellipsis pattern:
4
+ //
5
+ // compass install compass/ellipsis
6
+ $use-mozilla-ellipsis-binding: false !default;
7
+
8
+ // This technique, by [Justin Maxwell](http://code404.com/), was originally
9
+ // published [here](http://mattsnider.com/css/css-string-truncation-with-ellipsis/).
10
+ // Firefox implementation by [Rikkert Koppes](http://www.rikkertkoppes.com/thoughts/2008/6/).
11
+ @mixin ellipsis($no-wrap: true) {
12
+ @if $no-wrap { white-space: nowrap; }
13
+ overflow: hidden;
14
+ @include experimental(text-overflow, ellipsis,
15
+ not -moz,
16
+ not -webkit,
17
+ -o,
18
+ -ms,
19
+ not -khtml,
20
+ official
21
+ );
22
+ @if $experimental-support-for-mozilla and $use-mozilla-ellipsis-binding {
23
+ -moz-binding: stylesheet-url(unquote("xml/ellipsis.xml#ellipsis"));
24
+ }
25
+ }
@@ -0,0 +1,2 @@
1
+ // When remembering whether or not there's a hyphen in white-space is too hard
2
+ @mixin nowrap { white-space: nowrap; }
@@ -0,0 +1,34 @@
1
+ // Hides html text and replaces it with an image.
2
+ // If you use this on an inline element, you will need to change the display to block or inline-block.
3
+ // Also, if the size of the image differs significantly from the font size, you'll need to set the width and/or height.
4
+ //
5
+ // Parameters:
6
+ //
7
+ // * `img` -- the relative path from the project image directory to the image.
8
+ // * `x` -- the x position of the background image.
9
+ // * `y` -- the y position of the background image.
10
+ @mixin replace-text($img, $x: 50%, $y: 50%) {
11
+ @include hide-text;
12
+ background: {
13
+ image: image-url($img);
14
+ repeat: no-repeat;
15
+ position: $x $y;
16
+ };
17
+ }
18
+
19
+ // Like the `replace-text` mixin, but also sets the width
20
+ // and height of the element according the dimensions of the image.
21
+ @mixin replace-text-with-dimensions($img, $x: 50%, $y: 50%) {
22
+ @include replace-text($img, $x, $y);
23
+ width: image-width($img);
24
+ height: image-height($img);
25
+ }
26
+
27
+ // Hides text in an element so you can see the background.
28
+ @mixin hide-text {
29
+ $approximate_em_value: 12px / 1em;
30
+ $wider_than_any_screen: -9999em;
31
+ text-indent: $wider_than_any_screen * $approximate_em_value;
32
+ overflow: hidden;
33
+ text-align: left;
34
+ }
@@ -0,0 +1 @@
1
+ @import "color/contrast";
@@ -1,3 +1,5 @@
1
- @import "links/hover-link";
2
- @import "links/link-colors";
3
- @import "links/unstyled-link";
1
+ @warn "This import is deprecated. Use 'compass/typography/links' instead.";
2
+
3
+ @import "../typography/links/hover-link";
4
+ @import "../typography/links/link-colors";
5
+ @import "../typography/links/unstyled-link";
@@ -1,4 +1,6 @@
1
- @import "lists/horizontal-list";
2
- @import "lists/inline-list";
3
- @import "lists/inline-block-list";
4
- @import "lists/bullets";
1
+ @warn "This import is deprecated. Use 'compass/typography/lists' instead.";
2
+
3
+ @import "../typography/lists/horizontal-list";
4
+ @import "../typography/lists/inline-list";
5
+ @import "../typography/lists/inline-block-list";
6
+ @import "../typography/lists/bullets";
@@ -1,3 +1,5 @@
1
- @import "text/ellipsis";
2
- @import "text/nowrap";
3
- @import "text/replacement";
1
+ @warn "This import is deprecated. Use 'compass/typography/text' instead.";
2
+
3
+ @import "../typography/text/ellipsis";
4
+ @import "../typography/text/nowrap";
5
+ @import "../typography/text/replacement";
@@ -0,0 +1,28 @@
1
+ $contrasted-dark-default: #000 !default;
2
+ $contrasted-light-default: #fff !default;
3
+ $contrasted-lightness-threshold: 30% !default;
4
+
5
+ // Returns the `$light` color when the `$color` is dark
6
+ // and the `$dark` color when the `$color` is light.
7
+ // The `$threshold` is a percent between `0%` and `100%` and it determines
8
+ // when the lightness of `$color` changes from "dark" to "light".
9
+ @function contrast-color(
10
+ $color,
11
+ $dark: $contrasted-dark-default,
12
+ $light: $contrasted-light-default,
13
+ $threshold: $contrasted-lightness-threshold
14
+ ) {
15
+ @return if(lightness($color) < $threshold, $light, $dark)
16
+ }
17
+
18
+ // Sets the specified background color and calculates a dark or light contrasted text color.
19
+ // The arguments are passed through to the [contrast-color function](#function-contrast-color).
20
+ @mixin contrasted(
21
+ $background-color,
22
+ $dark: $contrasted-dark-default,
23
+ $light: $contrasted-light-default,
24
+ $threshold: $contrasted-lightness-threshold
25
+ ) {
26
+ background-color: $background-color;
27
+ color: contrast-color($background-color, $dark, $light, $threshold);
28
+ }
@@ -13,3 +13,18 @@
13
13
  @mixin float($side: left) {
14
14
  display: inline;
15
15
  float: unquote($side); }
16
+
17
+ // Resets floated elements back to their default of `float: none` and defaults
18
+ // to `display: block` unless you pass `inline` as an argument
19
+ //
20
+ // Usage Example:
21
+ //
22
+ // body.homepage
23
+ // #footer li
24
+ // +float-left
25
+ // body.signup
26
+ // #footer li
27
+ // +reset-float
28
+ @mixin reset-float($display: block) {
29
+ float: none;
30
+ display: $display; }
@@ -1,5 +1,3 @@
1
- // a link that only has an underline when you hover over it
2
- @mixin hover-link {
3
- text-decoration: none;
4
- &:hover {
5
- text-decoration: underline; } }
1
+ @warn "This import is deprecated. Use 'compass/typography/links/hover-link' instead.";
2
+
3
+ @import "../../typography/links/hover-link";
@@ -1,28 +1,3 @@
1
- // Set all the colors for a link with one mixin call.
2
- // Order of arguments is:
3
- //
4
- // 1. normal
5
- // 2. hover
6
- // 3. active
7
- // 4. visited
8
- // 5. focus
9
- //
10
- // Those states not specified will inherit.
11
- // Mixin to an anchor link like so:
12
- // a
13
- // +link-colors(#00c, #0cc, #c0c, #ccc, #cc0)
1
+ @warn "This import is deprecated. Use 'compass/typography/links/link-colors' instead.";
14
2
 
15
- @mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) {
16
- color: $normal;
17
- @if $visited {
18
- &:visited {
19
- color: $visited; } }
20
- @if $focus {
21
- &:focus {
22
- color: $focus; } }
23
- @if $hover {
24
- &:hover {
25
- color: $hover; } }
26
- @if $active {
27
- &:active {
28
- color: $active; } } }
3
+ @import "../../typography/links/link-colors";
@@ -1,7 +1,3 @@
1
- // A link that looks and acts like the text it is contained within
2
- @mixin unstyled-link {
3
- color: inherit;
4
- text-decoration: inherit;
5
- cursor: inherit;
6
- &:active, &:focus {
7
- outline: none; } }
1
+ @warn "This import is deprecated. Use 'compass/typography/links/unstyled-link' instead.";
2
+
3
+ @import "../../typography/links/unstyled-link";
@@ -1,34 +1,3 @@
1
- // Turn off the bullet for an element of a list
2
- @mixin no-bullet {
3
- list-style-image : none;
4
- list-style-type : none;
5
- margin-left : 0px;
6
- }
1
+ @warn "This import is deprecated. Use 'compass/typography/lists/bullets' instead.";
7
2
 
8
- // turns off the bullets for an entire list
9
- @mixin no-bullets {
10
- list-style: none;
11
- li { @include no-bullet; }
12
- }
13
-
14
- // Make a list(ul/ol) have an image bullet.
15
- //
16
- // The mixin should be used like this for an icon that is 5x7:
17
- //
18
- // ul.pretty
19
- // +pretty-bullets("my-icon.png", 5px, 7px)
20
- //
21
- // Additionally, if the image dimensions are not provided,
22
- // The image dimensions will be extracted from the image itself.
23
- //
24
- // ul.pretty
25
- // +pretty-bullets("my-icon.png")
26
- //
27
- @mixin pretty-bullets($bullet-icon, $width: image-width($bullet-icon), $height: image-height($bullet-icon), $line-height: 18px, $padding: 14px) {
28
- margin-left: 0;
29
- li {
30
- padding-left: $padding;
31
- background: image-url($bullet-icon) no-repeat ($padding - $width) / 2 ($line-height - $height) / 2;
32
- list-style-type: none;
33
- }
34
- }
3
+ @import "../../typography/lists/bullets";