compass-grid-plugin 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/compass/grid/version.rb +1 -1
- data/stylesheets/_grid.scss +1 -1
- data/stylesheets/grid/_fluid.scss +21 -3
- metadata +4 -4
- data/stylesheets/grid/fluid/_helpers.scss +0 -14
data/lib/compass/grid/version.rb
CHANGED
data/stylesheets/_grid.scss
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
|
4
4
|
// Ensure grid is included
|
5
5
|
@import "../../stylesheets/grid";
|
6
|
-
@import "../../stylesheets/grid/fluid/helpers";
|
7
6
|
|
8
7
|
//-----------------------------------
|
9
8
|
// Defaults
|
10
9
|
//-----------------------------------
|
11
10
|
$fluid-support-for-ie7: false !default;
|
11
|
+
$fluid-debug: false !default;
|
12
12
|
|
13
13
|
//-----------------------------------
|
14
14
|
// Column Widths
|
@@ -16,6 +16,8 @@ $fluid-support-for-ie7: false !default;
|
|
16
16
|
|
17
17
|
// apply a width to a column
|
18
18
|
@mixin fluid($i, $plus: 0, $context: $grid-columns, $context-plus: 0, $with-gutters: false) {
|
19
|
+
@if $fluid-debug { @debug "@mixin fluid", $i, $plus, $context, $context-plus, $with-gutters; }
|
20
|
+
|
19
21
|
width: fluid-column-width($i, $plus, $context, $context-plus);
|
20
22
|
@if $fluid-support-for-ie7 {
|
21
23
|
*width: fluid-column-width($i, $plus, $context, $context-plus, $nudge: true);
|
@@ -25,6 +27,8 @@ $fluid-support-for-ie7: false !default;
|
|
25
27
|
|
26
28
|
// apply standard gutters to a column or row
|
27
29
|
@mixin fluid-gutters($context: $grid-columns, $context-plus: 0, $row: false) {
|
30
|
+
@if $fluid-debug { @debug "@mixin fluid-gutters", $context, $context-plus, $row; }
|
31
|
+
|
28
32
|
margin: 0 fluid-gutter-width($context, $context-plus, $row);
|
29
33
|
@if $fluid-support-for-ie7 {
|
30
34
|
*margin: 0 fluid-gutter-width($context, $context-plus, $row, $nudge: true);
|
@@ -39,16 +43,22 @@ $fluid-support-for-ie7: false !default;
|
|
39
43
|
|
40
44
|
// return a percentage column width relative to a row width
|
41
45
|
@function fluid-column-width($i, $plus: 0, $context: $grid-columns, $context-plus: 0, $nudge: false) {
|
46
|
+
@if $fluid-debug { @debug "@function fluid-column-width", $i, $plus, $context, $context-plus, $nudge; }
|
47
|
+
|
42
48
|
@return fluid-width(grid-column-width($i, $plus), grid-row-width($context, $context-plus), $nudge);
|
43
49
|
}
|
44
50
|
|
45
51
|
// return a percentage gutter width relative to a column or row width
|
46
52
|
@function fluid-gutter-width($context: $grid-columns, $context-plus: 0, $row: false, $nudge: false) {
|
47
|
-
@
|
53
|
+
@if $fluid-debug { @debug "@function fluid-gutter-width", $context, $context-plus, $row, $nudge; }
|
54
|
+
|
55
|
+
@return fluid-width($grid-gutter-width / 2 * if($row, -1, 1), grid-row-width($context, $context-plus + if($row, -$grid-gutter-width, 0)), $nudge);
|
48
56
|
}
|
49
57
|
|
50
58
|
// return a percentage width relative to a parent width
|
51
59
|
@function fluid-width($width, $context-width: grid-column-width($grid-columns, $grid-gutter-width), $nudge: false) {
|
60
|
+
@if $fluid-debug { @debug "@function fluid-width", $width, $context-width, $nudge; }
|
61
|
+
|
52
62
|
@return percentage($width / $context-width) + if($nudge, fluid-nudge($context-width), 0);
|
53
63
|
}
|
54
64
|
|
@@ -64,6 +74,8 @@ $fluid-support-for-ie7: false !default;
|
|
64
74
|
|
65
75
|
// specify a container as a page
|
66
76
|
@mixin fluid-page($i: $grid-columns, $plus: 0, $use-max-width: true) {
|
77
|
+
@if $fluid-debug { @debug "@mixin fluid-page", $i, $plus, $use-max-width; }
|
78
|
+
|
67
79
|
@extend .clearfix;
|
68
80
|
@include box-sizing(border-box);
|
69
81
|
@if $use-max-width { max-width: grid-column-width($i, $plus + $grid-gutter-width); }
|
@@ -73,6 +85,8 @@ $fluid-support-for-ie7: false !default;
|
|
73
85
|
|
74
86
|
// specify a container as a row
|
75
87
|
@mixin fluid-row($page: false, $context: $grid-columns, $context-plus: 0) {
|
88
|
+
@if $fluid-debug { @debug "@mixin fluid-row", $page, $context, $context-plus; }
|
89
|
+
|
76
90
|
@extend .clearfix;
|
77
91
|
@include box-sizing(border-box);
|
78
92
|
width: auto;
|
@@ -91,6 +105,8 @@ $fluid-support-for-ie7: false !default;
|
|
91
105
|
|
92
106
|
// specify a column
|
93
107
|
@mixin fluid-column($i: false, $plus: 0, $context: $grid-columns, $context-plus: 0, $with-gutters: true) {
|
108
|
+
@if $fluid-debug { @debug "@mixin fluid-column", $i, $plus, $context, $context-plus, $with-gutters; }
|
109
|
+
|
94
110
|
@include box-sizing(border-box);
|
95
111
|
float: left;
|
96
112
|
@if $grid-support-for-ie6 { _display: inline; }
|
@@ -102,7 +118,9 @@ $fluid-support-for-ie7: false !default;
|
|
102
118
|
|
103
119
|
// alter the margins of a column
|
104
120
|
@mixin fluid-offset($i: 1, $plus: 0, $side: left, $context: $grid-columns, $context-plus: 0) {
|
105
|
-
|
121
|
+
@if $fluid-debug { @debug "@mixin fluid-column", $i, $plus, $side, $context, $context-plus; }
|
122
|
+
|
123
|
+
margin-#{$side}: (fluid-column-width($i, $plus, $context, $context-plus) + fluid-gutter-width($context, $context-plus) * 3);
|
106
124
|
@if $fluid-support-for-ie7 {
|
107
125
|
*margin-#{$side}: (fluid-column-width($i, $plus, $context, $context-plus, $nudge: nudge) + fluid-gutter-width($context, $context-plus, $nudge: nudge) * 3);
|
108
126
|
}
|
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.5
|
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-05-
|
12
|
+
date: 2012-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: compass
|
@@ -57,7 +57,6 @@ files:
|
|
57
57
|
- lib/compass/grid/version.rb
|
58
58
|
- stylesheets/_grid.scss
|
59
59
|
- stylesheets/grid/_fluid.scss
|
60
|
-
- stylesheets/grid/fluid/_helpers.scss
|
61
60
|
- templates/project/manifest.rb
|
62
61
|
- templates/project/partials/_base.scss
|
63
62
|
- templates/project/screen.scss
|
@@ -81,8 +80,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
80
|
version: '0'
|
82
81
|
requirements: []
|
83
82
|
rubyforge_project:
|
84
|
-
rubygems_version: 1.8.
|
83
|
+
rubygems_version: 1.8.24
|
85
84
|
signing_key:
|
86
85
|
specification_version: 3
|
87
86
|
summary: Compass grid extension inspired by the 1KB CSS Grid
|
88
87
|
test_files: []
|
88
|
+
has_rdoc:
|
@@ -1,14 +0,0 @@
|
|
1
|
-
|
2
|
-
// Force Sass to return a decimal to the current precision
|
3
|
-
@function real-percentage($a, $b) {
|
4
|
-
$prec: pow(10, precision());
|
5
|
-
@return round($a / $b * $prec) / $prec;
|
6
|
-
}
|
7
|
-
|
8
|
-
// Return the nth item in a list or a default value
|
9
|
-
@function nth-else($list, $n, $else: false) {
|
10
|
-
@if type-of($list) != list {
|
11
|
-
@return if($n == 1, $list, $else);
|
12
|
-
}
|
13
|
-
@return if($n <= length($list), nth($list, $n), $else);
|
14
|
-
}
|