compass-grid-plugin 0.0.5 → 0.0.6
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.md +7 -4
- data/example/scss/fixed.scss +6 -1
- data/lib/compass/grid/version.rb +1 -1
- data/stylesheets/_grid.scss +25 -18
- data/stylesheets/grid/_fluid.scss +4 -4
- metadata +2 -2
data/README.md
CHANGED
@@ -44,6 +44,9 @@ The primary grid is a fixed, pixel grid. This grid is ideal for designs that do
|
|
44
44
|
- **$grid-column-width**: *60px* - The width of 1 column
|
45
45
|
- **$grid-gutter-width**: *20px* - The space between 2 columns
|
46
46
|
- **$grid-columns**: *12* - The total number of columns
|
47
|
+
- **$grid-clearfix-extend:** *false* - Determines if clearfix is applied directly to pages and rows or if an `@extend` directive should be used. Extend directives can make the code more compact but will cause issues in [Sass 3.1.19](http://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html#3119) when `@media` queries are used.
|
48
|
+
- **$grid-clearfix-class:** *clearfix* - Sets the name of the clearfix class to extend if `$grid-clearfix-extend` is set to true.
|
49
|
+
- **$grid-clearfix-mixin:** *pie-clearfix* - Sets the mixin to use for the clearfix if `$grid-clearfix-extend` is set to false.
|
47
50
|
- **$grid-clearfix-class**: *true* - Create a `.clearfix` class to extend
|
48
51
|
- **$grid-support-for-ie6**: *false* - Apply fixes for IE6
|
49
52
|
|
@@ -54,9 +57,9 @@ The primary grid is a fixed, pixel grid. This grid is ideal for designs that do
|
|
54
57
|
|
55
58
|
### Mixins
|
56
59
|
- **grid(** *$i*, *[$plus: 0]*, *[$with-gutters: false]* **)** - Mixin for applying widths to a column. The `$plus` argument can be used to alter the width to account for borders or padding. The `$with-gutters` argument will optionally output the gutter margins in addition to the width.
|
57
|
-
- **grid-page(** *[$i: $grid-columns]*, *[$plus: 0]* **)** - Mixin for declaring a page element. `$i` is `$grid-columns` by default but can be altered. The `$plus` argument can be used to alter the width to account for borders or padding.
|
60
|
+
- **grid-page(** *[$i: $grid-columns]*, *[$plus: 0]*, *[$extend: $grid-clearfix-extend]* **)** - Mixin for declaring a page element. `$i` is `$grid-columns` by default but can be altered. The `$plus` argument can be used to alter the width to account for borders or padding.
|
58
61
|
- **grid-row(** *[$page: false]* **)** - Mixing for declaring a column container. The *$page* argument is removing the negative margins when directly inside a page element.
|
59
|
-
- **grid-column(** *[$i: false]*, *[$plus: 0]* **)** - Mixin for declaring a column. Specifying `$i` will call the `grid` mixin. The `$plus` argument is passed to the `grid` mixin if `$i` is also specified.
|
62
|
+
- **grid-column(** *[$i: false]*, *[$plus: 0]*, *[$extend: $grid-clearfix-extend]* **)** - Mixin for declaring a column. Specifying `$i` will call the `grid` mixin. The `$plus` argument is passed to the `grid` mixin if `$i` is also specified.
|
60
63
|
- **grid-gutters(** *[$row: false]* **)** - Mixin for adding gutter margins to a column or a row. The `$row` argument controls if the returned margins are negative. Rows require a negative margin.
|
61
64
|
- **grid-row-gutters( )** - Mixin for adding gutter margins to a row.
|
62
65
|
- **grid-column-gutters( )** - Mixin for adding gutter margins to a column.
|
@@ -85,8 +88,8 @@ The fluid grid uses the variables from the fixed grid module.
|
|
85
88
|
|
86
89
|
### Mixins
|
87
90
|
- **fluid(** *$i*, *[$plus: 0]*, *[$context: $grid-columns]*, *[$context-plus: 0]*, *[$with-gutters: false]* **)** - Mixin for applying widths to a column. The `$plus` argument can be used to alter the width to account for borders or padding. The `$with-gutters` argument will optionally output the gutter margins in addition to the width.
|
88
|
-
- **fluid-page(** *[$i: $grid-columns]*, *[$plus: 0]*, *[$use-max-width: true]* **)** - Mixin for declaring a page element. `$i` is `$grid-columns` by default but can be altered. The `$plus` argument can be used to alter the width to account for borders or padding. The `$use-max-width` determines if a pixel max-width is applied as well.
|
89
|
-
- **fluid-row(** *[$page: false]*, *[$context: $grid-columns]*, *[$context-plus: 0]* **)** - Mixin for declaring a column container. The `$page` argument is for removing the negative margins when a row is directly inside a page element.
|
91
|
+
- **fluid-page(** *[$i: $grid-columns]*, *[$plus: 0]*, *[$use-max-width: true]*, *[$extend: $grid-clearfix-extend]* **)** - Mixin for declaring a page element. `$i` is `$grid-columns` by default but can be altered. The `$plus` argument can be used to alter the width to account for borders or padding. The `$use-max-width` determines if a pixel max-width is applied as well.
|
92
|
+
- **fluid-row(** *[$page: false]*, *[$context: $grid-columns]*, *[$context-plus: 0]*, *[$extend: $grid-clearfix-extend]* **)** - Mixin for declaring a column container. The `$page` argument is for removing the negative margins when a row is directly inside a page element.
|
90
93
|
- **fluid-column(** *[$i: false]*, *[$plus: 0]*, *[$context: $grid-columns]*, *[$context-plus: 0]*, *[$with-gutters: true]* **)** - Mixin for declaring a column. Specifying `$i` will call the `grid` mixin. The `$plus` argument is passed to the *grid* mixin if `$i` is also specified. The `$with-gutters` argument can be used to omit the gutter margins.
|
91
94
|
- **fluid-offset(** *[$i: 1]*, *[$plus: 0]*, *[$side]*, *[$context: $grid-columns]*, *[$context-plus: 0]* **)** - Mixin for altering the left or right margin on a column. Useful for adding empty columns before or after a column. The `$i` argument specifies the width of the offset in columns. The `$plus` argument can be used to alter the width. `$side` can be right, left, top or bottom (although right and left are the most useful).
|
92
95
|
- **fluid-gutters(** *[$context: $grid-columns]*, *[$context-plus: 0]*, *[$row: false]* **)** - Mixin for adding gutter margins to a column or a row. The `$row` argument controls if the returned margins are negative. Rows require a negative margin.
|
data/example/scss/fixed.scss
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
// import the grid
|
2
|
-
@import "grid";
|
2
|
+
@import "../../stylesheets/grid";
|
3
|
+
$grid-clearfix-extend: true;
|
3
4
|
@include grid-css;
|
4
5
|
|
6
|
+
.clearfix {
|
7
|
+
@include grid-clearfix-rules;
|
8
|
+
}
|
9
|
+
|
5
10
|
.column {
|
6
11
|
background-color: #ccc;
|
7
12
|
margin-bottom: $grid-gutter-width;
|
data/lib/compass/grid/version.rb
CHANGED
data/stylesheets/_grid.scss
CHANGED
@@ -8,20 +8,27 @@ $grid-column-width: 60px !default;
|
|
8
8
|
$grid-gutter-width: 20px !default;
|
9
9
|
$grid-columns: 12 !default;
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
$grid-clearfix-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
$grid-clearfix-extend: false !default;
|
12
|
+
$grid-clearfix-class: clearfix !default; // clearfix
|
13
|
+
$grid-clearfix-mixin: pie-clearfix !default; // pie-clearfix
|
14
|
+
|
15
|
+
$grid-support-for-ie6: false !default; // apply fixes for IE6
|
16
|
+
|
17
|
+
@mixin grid-clearfix($clearfix-mixin: $grid-clearfix-mixin, $clearfix-extend: $grid-clearfix-extend) {
|
18
|
+
@if not($clearfix-extend) {
|
19
|
+
@include grid-clearfix-rules($clearfix-mixin);
|
20
|
+
} @else {
|
21
|
+
@extend .#{$grid-clearfix-class};
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
@mixin grid-clearfix-rules ($clearfix-mixin: $grid-clearfix-mixin) {
|
26
|
+
@if $clearfix-mixin == clearfix {
|
27
|
+
@include clearfix;
|
28
|
+
} @else if $clearfix-mixin == legacy-pie-clearfix {
|
29
|
+
@include legacy-pie-clearfix;
|
30
|
+
} @else {
|
31
|
+
@include pie-clearfix;
|
25
32
|
}
|
26
33
|
}
|
27
34
|
|
@@ -66,15 +73,15 @@ $grid-support-for-ie6: false !default;
|
|
66
73
|
//-----------------------------------
|
67
74
|
|
68
75
|
// specify a container as a page
|
69
|
-
@mixin grid-page($i: $grid-columns, $plus: 0) {
|
70
|
-
@
|
76
|
+
@mixin grid-page($i: $grid-columns, $plus: 0, $extend: $grid-clearfix-extend) {
|
77
|
+
@include grid-clearfix($extend);
|
71
78
|
width: grid-row-width($i, $plus);
|
72
79
|
margin: 0 auto;
|
73
80
|
}
|
74
81
|
|
75
82
|
// specify a container as a row
|
76
|
-
@mixin grid-row($page: false) {
|
77
|
-
@
|
83
|
+
@mixin grid-row($page: false, $extend: $grid-clearfix-extend) {
|
84
|
+
@include grid-clearfix($extend);
|
78
85
|
width: auto;
|
79
86
|
|
80
87
|
// rows directly inside a page don't need the negative margin
|
@@ -73,10 +73,10 @@ $fluid-debug: false !default;
|
|
73
73
|
//-----------------------------------
|
74
74
|
|
75
75
|
// specify a container as a page
|
76
|
-
@mixin fluid-page($i: $grid-columns, $plus: 0, $use-max-width: true) {
|
76
|
+
@mixin fluid-page($i: $grid-columns, $plus: 0, $use-max-width: true, $extend: $grid-clearfix-extend) {
|
77
77
|
@if $fluid-debug { @debug "@mixin fluid-page", $i, $plus, $use-max-width; }
|
78
78
|
|
79
|
-
@
|
79
|
+
@include grid-clearfix($extend);
|
80
80
|
@include box-sizing(border-box);
|
81
81
|
@if $use-max-width { max-width: grid-column-width($i, $plus + $grid-gutter-width); }
|
82
82
|
width: 100%;
|
@@ -84,10 +84,10 @@ $fluid-debug: false !default;
|
|
84
84
|
}
|
85
85
|
|
86
86
|
// specify a container as a row
|
87
|
-
@mixin fluid-row($page: false, $context: $grid-columns, $context-plus: 0) {
|
87
|
+
@mixin fluid-row($page: false, $context: $grid-columns, $context-plus: 0, $extend: $grid-clearfix-extend) {
|
88
88
|
@if $fluid-debug { @debug "@mixin fluid-row", $page, $context, $context-plus; }
|
89
89
|
|
90
|
-
@
|
90
|
+
@include grid-clearfix($extend);
|
91
91
|
@include box-sizing(border-box);
|
92
92
|
width: auto;
|
93
93
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-grid-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: compass
|