zen-grids 2.0.0.beta.1 → 2.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +7 -7
  2. data/.travis.yml +13 -0
  3. data/README.md +81 -0
  4. data/bower.json +14 -12
  5. data/sache.json +5 -0
  6. data/templates/project/_base-elements.scss +22 -0
  7. data/templates/project/_components.scss +73 -0
  8. data/templates/project/_init.scss +14 -4
  9. data/templates/project/_layouts.scss +143 -0
  10. data/templates/project/_visually-hidden.scss +2 -18
  11. data/templates/project/example.html +53 -24
  12. data/templates/project/manifest.rb +3 -2
  13. data/templates/project/styles.scss +3 -2
  14. data/tests/Gemfile +11 -0
  15. data/tests/README.md +16 -0
  16. data/tests/Rakefile +25 -0
  17. data/tests/config.rb +22 -0
  18. data/tests/controls/compass-compatibility.css +112 -0
  19. data/{templates/unit-tests/test-results → tests/controls}/function-zen-direction-switch.css +1 -1
  20. data/{templates/unit-tests/test-results → tests/controls}/function-zen-grid-item-width.css +0 -0
  21. data/{templates/unit-tests/test-results → tests/controls}/function-zen-half-gutter.css +0 -0
  22. data/{templates/unit-tests/test-results → tests/controls}/function-zen-unit-width.css +0 -0
  23. data/{templates/unit-tests/test-results → tests/controls}/zen-float.css +0 -0
  24. data/{templates/unit-tests/test-results/zen-grid-flow-item.css → tests/controls/zen-flow-item-width.css} +21 -55
  25. data/tests/controls/zen-grid-background.css +52 -0
  26. data/{templates/unit-tests/test-results → tests/controls}/zen-grid-container.css +20 -5
  27. data/{templates/unit-tests/test-results → tests/controls}/zen-grid-item-base.css +9 -12
  28. data/{templates/unit-tests/test-results → tests/controls}/zen-grid-item.css +14 -2
  29. data/{templates/unit-tests/test-results → tests/controls}/zen-new-row.css +0 -0
  30. data/tests/tests/compass-compatibility.scss +55 -0
  31. data/{templates/unit-tests/sass → tests/tests}/function-zen-direction-switch.scss +1 -0
  32. data/{templates/unit-tests/sass → tests/tests}/function-zen-grid-item-width.scss +6 -6
  33. data/{templates/unit-tests/sass → tests/tests}/function-zen-half-gutter.scss +2 -2
  34. data/{templates/unit-tests/sass → tests/tests}/function-zen-unit-width.scss +12 -12
  35. data/{templates/unit-tests/sass → tests/tests}/zen-float.scss +3 -3
  36. data/tests/tests/zen-flow-item-width.scss +85 -0
  37. data/tests/tests/zen-grid-background.scss +85 -0
  38. data/tests/tests/zen-grid-container.scss +49 -0
  39. data/tests/tests/zen-grid-item-base.scss +65 -0
  40. data/tests/tests/zen-grid-item.scss +101 -0
  41. data/{templates/unit-tests/sass → tests/tests}/zen-new-row.scss +3 -3
  42. data/tests/unit_tests.rb +57 -0
  43. data/zen-grids.gemspec +4 -45
  44. data/zen-grids/_background.scss +97 -157
  45. data/zen-grids/_flow.scss +39 -22
  46. data/zen-grids/_functions.scss +119 -0
  47. data/zen-grids/_grids.scss +71 -171
  48. data/zen-grids/_variables.scss +65 -0
  49. data/zen-grids/internal/_functions-compass-polyfill.scss +70 -0
  50. data/zen-grids/internal/_variables-background.scss +57 -0
  51. metadata +80 -69
  52. data/README.txt +0 -88
  53. data/templates/project/_layout.scss +0 -117
  54. data/templates/project/_modules.scss +0 -78
  55. data/templates/unit-tests/README.txt +0 -16
  56. data/templates/unit-tests/manifest.rb +0 -37
  57. data/templates/unit-tests/sass/zen-grid-background.scss +0 -80
  58. data/templates/unit-tests/sass/zen-grid-container.scss +0 -44
  59. data/templates/unit-tests/sass/zen-grid-flow-item.scss +0 -78
  60. data/templates/unit-tests/sass/zen-grid-item-base.scss +0 -59
  61. data/templates/unit-tests/sass/zen-grid-item.scss +0 -91
  62. data/templates/unit-tests/test-results/zen-grid-background.css +0 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA512:
3
- data.tar.gz: 4bcd3b36579863861624becf06b9e2ec0c292477777a948532f91a631ccb6571c8b0934ab5447f2c94b2c1db60f3c7b611a62dfd02406ecfc5e19b891b2e4ab4
4
- metadata.gz: 909a24fdc24b64ba0f0687994631ec8ad2c5d35cc927f29cc5d8678be9e1c4c2c8f3398c60a31bfb8a334b5b77fc53af78804062990a2b8e0b86444dfeb04ecc
5
- SHA1:
6
- data.tar.gz: a547ac3da8ebf402ba5f46533a9fceed2dc528d3
7
- metadata.gz: bda18f918d4cfac0b8b0b92eff76acf901a0bff6
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 81cf49e11ba72b0297fa7c6a7d343461a04cd7fb
4
+ data.tar.gz: 9cbeb9c3da2580d011d7a3b6e999b0eb0deea43a
5
+ SHA512:
6
+ metadata.gz: 6838aa469c56c868073050b99c6f964d0fdc58558ef65090045d74e23a87b8ab17777ffc24333a31b60c6e1746e6acaab666566992c9717f7d82c867ae8b6e3b
7
+ data.tar.gz: bcaa65d2fedf337c2d05de9d9281dd394a558d77a613acf21b09531aabfbc146f395e6845f2ff416f88f75abb1c474c2b0176edab6d6db4725f6bd17c88f894d
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ # Configuration options are documented at:
2
+ # http://about.travis-ci.org/docs/user/languages/ruby/
3
+ language: ruby
4
+ bundler_args: --without development
5
+ rvm:
6
+ - 1.9.3
7
+ - 2.0.0
8
+ gemfile:
9
+ - tests/Gemfile
10
+ branches:
11
+ only:
12
+ - master
13
+ script: cd tests; bundle exec rake
data/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # About Zen Grids
2
+
3
+ Zen Grids is an intuitive, flexible grid system that leverages the natural source order of your content to make it easier to create fluid responsive designs. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts, including responsive, adaptive, fluid and fixed-width layouts.
4
+
5
+ More information can be found at http://next.zengrids.com
6
+
7
+
8
+ ## USAGE
9
+
10
+ Here's a simple example: a content column with a sidebar on each side, aligned to a 12 column grid.
11
+
12
+ ```scss
13
+ @import "zen-grids";
14
+
15
+ $zen-gutters: 40px; // Set the gutter size. A half-gutter is used on
16
+ // each side of each column.
17
+
18
+ .container {
19
+ @include zen-grid-container(); // Define the container for your grid items.
20
+ }
21
+
22
+ $zen-columns: 12; // Set the number of grid columns to use in this media
23
+ // query. You'll likely want a different grid for
24
+ // different screen sizes.
25
+
26
+ @media all and (min-width: 50em) {
27
+ .sidebar1 {
28
+ @include zen-grid-item(3, 1); // Span 3 columns starting in 1st column.
29
+ }
30
+ .content {
31
+ @include zen-grid-item(6, 4); // Span 6 columns starting in 4th column.
32
+ }
33
+ .sidebar2 {
34
+ @include zen-grid-item(3, 10); // Span 3 columns starting in 10th column.
35
+ }
36
+ }
37
+ ```
38
+
39
+ Within the `.container` element, the `.sidebar1`, `.sidebar2` and `.content` elements can be in any order.
40
+
41
+ Zen Grids has built-in support for the Box-sizing Polyfill which adds `box-sizing: border-box` support to IE7 and earlier.
42
+
43
+ * Download the polyfill at https://github.com/Schepp/box-sizing-polyfill
44
+ * Place the `boxsizing.htc` file in your website.
45
+ * Set Zen Grids' `$box-sizing-polyfill-path` variable to the absolute path to the boxsizing.htc file on your website. For example: `$box-sizing-polyfill-path: "/scripts/polyfills/boxsizing.htc";`
46
+
47
+
48
+ ## INSTALLATION
49
+
50
+ Zen grids is distributed as a Ruby Gem. On your computer, simply run:
51
+
52
+ ```sh
53
+ sudo gem install zen-grids
54
+ ```
55
+
56
+ If you are using Compass (and you should!) then you can add it to an existing project by editing the project's configuration file, config.rb, and adding this line:
57
+
58
+ ```ruby
59
+ require 'zen-grids'
60
+ ```
61
+
62
+ You can then start using Zen Grids in your Sass files. Just add this line to one of your .sass or .scss files and start creating!
63
+
64
+ ```scss
65
+ @import "zen-grids";
66
+ ```
67
+
68
+
69
+ ## REQUIREMENTS
70
+
71
+ * Sass 3.3.0 or later
72
+
73
+ For the zen-grids/background module only:
74
+ * Compass 1.0.0.alpha.13 or later
75
+
76
+
77
+ ## LICENSE
78
+
79
+ Available under the GPL v2 license. See [LICENSE.txt](https://github.com/JohnAlbin/zen-grids/blob/master/LICENSE.txt).
80
+
81
+ [![Build Status](https://travis-ci.org/JohnAlbin/zen-grids.png?branch=master)](https://travis-ci.org/JohnAlbin/zen-grids)
data/bower.json CHANGED
@@ -1,25 +1,27 @@
1
1
  {
2
2
  "name" : "zen-grids",
3
- "location" : "JohnAlbin/zen-grids",
3
+ "version" : "2.0.0-beta.2",
4
+ "homepage" : "http://zengrids.com",
5
+ "author" : ["John Albin Wilkins"],
4
6
  "description" : "Zen Grids is an intuitive, flexible grid system to create responsive, adaptive, fluid and fixed-width layouts.",
5
- "keywords" : "Sass, Compass, grids, rwd",
6
-
7
7
  "main" : [
8
8
  "_zen-grids.scss",
9
9
  "zen-grids/_background.scss",
10
10
  "zen-grids/_flow.scss",
11
11
  "zen-grids/_grids.scss"
12
12
  ],
13
+ "keywords" : [
14
+ "Sass",
15
+ "Compass",
16
+ "grids",
17
+ "rwd"
18
+ ],
19
+ "license" : "GPLv2",
13
20
  "ignore" : [
21
+ "zen-grids.gemspec",
22
+ "sache.json",
14
23
  "lib",
15
24
  "templates",
16
- "zen-grids.gemspec"
17
- ],
18
-
19
- "licenses" : {
20
- "type": "GPLv2",
21
- "url": "http://www.gnu.org/licenses/gpl-2.0.html"
22
- }
23
- "authors" : ["John Albin Wilkins"],
24
- "homepage" : "http://zengrids.com/"
25
+ "tests"
26
+ ]
25
27
  }
data/sache.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "zen-grids",
3
+ "description": "Zen Grids is an intuitive, flexible grid system that leverages the natural source order of your content to make it easier to create fluid responsive designs. With an easy-to-use Sass mixin set, the Zen Grids system can be applied to an infinite number of layouts, including responsive, adaptive, fluid and fixed-width layouts.",
4
+ "tags": ["layout", "grid", "rwd", "responsive-web-design"]
5
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @file
3
+ * Base HTML element styles.
4
+ */
5
+
6
+ html {
7
+ font-size: $base-font-size;
8
+ line-height: $base-line-height;
9
+ }
10
+
11
+ body {
12
+ margin: 0;
13
+ }
14
+
15
+ h1,
16
+ h2,
17
+ p {
18
+ margin: {
19
+ top: $vertical-rhythm;
20
+ bottom: $vertical-rhythm;
21
+ }
22
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @file
3
+ * Component styles.
4
+ */
5
+
6
+ /* Skip link styling */
7
+ .skip-link {
8
+ margin: 0;
9
+ }
10
+ .skip-link__link {
11
+ display: block;
12
+ width: 100%;
13
+ padding: 2px 0 3px 0;
14
+ text-align: center;
15
+
16
+ &,
17
+ &:visited {
18
+ color: #fff;
19
+ background-color: #666;
20
+ }
21
+
22
+ /* The skip-link link will be completely hidden until a user tabs to the link. */
23
+ @media all and (min-width: 444px) {
24
+ @include visually-focusable();
25
+ }
26
+ }
27
+
28
+ /* Source-order meta info */
29
+ .meta {
30
+ margin: 0 0 .5rem 0;
31
+ display: block;
32
+ + * {
33
+ margin-top: 0;
34
+ }
35
+ font-family: sans-serif;
36
+ font-size: 1rem;
37
+ line-height: 1rem;
38
+ }
39
+ %meta__child {
40
+ display: inline;
41
+ font-style: normal;
42
+ line-height: 1rem;
43
+ }
44
+ .meta__heading {
45
+ @extend %meta__child;
46
+ font-size: 1rem;
47
+ font-weight: bold;
48
+ }
49
+ .meta__data {
50
+ @extend %meta__child;
51
+ font-size: 0.8rem;
52
+ font-weight: normal;
53
+ // text-transform: uppercase;
54
+ color: #c00;
55
+ }
56
+
57
+ /* Pull-quotes */
58
+ .pull-quote {
59
+ @include zen-float();
60
+ @include zen-flow-item-width(1, 2);
61
+
62
+ margin: {
63
+ bottom: $vertical-rhythm/2;
64
+ }
65
+
66
+ font-size: 1.2em;
67
+ font-weight: bold;
68
+ font-style: italic;
69
+
70
+ @media all and (min-width: 999px) {
71
+ @include zen-flow-item-width(1, 3);
72
+ }
73
+ }
@@ -1,18 +1,28 @@
1
1
  //
2
2
  // @file
3
- // This file sets up all our variables and load all the modules we need for all
3
+ // This file sets up all our variables and loads all the modules we need for all
4
4
  // generated CSS in this project. To use it, simply: @import "init";
5
5
  //
6
6
 
7
- // Legacy browser variables for Compass.
8
- $legacy-support-for-ie6 : false;
9
- $legacy-support-for-ie7 : false;
7
+ // Supported browsers variable for Compass.
8
+ $browser-minimum-versions: (
9
+ 'chrome': null,
10
+ 'firefox': null,
11
+ 'ie': "8",
12
+ 'safari': null,
13
+ 'opera': null
14
+ );
10
15
 
11
16
  // Set up Zen Grids.
12
17
  $zen-columns : 1;
13
18
  $zen-gutters : 20px;
14
19
  $zen-auto-include-grid-item-base : false;
15
20
 
21
+ // Set up a unit of vertical rhythm.
22
+ $base-font-size : 16px;
23
+ $base-line-height : 1.5em;
24
+ $vertical-rhythm : 1rem*($base-line-height/1em);
25
+
16
26
  //
17
27
  // Import our modules.
18
28
  //
@@ -0,0 +1,143 @@
1
+ /**
2
+ * @file
3
+ * Layout styles.
4
+ *
5
+ * We use example breakpoints of 27em, 41em, 49em, 63em and 69px. The right
6
+ * breakpoints to use for your site depend on your content.
7
+ * We use example breakpoints of 444px, 666px, 777px, 999px and 1111px. The
8
+ * right breakpoints to use for your site depend on your content.
9
+ */
10
+
11
+ /* The container for our grid items. */
12
+ .l-basic {
13
+ @include zen-grid-container();
14
+ @include zen-grid-background();
15
+ // Center the layout and ensure it doesn't grow too wide.
16
+ margin: {
17
+ left: auto;
18
+ right: auto;
19
+ }
20
+ // Add some padding so we can see the grid background numbers more easily.
21
+ padding: {
22
+ top: $vertical-rhythm;
23
+ bottom: $vertical-rhythm;
24
+ }
25
+ max-width: 1111px;
26
+ }
27
+
28
+ $zen-columns: 1;
29
+
30
+ /* Mobile layout; all grid items are one column wide. */
31
+ .l-basic__header,
32
+ .l-basic__main,
33
+ .l-basic__menu,
34
+ .l-basic__content,
35
+ .l-basic__aside1,
36
+ .l-basic__aside2,
37
+ .l-basic__footer {
38
+ /* Set the shared properties for all grid items. */
39
+ /* Note: we set $zen-auto-include-grid-item-base to false in _init.scss. */
40
+ @include zen-grid-item-base();
41
+ }
42
+
43
+ /* "main" is a grid-item (of .l-basic) that is also a nested grid container. */
44
+ .l-basic__main {
45
+ @include zen-grid-container(grid-item);
46
+ }
47
+
48
+ /* Horizontal navigation bar */
49
+ @media all and (min-width: 444px) {
50
+ $navbar-height: 5em;
51
+
52
+ .l-basic__main {
53
+ padding-top: $navbar-height;
54
+ }
55
+ .l-basic__menu {
56
+ @include zen-grid-item(1, 1);
57
+ margin-top: -$navbar-height;
58
+ height: $navbar-height;
59
+ }
60
+ }
61
+
62
+ $zen-columns: 2;
63
+ @media all and (min-width: 444px) and (max-width: 665px) {
64
+ .l-basic {
65
+ @include zen-grid-background(); // Show the new 2-column background grid image.
66
+ }
67
+ .l-basic__content {
68
+ @include zen-grid-item(2, 1);
69
+ }
70
+ .l-basic__aside1 {
71
+ @include zen-new-row(); // Clear left-floated elements (.l-basic__content)
72
+ @include zen-grid-item(1, 1);
73
+ }
74
+ .l-basic__aside2 {
75
+ @include zen-grid-item(1, 2);
76
+ }
77
+ }
78
+
79
+ @media all and (min-width: 444px) {
80
+ .l-basic__columns {
81
+ @include zen-grid-container(flow);
82
+ }
83
+ .l-basic__col1,
84
+ .l-basic__col2 {
85
+ @include zen-grid-item-base();
86
+ margin: {
87
+ top: 0;
88
+ bottom: 0;
89
+ }
90
+ }
91
+ .l-basic__col1 {
92
+ @include zen-grid-item(1, 1);
93
+ }
94
+ .l-basic__col2 {
95
+ @include zen-grid-item(1, 2);
96
+ }
97
+ }
98
+
99
+ $zen-columns: 3;
100
+ @media all and (min-width: 666px) and (max-width: 998px) {
101
+ .l-basic {
102
+ @include zen-grid-background(); // Show the new 3-column background grid image.
103
+ }
104
+ .l-basic__content {
105
+ @include zen-grid-item(2, 1);
106
+ }
107
+ .l-basic__aside1 {
108
+ @include zen-grid-item(1, 1, right); // Position from the right
109
+ }
110
+ .l-basic__aside2 {
111
+ @include zen-new-row(); // Clear left-floated elements (.l-basic__content)
112
+ @include zen-grid-item(2, 1);
113
+ }
114
+ }
115
+
116
+ @media all and (min-width: 777px) and (max-width: 998px) {
117
+ .l-basic__aside2 {
118
+ @include zen-new-row(right); // Clear right-floated elements (.l-basic__aside1)
119
+ @include zen-grid-item(1, 1, right);
120
+ }
121
+ }
122
+
123
+ $zen-columns: 5;
124
+ @media all and (min-width: 999px) {
125
+ .l-basic {
126
+ @include zen-grid-background(); // Show the new 5-column background grid image.
127
+ }
128
+ .l-basic__content {
129
+ @include zen-grid-item(3, 2);
130
+ }
131
+ .l-basic__aside1 {
132
+ @include zen-grid-item(1, 1);
133
+ }
134
+ .l-basic__aside2 {
135
+ @include zen-grid-item(1, 5);
136
+ }
137
+ .l-basic__col1 {
138
+ @include zen-grid-item(2, 1, $columns: 3);
139
+ }
140
+ .l-basic__col2 {
141
+ @include zen-grid-item(1, 3, $columns: 3);
142
+ }
143
+ }
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // @file
3
- // Accessibility features.
3
+ // This is an accessibility module.
4
4
  //
5
5
 
6
6
  // As defined by http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
@@ -9,7 +9,7 @@
9
9
  height: 1px;
10
10
  width: 1px;
11
11
  overflow: hidden;
12
- @if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
12
+ @if support-legacy-browser(ie, "7") {
13
13
  clip: rect(1px 1px 1px 1px); // IE6 and IE7 use the wrong syntax.
14
14
  }
15
15
  clip: rect(1px, 1px, 1px, 1px);
@@ -33,19 +33,3 @@
33
33
  @include visually-hidden-off();
34
34
  }
35
35
  }
36
-
37
- // Placeholder styles for use with @extend.
38
- %visually-hidden {
39
- @include visually-hidden();
40
- }
41
- %visually-hidden-off {
42
- @include visually-hidden-off();
43
- }
44
- %visually-focusable {
45
- @extend %visually-hidden;
46
-
47
- &:active,
48
- &:focus {
49
- @extend %visually-hidden-off;
50
- }
51
- }