simple-compass 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.rspec +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +26 -0
- data/Rakefile +8 -0
- data/lib/simple-compass.rb +17 -0
- data/lib/simple-compass/sass/functions/display.rb +27 -0
- data/lib/simple-compass/sass/functions/lists.rb +101 -0
- data/lib/simple-compass/sass/functions/selectors.rb +64 -0
- data/lib/simple-compass/sass/functions/sprites.rb +218 -0
- data/lib/simple-compass/version.rb +3 -0
- data/sass/compass.scss +1 -0
- data/sass/compass/_css3.scss +20 -0
- data/sass/compass/_layout.scss +3 -0
- data/sass/compass/_reset-legacy.scss +3 -0
- data/sass/compass/_reset.scss +3 -0
- data/sass/compass/_support.scss +40 -0
- data/sass/compass/_typography.scss +4 -0
- data/sass/compass/_utilities.scss +9 -0
- data/sass/compass/css3/_appearance.scss +17 -0
- data/sass/compass/css3/_background-clip.scss +43 -0
- data/sass/compass/css3/_background-origin.scss +42 -0
- data/sass/compass/css3/_background-size.scss +26 -0
- data/sass/compass/css3/_border-radius.scss +130 -0
- data/sass/compass/css3/_box-shadow.scss +76 -0
- data/sass/compass/css3/_box-sizing.scss +13 -0
- data/sass/compass/css3/_box.scss +111 -0
- data/sass/compass/css3/_columns.scss +157 -0
- data/sass/compass/css3/_filter.scss +23 -0
- data/sass/compass/css3/_font-face.scss +48 -0
- data/sass/compass/css3/_hyphenation.scss +77 -0
- data/sass/compass/css3/_images.scss +132 -0
- data/sass/compass/css3/_inline-block.scss +22 -0
- data/sass/compass/css3/_opacity.scss +19 -0
- data/sass/compass/css3/_pie.scss +73 -0
- data/sass/compass/css3/_regions.scss +22 -0
- data/sass/compass/css3/_shared.scss +38 -0
- data/sass/compass/css3/_text-shadow.scss +87 -0
- data/sass/compass/css3/_transform-legacy.scss +87 -0
- data/sass/compass/css3/_transform.scss +598 -0
- data/sass/compass/css3/_transition.scss +221 -0
- data/sass/compass/css3/_user-interface.scss +17 -0
- data/sass/compass/layout/_grid-background.scss +178 -0
- data/sass/compass/layout/_sticky-footer.scss +23 -0
- data/sass/compass/layout/_stretching.scss +24 -0
- data/sass/compass/reset/_utilities-legacy.scss +135 -0
- data/sass/compass/reset/_utilities.scss +142 -0
- data/sass/compass/typography/_links.scss +3 -0
- data/sass/compass/typography/_lists.scss +4 -0
- data/sass/compass/typography/_text.scss +4 -0
- data/sass/compass/typography/_vertical_rhythm.scss +221 -0
- data/sass/compass/typography/links/_hover-link.scss +5 -0
- data/sass/compass/typography/links/_link-colors.scss +28 -0
- data/sass/compass/typography/links/_unstyled-link.scss +7 -0
- data/sass/compass/typography/lists/_bullets.scss +34 -0
- data/sass/compass/typography/lists/_horizontal-list.scss +61 -0
- data/sass/compass/typography/lists/_inline-block-list.scss +50 -0
- data/sass/compass/typography/lists/_inline-list.scss +44 -0
- data/sass/compass/typography/text/_ellipsis.scss +25 -0
- data/sass/compass/typography/text/_force-wrap.scss +12 -0
- data/sass/compass/typography/text/_nowrap.scss +2 -0
- data/sass/compass/typography/text/_replacement.scss +68 -0
- data/sass/compass/utilities/_color.scss +1 -0
- data/sass/compass/utilities/_general.scss +6 -0
- data/sass/compass/utilities/_links.scss +5 -0
- data/sass/compass/utilities/_lists.scss +6 -0
- data/sass/compass/utilities/_print.scss +17 -0
- data/sass/compass/utilities/_sprites.scss +2 -0
- data/sass/compass/utilities/_tables.scss +3 -0
- data/sass/compass/utilities/_text.scss +5 -0
- data/sass/compass/utilities/color/_contrast.scss +28 -0
- data/sass/compass/utilities/general/_clearfix.scss +44 -0
- data/sass/compass/utilities/general/_float.scss +30 -0
- data/sass/compass/utilities/general/_hacks.scss +46 -0
- data/sass/compass/utilities/general/_min.scss +16 -0
- data/sass/compass/utilities/general/_reset.scss +2 -0
- data/sass/compass/utilities/general/_tabs.scss +1 -0
- data/sass/compass/utilities/general/_tag-cloud.scss +18 -0
- data/sass/compass/utilities/links/_hover-link.scss +3 -0
- data/sass/compass/utilities/links/_link-colors.scss +3 -0
- data/sass/compass/utilities/links/_unstyled-link.scss +3 -0
- data/sass/compass/utilities/lists/_bullets.scss +3 -0
- data/sass/compass/utilities/lists/_horizontal-list.scss +3 -0
- data/sass/compass/utilities/lists/_inline-block-list.scss +3 -0
- data/sass/compass/utilities/lists/_inline-list.scss +3 -0
- data/sass/compass/utilities/sprites/_base.scss +66 -0
- data/sass/compass/utilities/sprites/_sprite-img.scss +79 -0
- data/sass/compass/utilities/tables/_alternating-rows-and-columns.scss +22 -0
- data/sass/compass/utilities/tables/_borders.scss +33 -0
- data/sass/compass/utilities/tables/_scaffolding.scss +9 -0
- data/sass/compass/utilities/text/_ellipsis.scss +3 -0
- data/sass/compass/utilities/text/_nowrap.scss +3 -0
- data/sass/compass/utilities/text/_replacement.scss +3 -0
- data/simple-compass.gemspec +21 -0
- data/spec/fixtures/headings_test.sass +2 -0
- data/spec/fixtures/opacity_test.sass +7 -0
- data/spec/fixtures/reset_test.sass +1 -0
- data/spec/headings_spec.rb +9 -0
- data/spec/opacity_spec.rb +9 -0
- data/spec/reset_spec.rb +9 -0
- data/spec/spec_helper.rb +7 -0
- metadata +169 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
// Implementation of float:left with fix for the
|
2
|
+
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
3
|
+
@mixin float-left {
|
4
|
+
@include float(left); }
|
5
|
+
|
6
|
+
// Implementation of float:right with fix for the
|
7
|
+
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
8
|
+
@mixin float-right {
|
9
|
+
@include float(right); }
|
10
|
+
|
11
|
+
// Direction independent float mixin that fixes the
|
12
|
+
// [double-margin bug in IE5/6](http://www.positioniseverything.net/explorer/doubled-margin.html)
|
13
|
+
@mixin float($side: left) {
|
14
|
+
display: inline;
|
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; }
|
@@ -0,0 +1,46 @@
|
|
1
|
+
@import "compass/support";
|
2
|
+
|
3
|
+
// The `zoom` approach generates less CSS but does not validate.
|
4
|
+
// Set this to `block` to use the display-property to hack the
|
5
|
+
// element to gain layout.
|
6
|
+
$default-has-layout-approach: zoom !default;
|
7
|
+
|
8
|
+
// This mixin causes an element matching the selector
|
9
|
+
// to gain the "hasLayout" property in internet explorer.
|
10
|
+
// More information on [hasLayout](http://reference.sitepoint.com/css/haslayout).
|
11
|
+
@mixin has-layout($approach: $default-has-layout-approach) {
|
12
|
+
@if $legacy-support-for-ie {
|
13
|
+
@if $approach == zoom {
|
14
|
+
@include has-layout-zoom;
|
15
|
+
} @else if $approach == block {
|
16
|
+
@include has-layout-block;
|
17
|
+
} @else {
|
18
|
+
@warn "Unknown has-layout approach: #{$approach}";
|
19
|
+
@include has-layout-zoom;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
@mixin has-layout-zoom {
|
25
|
+
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
|
26
|
+
*zoom: 1;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
@mixin has-layout-block {
|
31
|
+
@if $legacy-support-for-ie {
|
32
|
+
// This makes ie6 get layout
|
33
|
+
display: inline-block;
|
34
|
+
// and this puts it back to block
|
35
|
+
& { display: block; }
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
// A hack to supply IE6 (and below) with a different property value.
|
40
|
+
// [Read more](http://www.cssportal.com/css-hacks/#in_css-important).
|
41
|
+
@mixin bang-hack($property, $value, $ie6-value) {
|
42
|
+
@if $legacy-support-for-ie6 {
|
43
|
+
#{$property}: #{$value} !important;
|
44
|
+
#{$property}: #{$ie6-value};
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
@import "hacks";
|
2
|
+
|
3
|
+
//**
|
4
|
+
// Cross browser min-height mixin.
|
5
|
+
@mixin min-height($value) {
|
6
|
+
@include hacked-minimum(height, $value); }
|
7
|
+
|
8
|
+
//**
|
9
|
+
// Cross browser min-width mixin.
|
10
|
+
@mixin min-width($value) {
|
11
|
+
@include hacked-minimum(width, $value); }
|
12
|
+
|
13
|
+
// @private This mixin is not meant to be used directly.
|
14
|
+
@mixin hacked-minimum($property, $value) {
|
15
|
+
min-#{$property}: $value;
|
16
|
+
@include bang-hack($property, auto, $value); }
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Emits styles for a tag cloud
|
2
|
+
@mixin tag-cloud($base-size: 1em) {
|
3
|
+
font-size: $base-size;
|
4
|
+
line-height: 1.2 * $base-size;
|
5
|
+
.xxs, .xs, .s, .l, .xl, .xxl {
|
6
|
+
line-height: 1.2 * $base-size; }
|
7
|
+
.xxs {
|
8
|
+
font-size: $base-size / 2; }
|
9
|
+
.xs {
|
10
|
+
font-size: 2 * $base-size / 3; }
|
11
|
+
.s {
|
12
|
+
font-size: 3 * $base-size / 4; }
|
13
|
+
.l {
|
14
|
+
font-size: 4 * $base-size / 3; }
|
15
|
+
.xl {
|
16
|
+
font-size: 3 * $base-size / 2; }
|
17
|
+
.xxl {
|
18
|
+
font-size: 2 * $base-size; } }
|
@@ -0,0 +1,66 @@
|
|
1
|
+
// Determines those states for which you want to enable magic sprite selectors
|
2
|
+
$sprite-selectors: hover, target, active !default;
|
3
|
+
|
4
|
+
// Set the width and height of an element to the original
|
5
|
+
// dimensions of an image before it was included in the sprite.
|
6
|
+
@mixin sprite-dimensions($map, $sprite) {
|
7
|
+
height: image-height(sprite-file($map, $sprite));
|
8
|
+
width: image-width(sprite-file($map, $sprite));
|
9
|
+
}
|
10
|
+
|
11
|
+
// Set the background position of the given sprite `$map` to display the
|
12
|
+
// sprite of the given `$sprite` name. You can move the image relative to its
|
13
|
+
// natural position by passing `$offset-x` and `$offset-y`.
|
14
|
+
@mixin sprite-background-position($map, $sprite, $offset-x: 0, $offset-y: 0) {
|
15
|
+
background-position: sprite-position($map, $sprite, $offset-x, $offset-y);
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
// Determines if you want to include magic selectors in your sprites
|
20
|
+
$disable-magic-sprite-selectors:false !default;
|
21
|
+
|
22
|
+
// Include the position and (optionally) dimensions of this `$sprite`
|
23
|
+
// in the given sprite `$map`. The sprite url should come from either a base
|
24
|
+
// class or you can specify the `sprite-url` explicitly like this:
|
25
|
+
//
|
26
|
+
// background: $map no-repeat;
|
27
|
+
@mixin sprite($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0) {
|
28
|
+
@include sprite-background-position($map, $sprite, $offset-x, $offset-y);
|
29
|
+
@if $dimensions {
|
30
|
+
@include sprite-dimensions($map, $sprite);
|
31
|
+
}
|
32
|
+
@if not $disable-magic-sprite-selectors {
|
33
|
+
@include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
// Include the selectors for the `$sprite` given the `$map` and the
|
38
|
+
// `$full-sprite-name`
|
39
|
+
// @private
|
40
|
+
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0, $offset-y: 0) {
|
41
|
+
@each $selector in $sprite-selectors {
|
42
|
+
@if sprite_has_selector($map, $sprite-name, $selector) {
|
43
|
+
&:#{$selector}, &.#{$full-sprite-name}_#{$selector}, &.#{$full-sprite-name}-#{$selector} {
|
44
|
+
@include sprite-background-position($map, "#{$sprite-name}_#{$selector}", $offset-x, $offset-y);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
// Generates a class for each space separated name in `$sprite-names`.
|
51
|
+
// The class will be of the form .<map-name>-<sprite-name>.
|
52
|
+
//
|
53
|
+
// If a base class is provided, then each class will extend it.
|
54
|
+
//
|
55
|
+
// If `$dimensions` is `true`, the sprite dimensions will specified.
|
56
|
+
@mixin sprites($map, $sprite-names, $base-class: false, $dimensions: false, $prefix: sprite-map-name($map), $offset-x: 0, $offset-y: 0) {
|
57
|
+
@each $sprite-name in $sprite-names {
|
58
|
+
@if sprite_does_not_have_parent($map, $sprite-name) {
|
59
|
+
$full-sprite-name: "#{$prefix}-#{$sprite-name}";
|
60
|
+
.#{$full-sprite-name} {
|
61
|
+
@if $base-class { @extend #{$base-class}; }
|
62
|
+
@include sprite($map, $sprite-name, $dimensions, $offset-x, $offset-y);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
// @doc off
|
2
|
+
// Example 1:
|
3
|
+
//
|
4
|
+
// a.twitter
|
5
|
+
// +sprite-img("icons-32.png", 1)
|
6
|
+
// a.facebook
|
7
|
+
// +sprite-img("icons-32png", 2)
|
8
|
+
//
|
9
|
+
// Example 2:
|
10
|
+
//
|
11
|
+
// a
|
12
|
+
// +sprite-background("icons-32.png")
|
13
|
+
// a.twitter
|
14
|
+
// +sprite-column(1)
|
15
|
+
// a.facebook
|
16
|
+
// +sprite-row(2)
|
17
|
+
// @doc on
|
18
|
+
|
19
|
+
$sprite-default-size: 32px !default;
|
20
|
+
|
21
|
+
$sprite-default-margin: 0px !default;
|
22
|
+
|
23
|
+
$sprite-image-default-width: $sprite-default-size !default;
|
24
|
+
|
25
|
+
$sprite-image-default-height: $sprite-default-size !default;
|
26
|
+
|
27
|
+
// Sets all the rules for a sprite from a given sprite image to show just one of the sprites.
|
28
|
+
// To reduce duplication use a sprite-bg mixin for common properties and a sprite-select mixin for positioning.
|
29
|
+
@mixin sprite-img($img, $col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
|
30
|
+
@include sprite-background($img, $width, $height);
|
31
|
+
@include sprite-position($col, $row, $width, $height, $margin);
|
32
|
+
}
|
33
|
+
|
34
|
+
// Sets rules common for all sprites, assumes you want a square, but allows a rectangular region.
|
35
|
+
@mixin sprite-background($img, $width: $sprite-default-size, $height: $width) {
|
36
|
+
@include sprite-background-rectangle($img, $width, $height);
|
37
|
+
}
|
38
|
+
|
39
|
+
// Sets rules common for all sprites, assumes a rectangular region.
|
40
|
+
@mixin sprite-background-rectangle($img, $width: $sprite-image-default-width, $height: $sprite-image-default-height) {
|
41
|
+
background: image-url($img) no-repeat;
|
42
|
+
width: $width;
|
43
|
+
height: $height;
|
44
|
+
overflow: hidden;
|
45
|
+
}
|
46
|
+
|
47
|
+
// Allows horizontal sprite positioning optimized for a single row of sprites.
|
48
|
+
@mixin sprite-column($col, $width: $sprite-image-default-width, $margin: $sprite-default-margin) {
|
49
|
+
@include sprite-position($col, 1, $width, 0px, $margin);
|
50
|
+
}
|
51
|
+
|
52
|
+
// Allows vertical sprite positioning optimized for a single column of sprites.
|
53
|
+
@mixin sprite-row($row, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
|
54
|
+
@include sprite-position(1, $row, 0px, $height, $margin);
|
55
|
+
}
|
56
|
+
|
57
|
+
// Allows vertical and horizontal sprite positioning from a grid of equal dimensioned sprites.
|
58
|
+
@mixin sprite-position($col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
|
59
|
+
$x: ($col - 1) * -$width - ($col - 1) * $margin;
|
60
|
+
$y: ($row - 1) * -$height - ($row - 1) * $margin;
|
61
|
+
background-position: $x $y;
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
// Similar to 'sprite-replace-text-with-dimensions' but does not autmaticly set the demensions
|
67
|
+
@mixin sprite-replace-text ($map, $sprite, $dimensions: false, $offset-x: 0, $offset-y: 0) {
|
68
|
+
@include hide-text;
|
69
|
+
@include sprite($map, $sprite, $dimensions, $offset-x, $offset-y);
|
70
|
+
background-image: $map;
|
71
|
+
background-repeat: no-repeat;
|
72
|
+
}
|
73
|
+
|
74
|
+
// Similar to 'replace-text-with-dimensions' but with sprites
|
75
|
+
// To use, create your sprite and then pass it in the `$map` param
|
76
|
+
// The name of the image in the sprite folder should be `$img-name`
|
77
|
+
@mixin sprite-replace-text-with-dimensions ($map, $sprite, $offset-x: 0, $offset-y: 0){
|
78
|
+
@include sprite-replace-text ($map, $sprite, true, $offset-x, $offset-y);
|
79
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
@mixin alternating-rows-and-columns($even-row-color, $odd-row-color, $dark-intersection, $header-color: white, $footer-color: white) {
|
2
|
+
th {
|
3
|
+
background-color: $header-color;
|
4
|
+
&.even, &:nth-child(2n) {
|
5
|
+
background-color: $header-color - $dark-intersection; } }
|
6
|
+
tr {
|
7
|
+
&.odd, &:nth-child(2n+1) {
|
8
|
+
td {
|
9
|
+
background-color: $odd-row-color;
|
10
|
+
&.even, &:nth-child(2n) {
|
11
|
+
background-color: $odd-row-color - $dark-intersection; } } }
|
12
|
+
}
|
13
|
+
tr.even {
|
14
|
+
td {
|
15
|
+
background-color: $even-row-color;
|
16
|
+
&.even, &:nth-child(2n) {
|
17
|
+
background-color: $even-row-color - $dark-intersection; } } }
|
18
|
+
tfoot {
|
19
|
+
th, td {
|
20
|
+
background-color: $footer-color;
|
21
|
+
&.even, &:nth-child(2n) {
|
22
|
+
background-color: $footer-color - $dark-intersection; } } } }
|
@@ -0,0 +1,33 @@
|
|
1
|
+
@mixin outer-table-borders($width: 2px, $color: black) {
|
2
|
+
border: $width solid $color;
|
3
|
+
thead {
|
4
|
+
th {
|
5
|
+
border-bottom: $width solid $color; } }
|
6
|
+
tfoot {
|
7
|
+
th, td {
|
8
|
+
border-top: $width solid $color; } }
|
9
|
+
th {
|
10
|
+
&:first-child {
|
11
|
+
border-right: $width solid $color; } } }
|
12
|
+
|
13
|
+
@mixin inner-table-borders($width: 2px, $color: black) {
|
14
|
+
th, td {
|
15
|
+
border: {
|
16
|
+
right: $width solid $color;
|
17
|
+
bottom: $width solid $color;
|
18
|
+
left-width: 0px;
|
19
|
+
top-width: 0px; };
|
20
|
+
&:last-child,
|
21
|
+
&.last {
|
22
|
+
border-right-width: 0px; } }
|
23
|
+
|
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
|
26
|
+
|
27
|
+
tbody, tfoot {
|
28
|
+
tr:last-child {
|
29
|
+
th, td {
|
30
|
+
border-bottom-width: 0px; } }
|
31
|
+
tr.last {
|
32
|
+
th, td {
|
33
|
+
border-bottom-width: 0px; } } } }
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'simple-compass/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "simple-compass"
|
8
|
+
gem.version = Compass::VERSION
|
9
|
+
gem.authors = ["Keith Pitt"]
|
10
|
+
gem.email = ["me@keithpit.com"]
|
11
|
+
gem.description = %q{}
|
12
|
+
gem.summary = %q{}
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency 'sass'
|
21
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "compass/reset"
|