grid-coordinates 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.mdown CHANGED
@@ -1,71 +1,88 @@
1
- # Grid Coordinates - Sass CSS Grid Framework Generator (Compass Extension)
1
+ # Grid Coordinates
2
2
 
3
- Grid Coordinates is a [Sass](http://sass-lang.com/) CSS Grid Framework Generator delivered as a [Compass](http://compass-style.org/) extension. This project was inspired by Tyler Tate's [1kb CSS Grid](http://1kbgrid.com/) project.
3
+ ## Sass based CSS Grid Framework Generator (Compass Extension)
4
4
 
5
- Grid Coordinates is quite simple. It fully leverages both classes and extends to set up the styles for your CSS grid framework. Grid Coordinates even supports nested grids and prefix and suffix features. It's also able to generate styles for grids of any size - you control the coordinates and it generates the styles.
5
+ Grid Coordinates is a Highly configurable [Sass](http://sass-lang.com/) based CSS Grid Framework Generator delivered as a [Compass](http://compass-style.org/) extension inspired by the [1kb CSS Grid](http://1kbgrid.com/) project by [Tyler Tate](http://twitter.com/tylertate).
6
+
7
+ ## Just the grid please.
8
+
9
+ Grid Coordinates is quite simple. It's just a grid. And it is able to generate styles for grids of any size - you control the coordinates and it generates the styles.
10
+
11
+ It fully leverages classes, extends and mixins (if that's your preference) to set up the styles for your grid. It supports nested grids, prefix and suffix grid features as well as push and pull grid features.
6
12
 
7
13
  ## Installation
8
14
 
9
- `sudo gem install grid-coordinates`
15
+ `gem install grid-coordinates`
10
16
 
11
- Add `require 'grid-coordinates'` to your Compass config file.
17
+ Then add `require 'grid-coordinates'` to your Compass config file.
12
18
 
13
19
  ## Usage
14
20
 
15
- Grid-coordinates defaults to the 960px grid with 12 columns (12 columns at 60px with a gutter of 20px). You can override these variables as needed in your project if this grid doesn't suit your needs.
21
+ Grid-coordinates defaults to create a 960 pixel grid with 12 columns and a 60px gutter. You can override these defaults in your project if this grid doesn't suit your needs.
16
22
 
17
- Use [1kbgrid.com](http://1kbgrid.com) or another grid generator for guidance on the various grid coordinates possible.
23
+ Use [1kbgrid.com](http://1kbgrid.com) or another grid generator for guidance on configuring your grid's settings.
18
24
 
19
- See `templates/project/screen.sass` for an example.
25
+ Take a peek at [grid-coordinates.com/.../demo.sass](https://github.com/adamstac/grid-coordinates.com/blob/master/themes/grid-coordinates/sass/demo.sass) for a demonstration of how to use Grid Coordinates as well its [output CSS](https://github.com/adamstac/grid-coordinates.com/blob/master/themes/grid-coordinates/public/grid-coordinates/css/demo.css).
20
26
 
21
27
  ### Configure as needed and import
22
28
 
23
29
  // Configure grid coordinates
24
- $grid-columns: 12 !default
25
- $grid-width: 60px !default
26
- $grid-gutter-width: 20px !default
27
- $overflow-allowed: false !default
30
+ $grid-columns: 24
31
+ $grid-width: 60px
32
+ $grid-gutter-width: 10px
33
+ // Set to true by default
34
+ $overflow-allowed: false
28
35
 
29
36
  @import grid-coordinates
30
37
 
31
- // Only needed if you're using the classes instead of the mixins
32
- @include grid-coordinates
38
+ // Only needed if you're using the classes and `@extend` instead of the mixins (suggested)
39
+ +grid-coordinates
33
40
 
34
41
  ...
35
42
 
36
- The `$overflow-allowed` setting controls which of Compass' two clearfix mixins is used. The default setting, false, will clip any content that overflows a grid block. If you need overflowing content to remain visible (i.e., a drop-down menu inside a grid block) change this setting the true.
43
+ The `$overflow-allowed` setting controls which of Compass' two clearfix mixins to be used, `+clearfix` or `+pie-clearfix`. The default setting is set to `true` and will not clip any content that overflows a grid block. If for some reason you need to clip overflowing content update this setting to `false`.
37
44
 
38
- ### Using the Mixins
45
+ ### Using classes and `@extend`
46
+
47
+ When you use the mixin `+grid-coordinates` you are able to leverage the classes in your HTML or use the Sass `extend` option to "extend" the classes in your Sass stylesheets.
39
48
 
40
- Use these mixins in your Sass stylesheets. For an example of this in use, see `templates/project`.
49
+ For an example of this in use, take a peek at [grid-coordinates.com/.../demo.sass](https://github.com/adamstac/grid-coordinates.com/blob/master/themes/grid-coordinates/sass/demo.sass).
41
50
 
42
- `@include grid-container`
51
+ `@extend grid-container`
43
52
 
44
- `@include nested-grid-container`
53
+ `@extend nested-grid-container`
45
54
 
46
- `@include grid(4)`
55
+ `@extend grid([columns])`
47
56
 
48
- `@include grid-prefix(4)`
57
+ `@extend grid-prefix([columns])`
49
58
 
50
- `@include grid-suffix(4)`
59
+ `@extend grid-suffix([columns])`
60
+
61
+ `@extend grid-push([columns])`
62
+
63
+ `@extend grid-pull([columns])`
64
+
65
+ `@extend grid-full`
66
+
67
+ ### Using the Mixins
51
68
 
52
- `@include grid-full`
69
+ Use these mixins in your Sass stylesheets. Keep in mind that when you go the route of using mixins you are replicated much code in your output CSS. It's advised that you to learn the [Sass extend concept](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend) and use that method vs mixins. Your output CSS code with thank you.
53
70
 
54
- ### Using the Classes
71
+ `+grid-container`
55
72
 
56
- Use the extend classes in your HTML or use them to extend in your Sass stylesheets. For an example of this in use, see `templates/project`.
73
+ `+nested-grid-container`
57
74
 
58
- `@extend .grid-container`
75
+ `+grid([columns])`
59
76
 
60
- `@extend .nested-grid-container`
77
+ `+grid-prefix([columns])`
61
78
 
62
- `@extend .grid-4`
79
+ `+grid-suffix([columns])`
63
80
 
64
- `@extend .grid-prefix-4`
81
+ `+grid-push([columns])`
65
82
 
66
- `@extend .grid-suffix-4`
83
+ `+grid-pull([columns])`
67
84
 
68
- `@extend .grid-full`
85
+ `+grid-full`
69
86
 
70
87
  ## License
71
88
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -5,6 +5,6 @@ Compass::Frameworks.register("grid-coordinates", :path => "#{File.dirname(__FILE
5
5
 
6
6
  module GridCoordinates
7
7
 
8
- VERSION = "1.1.0".freeze
8
+ VERSION = "1.1.1".freeze
9
9
 
10
10
  end
@@ -4,7 +4,7 @@
4
4
  $grid-columns: 12 !default
5
5
  $grid-width: 60px !default
6
6
  $grid-gutter-width: 20px !default
7
- $overflow-allowed: false !default
7
+ $overflow-allowed: true !default
8
8
 
9
9
  =grid-coordinates
10
10
  .grid-container
@@ -24,47 +24,51 @@ $overflow-allowed: false !default
24
24
  @for $i from 1 through $grid-columns - 1
25
25
  .grid-suffix-#{$i}
26
26
  +grid-suffix($i)
27
+ @for $i from 1 through $grid-columns - 1
28
+ .grid-push-#{$i}
29
+ +grid-push($i)
30
+ @for $i from 1 through $grid-columns - 1
31
+ .grid-pull-#{$i}
32
+ +grid-pull($i)
27
33
 
28
- =grid-container
29
- margin: 0 auto
30
- @if $overflow-allowed
34
+ =overflow-allowed($boolean: $overflow-allowed)
35
+ @if $boolean
31
36
  +pie-clearfix
32
37
  @else
33
38
  +clearfix
39
+
40
+ =grid-container
41
+ +overflow-allowed
42
+ margin: 0 auto
34
43
  width: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width
35
44
 
36
45
  =nested-grid-container
46
+ +overflow-allowed
37
47
  display: inline-block
38
48
  margin:
39
49
  left: -$grid-gutter-width / 2
40
50
  right: -$grid-gutter-width / 2
41
- @if $overflow-allowed
42
- +pie-clearfix
43
- @else
44
- +clearfix
45
51
  width: auto
46
52
 
47
53
  =grid-block
48
54
  +float-left
49
- @if $overflow-allowed
50
- +pie-clearfix
51
- @else
52
- +clearfix
55
+ +overflow-allowed
53
56
  margin: 0 $grid-gutter-width / 2
54
57
 
55
58
  =grid($grid-columns)
59
+ position: relative
56
60
  +grid-width($grid-columns)
57
61
  +grid-block
58
62
 
63
+ =grid-full
64
+ +grid($grid-columns)
65
+
59
66
  =grid-width($grid-columns)
60
67
  @if $grid-columns == 1
61
68
  width: $grid-width
62
69
  @else
63
70
  width: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width - $grid-gutter-width
64
71
 
65
- =grid-full
66
- +grid($grid-columns)
67
-
68
72
  =grid-prefix($grid-columns)
69
73
  @if $grid-columns == 1
70
74
  padding-left: $grid-width + $grid-gutter-width
@@ -76,3 +80,15 @@ $overflow-allowed: false !default
76
80
  padding-right: $grid-width + $grid-gutter-width
77
81
  @else
78
82
  padding-right: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width
83
+
84
+ =grid-push($grid-columns)
85
+ @if $grid-columns == 1
86
+ left: $grid-width + $grid-gutter-width
87
+ @else
88
+ left: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width
89
+
90
+ =grid-pull($grid-columns)
91
+ @if $grid-columns == 1
92
+ left: -$grid-width + $grid-gutter-width
93
+ @else
94
+ left: -$grid-columns * $grid-width + $grid-columns * $grid-gutter-width
@@ -4,7 +4,7 @@
4
4
  $grid-columns: 12 !default;
5
5
  $grid-width: 60px !default;
6
6
  $grid-gutter-width: 20px !default;
7
- $overflow-allowed: false !default;
7
+ $overflow-allowed: true !default;
8
8
 
9
9
  @mixin grid-coordinates {
10
10
  .grid-container {
@@ -23,48 +23,52 @@ $overflow-allowed: false !default;
23
23
  @include grid-prefix($i); } }
24
24
  @for $i from 1 through $grid-columns - 1 {
25
25
  .grid-suffix-#{$i} {
26
- @include grid-suffix($i); } } }
26
+ @include grid-suffix($i); } }
27
+ @for $i from 1 through $grid-columns - 1 {
28
+ .grid-push-#{$i} {
29
+ @include grid-push($i); } }
30
+ @for $i from 1 through $grid-columns - 1 {
31
+ .grid-pull-#{$i} {
32
+ @include grid-pull($i); } } }
27
33
 
28
- @mixin grid-container {
29
- margin: 0 auto;
30
- @if $overflow-allowed {
34
+ @mixin overflow-allowed($boolean: $overflow-allowed) {
35
+ @if $boolean {
31
36
  @include pie-clearfix; }
32
37
  @else {
33
- @include clearfix; }
38
+ @include clearfix; } }
39
+
40
+ @mixin grid-container {
41
+ @include overflow-allowed;
42
+ margin: 0 auto;
34
43
  width: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width; }
35
44
 
36
45
  @mixin nested-grid-container {
46
+ @include overflow-allowed;
37
47
  display: inline-block;
38
48
  margin: {
39
49
  left: -$grid-gutter-width / 2;
40
50
  right: -$grid-gutter-width / 2; };
41
- @if $overflow-allowed {
42
- @include pie-clearfix; }
43
- @else {
44
- @include clearfix; }
45
51
  width: auto; }
46
52
 
47
53
  @mixin grid-block {
48
54
  @include float-left;
49
- @if $overflow-allowed {
50
- @include pie-clearfix; }
51
- @else {
52
- @include clearfix; }
55
+ @include overflow-allowed;
53
56
  margin: 0 $grid-gutter-width / 2; }
54
57
 
55
58
  @mixin grid($grid-columns) {
59
+ position: relative;
56
60
  @include grid-width($grid-columns);
57
61
  @include grid-block; }
58
62
 
63
+ @mixin grid-full {
64
+ @include grid($grid-columns); }
65
+
59
66
  @mixin grid-width($grid-columns) {
60
67
  @if $grid-columns == 1 {
61
68
  width: $grid-width; }
62
69
  @else {
63
70
  width: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width - $grid-gutter-width; } }
64
71
 
65
- @mixin grid-full {
66
- @include grid($grid-columns); }
67
-
68
72
  @mixin grid-prefix($grid-columns) {
69
73
  @if $grid-columns == 1 {
70
74
  padding-left: $grid-width + $grid-gutter-width; }
@@ -76,3 +80,15 @@ $overflow-allowed: false !default;
76
80
  padding-right: $grid-width + $grid-gutter-width; }
77
81
  @else {
78
82
  padding-right: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width; } }
83
+
84
+ @mixin grid-push($grid-columns) {
85
+ @if $grid-columns == 1 {
86
+ left: $grid-width + $grid-gutter-width; }
87
+ @else {
88
+ left: $grid-columns * $grid-width + $grid-columns * $grid-gutter-width; } }
89
+
90
+ @mixin grid-pull($grid-columns) {
91
+ @if $grid-columns == 1 {
92
+ left: -$grid-width + $grid-gutter-width; }
93
+ @else {
94
+ left: -$grid-columns * $grid-width + $grid-columns * $grid-gutter-width; } }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid-coordinates
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Stacoviak