ezy 0.0.2

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 419aed0574f79a72fe0d57628b36b2f72260ec92
4
+ data.tar.gz: 8cbcb16cfd857674686f937732deeff808fb5d3e
5
+ SHA512:
6
+ metadata.gz: 3b1a926d137d51a25386b63db7cd0258f198e9baf2bb766dee1e0ac45becec7acf38bdbdc106723ababcbe5fbd25449ef0093c2c1554ee290c3c0f10a8d23181
7
+ data.tar.gz: 3666533edd3d26f08b5bbba2368be39c18437ef6dbd361ca795f81b3641c21fa1595afe98ab6853c3f67b58698f0684efbf64fa9f326fc4aa3afa93c59ccef7b
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ Ezy Grid
2
+ ========
3
+
4
+ My attempt to create a collection of simple-to-use grid helpers with SCSS
5
+
6
+
7
+ Building and testing gem
8
+ ------------------------
9
+
10
+ ### Build gem ###
11
+ $ gem build ezy.gemspec
12
+
13
+ ### Install local gem ###
14
+ $ gem install --local ezy-[build version].gem
15
+
16
+ ### Open installed gem location (Mac) ###
17
+ $ open /Users/[username]/.rvm/gems/
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.2
data/ezy.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ # Release Specific Information
5
+ s.version = "0.0.2"
6
+ s.date = "2013-11-10"
7
+
8
+ # Gem Details
9
+ s.name = "ezy"
10
+ s.author = "Frej Raahede Nielsen"
11
+ s.summary = "Responsive grid framework for SASS"
12
+ s.description = "Ezy Grid is a light weight grid framework for use with SASS. It's simple, but smart and will allow you to create even the most complex responsive layouts."
13
+ s.email = "frejraahede@gmail.com"
14
+ s.homepage = "http://github.com/raahede/"
15
+
16
+ # Gem Files
17
+ s.files = %w(README.md)
18
+ s.files += %w(ezy.gemspec)
19
+ s.files += %w(VERSION)
20
+ s.files += Dir.glob("lib/**/*.*")
21
+ s.files += Dir.glob("sass/**/*.*")
22
+ s.files += Dir.glob("templates/**/*.*")
23
+ s.files += Dir.glob("test/**/*.*")
24
+
25
+ # Gem Bookkeeping
26
+ s.rubygems_version = %q{1.3.6}
27
+ s.add_dependency(%q<compass>, [">= 0.12.2"])
28
+ s.add_dependency(%q<sass>, [">= 3.2.0"])
29
+ end
data/lib/ezy.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register('ezy',
3
+ :stylesheets_directory => File.join(File.dirname(__FILE__), '..', 'sass'),
4
+ :templates_directory => File.join(File.dirname(__FILE__), '..', 'templates'))
data/sass/_ezy.scss ADDED
@@ -0,0 +1,5 @@
1
+ // This is your framework's main stylesheet. Use it to import all default modules.
2
+ @import "ezy/clearfix";
3
+ @import "ezy/functions";
4
+ @import "ezy/media";
5
+ @import "ezy/grid";
@@ -0,0 +1,25 @@
1
+ /* -------------------------------------------------------------------- *
2
+ * Micro Clearfix
3
+ * http://nicolasgallagher.com/micro-clearfix-hack/
4
+ */
5
+
6
+ %clearfix:before,
7
+ %clearfix:after {
8
+ content: " ";
9
+ display: table;
10
+ }
11
+
12
+ %clearfix:after {
13
+ clear: both;
14
+ }
15
+
16
+
17
+ %clearfix {
18
+ /**
19
+ * For IE 6/7 only
20
+ * Include this rule to trigger hasLayout and contain floats.
21
+ */
22
+ *zoom: 1;
23
+ }
24
+
25
+ /* -------------------------------------------------------------------- */
@@ -0,0 +1,59 @@
1
+
2
+ // ------------------------------------------------------------- *
3
+ // Function to return a percentage rounded down to 2 deimals
4
+ // ---------------------------------------------------------
5
+ //
6
+ // @function percentage-round
7
+ //
8
+ // Example use:
9
+ // -------------------
10
+ // .selector{
11
+ // width: percentage-round( 2/3 ); // returns 66.66%
12
+ // }
13
+ //
14
+ // ------------------------------------------------------------- *
15
+
16
+ @function percentage-round( $value ) {
17
+ @return floor( percentage( $value ) * 100 ) / 100;
18
+ }
19
+
20
+
21
+ @function return-key( $key, $array ) {
22
+ @each $item in $array {
23
+ @if ( nth( $item, 1 ) == $key ){
24
+ @return nth( $item, 2 );
25
+ }
26
+ }
27
+ }
28
+
29
+ @function comparable-multiple( $array ) {
30
+ $prev: false;
31
+
32
+ @if length( $array ) < 2 {
33
+ @warn "You need at least two values in order to do a comparison!";
34
+ }
35
+
36
+ @each $item in $array {
37
+ @if $prev {
38
+ @if not comparable( $prev, $item ) {
39
+ @return false;
40
+ }
41
+ } @else {
42
+ $prev: $item;
43
+ }
44
+ }
45
+ @return true;
46
+ }
47
+
48
+ @function remove-units( $value ) {
49
+ $units: "%" 1%, "in" 1in, "cm" 1cm, "mm" 1mm, "em" 1em, "rem" 1rem, "ch" 1ch, "ex" 1ex, "pt" 1pt, "pc" 1pc, "px" 1px, "vw" 1vw, "vh" 1vh, "vmin" 1vmin, "vmax" 1vmax;
50
+ @each $unit in $units {
51
+ @if unit($value) == nth( $unit, 1 ) {
52
+ @return $value / nth( $unit, 2 );
53
+ }
54
+ }
55
+ // @return $value / unit($value);
56
+ }
57
+
58
+
59
+
@@ -0,0 +1,148 @@
1
+
2
+ $column-width: 4em !default;
3
+ $gutter-width: 1em !default;
4
+ $total-columns: 12 !default;
5
+ $is-fluid: true !default;
6
+
7
+ $grid-init: false;
8
+
9
+ $context-warn: "You must set $context if $is-fluid is set to true.";
10
+
11
+ @function layout-width( $columns ) {
12
+ @if comparable( $column-width, $gutter-width ) {
13
+ @return $columns * ( $column-width + $gutter-width ) - $gutter-width;
14
+ } @else {
15
+ @warn "$column-width and $gutter-width must have the same unit set. #{ unit($column-width) }'s and #{ unit($gutter-width) }'s are not comparable.";
16
+ }
17
+ }
18
+
19
+ @function context-width( $columns ) {
20
+ @return layout-width( $columns ) + $gutter-width;
21
+ }
22
+
23
+ @function span-column-width( $columns ) {
24
+ @return layout-width( $columns );
25
+ }
26
+
27
+ @function gutter(
28
+ $context: false
29
+ ) {
30
+ @if $is-fluid and $context {
31
+ @return ( percentage-round( ( $gutter-width / 2 ) / context-width( $context ) ) );
32
+ } @else if $is-fluid {
33
+ @warn $context-warn;
34
+ } @else {
35
+ @return $gutter-width / 2;
36
+ }
37
+ }
38
+
39
+ @mixin gutters(
40
+ $context: false
41
+ ) {
42
+ margin: {
43
+ left: gutter( $context );
44
+ right: gutter( $context );
45
+ }
46
+ }
47
+
48
+ %ezy-master {
49
+ @extend %clearfix;
50
+ margin: {
51
+ left: auto;
52
+ right: auto;
53
+ }
54
+ }
55
+
56
+ @mixin master(
57
+ $columns
58
+ ) {
59
+ @if $is-fluid {
60
+ max-width: layout-width( $columns );
61
+ } @else {
62
+ width: layout-width( $columns );
63
+ }
64
+ @extend %ezy-master;
65
+ }
66
+
67
+ %ezy-container {
68
+ @extend %clearfix;
69
+ }
70
+
71
+ @mixin container(
72
+ $context: false,
73
+ $at-breakpoint: false
74
+ ) {
75
+ $pullout: -( $gutter-width )/2;
76
+ @if $is-fluid and $context {
77
+ $pullout: -( percentage-round( $gutter-width / layout-width( $context ) ) )/2;
78
+ } @else if $is-fluid {
79
+ @warn $context-warn;
80
+ }
81
+ margin: {
82
+ left: $pullout;
83
+ right: $pullout;
84
+ }
85
+ @if (not $at-breakpoint) {
86
+ @extend %ezy-container;
87
+ }
88
+ }
89
+
90
+ @mixin grid-init() {
91
+ $grid-init: true;
92
+ @if $is-fluid {
93
+ @for $i from 1 through $total-columns {
94
+ %ezy-column-#{ $i } {
95
+ float: left;
96
+ @include gutters( $i );
97
+ }
98
+ }
99
+ } @else {
100
+ %ezy-column {
101
+ float: left;
102
+ @include gutters;
103
+ }
104
+ }
105
+ }
106
+
107
+ @mixin span-columns(
108
+ $columns,
109
+ $context: false,
110
+ $at-breakpoint: false
111
+ ) {
112
+ $width: span-column-width( $columns );
113
+ /* Spanning #{ $columns } of #{ $context } columns */
114
+ @if $is-fluid and $context {
115
+ $context-width: context-width( $context );
116
+ $pct-width: percentage-round( $width / $context-width );
117
+ width: $pct-width;
118
+ } @else {
119
+ width: $width;
120
+ }
121
+ @if $is-fluid {
122
+ @if (not $at-breakpoint) {
123
+ @if $total-columns < $context {
124
+ @warn "Please check if $total-columns is set. $total-columns should be the highest number of columns occuring in your layout. This error will not break your layout, but will increase the CSS output.";
125
+ @include gutters( $context );
126
+ } @else if (not $grid-init) {
127
+ @warn "Include grid-init() after setting $total-columns for cleaner CSS output.";
128
+ @include gutters( $context );
129
+ } @else {
130
+ @extend %ezy-column-#{ $context };
131
+ }
132
+ } @else {
133
+ @include gutters( $context );
134
+ }
135
+ @if $columns > $context {
136
+ @warn "You are trying to span #{ $columns } columns, but your layout only has #{ $context } columns.";
137
+ }
138
+ @if (not $context) {
139
+ @warn $context-warn;
140
+ }
141
+ } @else if (not $grid-init) {
142
+ @warn "Include grid-init() after setting $gutter-width for cleaner CSS output.";
143
+ @include gutters( $context );
144
+ } @else {
145
+ @extend %ezy-column;
146
+ }
147
+ }
148
+
@@ -0,0 +1,48 @@
1
+
2
+ $legacy-selector: ".no-media-queries" !default;
3
+
4
+ @function set-breakpoint(
5
+ $min: false,
6
+ $max: false,
7
+ $custom: false,
8
+ $legacy-support: false
9
+ ) {
10
+
11
+ @if (not $min) and (not $max) and (not $custom) {
12
+ @warn "Either $min, $max, or $custom must be defined for set-breakpoint to work.";
13
+ }
14
+
15
+ @if $min and $max {
16
+ // Both $min and $max
17
+ @return "(min-width: #{ $min }) and (max-width: #{ $max })", $legacy-support;
18
+ } @else {
19
+ @if $min and (not $max) {
20
+ // Min only:
21
+ @return "(min-width: #{ $min })", $legacy-support;
22
+ }
23
+ @if $max and (not $min) {
24
+ // Max only:
25
+ @return "(max-width: #{ $max })", $legacy-support;
26
+ } @else {
27
+ // Custom:
28
+ @return $custom, $legacy-support;
29
+ }
30
+ }
31
+ }
32
+
33
+ @mixin at-breakpoint(
34
+ $breakpoint,
35
+ $legacy-support: false
36
+ ) {
37
+ @media #{ nth( $breakpoint, 1 ) } {
38
+ @content;
39
+ }
40
+ @if $legacy-support or nth( $breakpoint, 2 ) {
41
+ #{ $legacy-selector } & {
42
+ /* Fallback for browsers not supporting media queries */
43
+ @content;
44
+ }
45
+ }
46
+ }
47
+
48
+
@@ -0,0 +1,32 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "ezy";
5
+
6
+ // -----------------------------------------------------------
7
+ // Required grid settings
8
+
9
+ $column-width: 40px; // column width
10
+ $gutter-width: 30px; // space between columns
11
+ $total-columns: 12; // max number of columns occuring
12
+ @include grid-init; // doing some background magic for you
13
+
14
+ // -----------------------------------------------------------
15
+ // Grid layouts (column count)
16
+
17
+ $columns-small: 4;
18
+ $columns-medium: 8;
19
+ $columns-large: 12;
20
+
21
+ // -----------------------------------------------------------
22
+ // Responsive settings
23
+
24
+ // Widths for use in media queries
25
+ $width-small: context-width( $columns-small );
26
+ $width-medium: context-width( $columns-medium );
27
+ $width-large: context-width( $columns-large );
28
+
29
+ // Defining media query breakpoints
30
+ $breakpoint-small: set-breakpoint( $max: $width-small );
31
+ $breakpoint-medium: set-breakpoint( $min: $width-small+1 );
32
+ $breakpoint-large: set-breakpoint( $min: $width-medium+1, $legacy-support: true ); // Support for legacy browsers
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <!--[if lt IE 7]> <html class="no-js no-media-queries ie6"> <![endif]-->
3
+ <!--[if IE 7]> <html class="no-js no-media-queries ie7"> <![endif]-->
4
+ <!--[if lt IE 9]> <html class="no-media-queries"> <![endif]-->
5
+ <!--[if gt IE 8]><!--> <html> <!--<![endif]-->
6
+ <head>
7
+ <meta charset="utf-8">
8
+
9
+ <title>Ezy Grid</title>
10
+
11
+ <meta name="description" content="Getting started with Ezy Grid">
12
+ <meta name="viewport" content="width=device-width">
13
+
14
+ <link href="css/demo.css" rel="stylesheet">
15
+
16
+ </head>
17
+ <body>
18
+
19
+ <div class="page">
20
+ <div class="grid">
21
+ <div class="column">
22
+ brew ale, bottle conditioning alcohol saccharification wort chiller. bottom fermenting yeast hand pump bunghole original gravity. bung conditioning ibu all-malt hoppy ipa?
23
+ </div>
24
+ <div class="column">
25
+ brew ale, bottle conditioning alcohol saccharification wort chiller. bottom fermenting yeast hand pump bunghole original gravity. bung conditioning ibu all-malt hoppy ipa?
26
+ </div>
27
+ <div class="column">
28
+ brew ale, bottle conditioning alcohol saccharification wort chiller. bottom fermenting yeast hand pump bunghole original gravity. bung conditioning ibu all-malt hoppy ipa?
29
+ </div>
30
+ <div class="column">
31
+ brew ale, bottle conditioning alcohol saccharification wort chiller. bottom fermenting yeast hand pump bunghole original gravity. bung conditioning ibu all-malt hoppy ipa?
32
+ </div>
33
+ <div class="column">
34
+ brew ale, bottle conditioning alcohol saccharification wort chiller. bottom fermenting yeast hand pump bunghole original gravity. bung conditioning ibu all-malt hoppy ipa?
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
@@ -0,0 +1,18 @@
1
+ stylesheet 'screen.scss', :media => "screen, projection"
2
+ stylesheet '_base.scss'
3
+
4
+ description "Ezy Grid: a minimal grid framework with mammoth potential."
5
+
6
+ help %Q{
7
+ Please see the source repository for all documentation and help:
8
+
9
+ http://github.com/raahede/ezy-grid
10
+ }
11
+
12
+ welcome_message %Q{
13
+ Please see the source repository for all documentation and help:
14
+
15
+ http://github.com/raahede/ezy-grid
16
+
17
+ To get started, set up your grid in the base partial by following the inline instructions.
18
+ }
@@ -0,0 +1,40 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "layout";
5
+
6
+ /* -------------------------------------------------------------------------*/
7
+ /* Layout: mobile first */
8
+
9
+ body {
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+
14
+ .page {
15
+ @include master( $columns-large ); // Sets max-width
16
+ padding: {
17
+ left: $gutter-width / 2;
18
+ right: $gutter-width / 2;
19
+ }
20
+ }
21
+
22
+ .grid {
23
+ @include container( $columns-small );
24
+ @include at-breakpoint( $breakpoint-medium ) {
25
+ @include container( $columns-medium, $at-breakpoint: true );
26
+ }
27
+ @include at-breakpoint( $breakpoint-large ) {
28
+ @include container( $columns-large, $at-breakpoint: true );
29
+ }
30
+ }
31
+
32
+ .column {
33
+ @include span-columns( 4, $context: $columns-small);
34
+ @include at-breakpoint( $breakpoint-medium ) {
35
+ @include span-columns( 4, $context: $columns-medium, $at-breakpoint: true);
36
+ }
37
+ @include at-breakpoint( $breakpoint-large ) {
38
+ @include span-columns( 4, $context: $columns-large, $at-breakpoint: true);
39
+ }
40
+ }
data/test/config.rb ADDED
@@ -0,0 +1,10 @@
1
+ # Compass CSS framework config file
2
+
3
+ project_type = :stand_alone
4
+ http_path = "/"
5
+ sass_dir = "scss"
6
+ css_dir = "css"
7
+ line_comments = false
8
+ preferred_syntax = :scss
9
+ output_style = :expanded
10
+ relative_assets = true
@@ -0,0 +1,93 @@
1
+ /* -------------------------------------------------------------------- *
2
+ * Micro Clearfix
3
+ * http://nicolasgallagher.com/micro-clearfix-hack/
4
+ */
5
+ .page:before, .grid:before,
6
+ .page:after,
7
+ .grid:after {
8
+ content: " ";
9
+ display: table;
10
+ }
11
+
12
+ .page:after, .grid:after {
13
+ clear: both;
14
+ }
15
+
16
+ .page, .grid {
17
+ /**
18
+ * For IE 6/7 only
19
+ * Include this rule to trigger hasLayout and contain floats.
20
+ */
21
+ *zoom: 1;
22
+ }
23
+
24
+ /* -------------------------------------------------------------------- */
25
+ .page {
26
+ margin-left: auto;
27
+ margin-right: auto;
28
+ }
29
+
30
+ .page {
31
+ max-width: 1050px;
32
+ }
33
+
34
+ .grid {
35
+ margin-left: -1.425%;
36
+ margin-right: -1.425%;
37
+ }
38
+
39
+ /* -------------------------------------------------------------------- *
40
+ * Grid columns: not using grid-init()
41
+ */
42
+ .span-columns-2 {
43
+ /* Spanning 2 of 12 columns */
44
+ width: 13.88%;
45
+ margin-left: 1.38%;
46
+ margin-right: 1.38%;
47
+ }
48
+
49
+ .span-columns-4 {
50
+ /* Spanning 4 of 12 columns */
51
+ width: 30.55%;
52
+ margin-left: 1.38%;
53
+ margin-right: 1.38%;
54
+ }
55
+
56
+ .span-columns-6 {
57
+ /* Spanning 6 of 12 columns */
58
+ width: 47.22%;
59
+ margin-left: 1.38%;
60
+ margin-right: 1.38%;
61
+ }
62
+
63
+ /* -------------------------------------------------------------------- *
64
+ * Grid columns: using grid-init()
65
+ */
66
+ .span-columns-2, .span-columns-4, .span-columns-6, .span-columns-18 {
67
+ float: left;
68
+ margin-left: 1.38%;
69
+ margin-right: 1.38%;
70
+ }
71
+
72
+ .span-columns-2 {
73
+ /* Spanning 2 of 12 columns */
74
+ width: 13.88%;
75
+ }
76
+
77
+ .span-columns-4 {
78
+ /* Spanning 4 of 12 columns */
79
+ width: 30.55%;
80
+ }
81
+
82
+ .span-columns-6 {
83
+ /* Spanning 6 of 12 columns */
84
+ width: 47.22%;
85
+ }
86
+
87
+ /* -------------------------------------------------------------------- *
88
+ * Grid colum spanning more columns than layout
89
+ */
90
+ .span-columns-18 {
91
+ /* Spanning 18 of 12 columns */
92
+ width: 147.22%;
93
+ }
@@ -0,0 +1,84 @@
1
+ /* -------------------------------------------------------------------- *
2
+ * Micro Clearfix
3
+ * http://nicolasgallagher.com/micro-clearfix-hack/
4
+ */
5
+ .page:before, .grid:before,
6
+ .page:after,
7
+ .grid:after {
8
+ content: " ";
9
+ display: table;
10
+ }
11
+
12
+ .page:after, .grid:after {
13
+ clear: both;
14
+ }
15
+
16
+ .page, .grid {
17
+ /**
18
+ * For IE 6/7 only
19
+ * Include this rule to trigger hasLayout and contain floats.
20
+ */
21
+ *zoom: 1;
22
+ }
23
+
24
+ /* -------------------------------------------------------------------- */
25
+ .page {
26
+ margin-left: auto;
27
+ margin-right: auto;
28
+ }
29
+
30
+ .page {
31
+ max-width: 1050px;
32
+ }
33
+
34
+ .grid {
35
+ margin-left: -4.545%;
36
+ margin-right: -4.545%;
37
+ }
38
+ @media (min-width: 361px) {
39
+ .grid {
40
+ margin-left: -2.17%;
41
+ margin-right: -2.17%;
42
+ }
43
+ }
44
+ @media (min-width: 721px) {
45
+ .grid {
46
+ margin-left: -1.425%;
47
+ margin-right: -1.425%;
48
+ }
49
+ }
50
+ .no-media-queries .grid {
51
+ /* Fallback for browsers not supporting media queries */
52
+ margin-left: -1.425%;
53
+ margin-right: -1.425%;
54
+ }
55
+
56
+ .column {
57
+ /* Spanning 4 of 4 columns */
58
+ width: 91.66%;
59
+ margin-left: 4.16%;
60
+ margin-right: 4.16%;
61
+ }
62
+ @media (min-width: 361px) {
63
+ .column {
64
+ /* Spanning 4 of 8 columns */
65
+ width: 45.83%;
66
+ margin-left: 2.08%;
67
+ margin-right: 2.08%;
68
+ }
69
+ }
70
+ @media (min-width: 721px) {
71
+ .column {
72
+ /* Spanning 4 of 12 columns */
73
+ width: 30.55%;
74
+ margin-left: 1.38%;
75
+ margin-right: 1.38%;
76
+ }
77
+ }
78
+ .no-media-queries .column {
79
+ /* Fallback for browsers not supporting media queries */
80
+ /* Spanning 4 of 12 columns */
81
+ width: 30.55%;
82
+ margin-left: 1.38%;
83
+ margin-right: 1.38%;
84
+ }
@@ -0,0 +1,93 @@
1
+ /* -------------------------------------------------------------------- *
2
+ * Micro Clearfix
3
+ * http://nicolasgallagher.com/micro-clearfix-hack/
4
+ */
5
+ .page:before, .grid:before,
6
+ .page:after,
7
+ .grid:after {
8
+ content: " ";
9
+ display: table;
10
+ }
11
+
12
+ .page:after, .grid:after {
13
+ clear: both;
14
+ }
15
+
16
+ .page, .grid {
17
+ /**
18
+ * For IE 6/7 only
19
+ * Include this rule to trigger hasLayout and contain floats.
20
+ */
21
+ *zoom: 1;
22
+ }
23
+
24
+ /* -------------------------------------------------------------------- */
25
+ .page {
26
+ margin-left: auto;
27
+ margin-right: auto;
28
+ }
29
+
30
+ .page {
31
+ width: 1050px;
32
+ }
33
+
34
+ .grid {
35
+ margin-left: -15px;
36
+ margin-right: -15px;
37
+ }
38
+
39
+ /* -------------------------------------------------------------------- *
40
+ * Static columns: not using grid-init()
41
+ */
42
+ .span-columns-2 {
43
+ /* Spanning 2 of false columns */
44
+ width: 150px;
45
+ margin-left: 15px;
46
+ margin-right: 15px;
47
+ }
48
+
49
+ .span-columns-4 {
50
+ /* Spanning 4 of false columns */
51
+ width: 330px;
52
+ margin-left: 15px;
53
+ margin-right: 15px;
54
+ }
55
+
56
+ .span-columns-6 {
57
+ /* Spanning 6 of false columns */
58
+ width: 510px;
59
+ margin-left: 15px;
60
+ margin-right: 15px;
61
+ }
62
+
63
+ /* -------------------------------------------------------------------- *
64
+ * Static columns: using grid-init()
65
+ */
66
+ .span-columns-2, .span-columns-4, .span-columns-6, .span-columns-18 {
67
+ float: left;
68
+ margin-left: 15px;
69
+ margin-right: 15px;
70
+ }
71
+
72
+ .span-columns-2 {
73
+ /* Spanning 2 of false columns */
74
+ width: 150px;
75
+ }
76
+
77
+ .span-columns-4 {
78
+ /* Spanning 4 of false columns */
79
+ width: 330px;
80
+ }
81
+
82
+ .span-columns-6 {
83
+ /* Spanning 6 of false columns */
84
+ width: 510px;
85
+ }
86
+
87
+ /* -------------------------------------------------------------------- *
88
+ * Grid colum spanning more columns than layout
89
+ */
90
+ .span-columns-18 {
91
+ /* Spanning 18 of false columns */
92
+ width: 1590px;
93
+ }
@@ -0,0 +1,79 @@
1
+ /* -------------------------------------------------------------------- *
2
+ * Micro Clearfix
3
+ * http://nicolasgallagher.com/micro-clearfix-hack/
4
+ */
5
+ /* -------------------------------------------------------------------- */
6
+ @media (max-width: 400px) {
7
+ .test {
8
+ content: "Breakpoint 1 (A)";
9
+ }
10
+ }
11
+ @media (max-width: 400px) {
12
+ .test {
13
+ content: "Breakpoint 1 (B)";
14
+ }
15
+ }
16
+ .no-media-queries .test {
17
+ /* Fallback for browsers not supporting media queries */
18
+ content: "Breakpoint 1 (B)";
19
+ }
20
+ @media (min-width: 401px) and (max-width: 800px) {
21
+ .test {
22
+ content: "Breakpoint 2 (A)";
23
+ }
24
+ }
25
+ @media (min-width: 401px) and (max-width: 800px) {
26
+ .test {
27
+ content: "Breakpoint 2 (B)";
28
+ }
29
+ }
30
+ .no-media-queries .test {
31
+ /* Fallback for browsers not supporting media queries */
32
+ content: "Breakpoint 2 (B)";
33
+ }
34
+ @media (min-width: 801px) {
35
+ .test {
36
+ content: "Breakpoint 3 (A)";
37
+ }
38
+ }
39
+ @media (min-width: 801px) {
40
+ .test {
41
+ content: "Breakpoint 3 (B)";
42
+ }
43
+ }
44
+ .no-media-queries .test {
45
+ /* Fallback for browsers not supporting media queries */
46
+ content: "Breakpoint 3 (B)";
47
+ }
48
+ @media (min-width: 40em) and (max-width: 80em) {
49
+ .test {
50
+ content: "Breakpoint 4 (A)";
51
+ }
52
+ }
53
+ @media (min-width: 40em) and (max-width: 80em) {
54
+ .test {
55
+ content: "Breakpoint 4 (B)";
56
+ }
57
+ }
58
+ .no-media-queries .test {
59
+ /* Fallback for browsers not supporting media queries */
60
+ content: "Breakpoint 4 (B)";
61
+ }
62
+ @media (max-width: 400px) {
63
+ .test {
64
+ content: "Forcing legacy support";
65
+ }
66
+ }
67
+ .no-media-queries .test {
68
+ /* Fallback for browsers not supporting media queries */
69
+ content: "Forcing legacy support";
70
+ }
71
+ @media (min-width: 401px) and (max-width: 800px) {
72
+ .test {
73
+ content: "Custom legacy selector";
74
+ }
75
+ }
76
+ .ie8 .test {
77
+ /* Fallback for browsers not supporting media queries */
78
+ content: "Custom legacy selector";
79
+ }
@@ -0,0 +1,62 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "../../../sass/ezy";
5
+
6
+ $column-width: 60px;
7
+ $gutter-width: 30px;
8
+ $total-columns: 12;
9
+
10
+ .page {
11
+ @include master( $total-columns ); // Sets max-width
12
+ }
13
+
14
+ .grid {
15
+ @include container( $total-columns );
16
+ }
17
+
18
+ /* -------------------------------------------------------------------- *
19
+ * Grid columns: not using grid-init()
20
+ */
21
+
22
+ .span-columns-2 {
23
+ @include span-columns( 2, $context: $total-columns );
24
+ }
25
+
26
+ .span-columns-4 {
27
+ @include span-columns( 4, $context: $total-columns );
28
+ }
29
+
30
+ .span-columns-6 {
31
+ @include span-columns( 6, $context: $total-columns );
32
+ }
33
+
34
+ /* -------------------------------------------------------------------- *
35
+ * Grid columns: using grid-init()
36
+ */
37
+
38
+ @include grid-init();
39
+
40
+ .span-columns-2 {
41
+ @include span-columns( 2, $context: $total-columns );
42
+ }
43
+
44
+ .span-columns-4 {
45
+ @include span-columns( 4, $context: $total-columns );
46
+ }
47
+
48
+ .span-columns-6 {
49
+ @include span-columns( 6, $context: $total-columns );
50
+ }
51
+
52
+ /* -------------------------------------------------------------------- *
53
+ * Grid colum spanning more columns than layout
54
+ */
55
+
56
+ .span-columns-18 {
57
+ @include span-columns( 18, $context: $total-columns );
58
+ }
59
+
60
+
61
+
62
+
@@ -0,0 +1,42 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "../../../sass/ezy";
5
+
6
+ $column-width: 60px;
7
+ $gutter-width: 30px;
8
+ $total-columns: 12;
9
+
10
+ // Widths for use in media queries
11
+ $width-small: context-width( 4 );
12
+ $width-medium: context-width( 8 );
13
+ $width-large: context-width( $total-columns );
14
+
15
+ // Defining media query breakpoints
16
+ $breakpoint-small: set-breakpoint( $max: $width-small );
17
+ $breakpoint-medium: set-breakpoint( $min: $width-small+1 );
18
+ $breakpoint-large: set-breakpoint( $min: $width-medium+1, $legacy-support: true ); // Support for legacy browsers
19
+
20
+ .page {
21
+ @include master( $total-columns ); // Sets max-width
22
+ }
23
+
24
+ .grid {
25
+ @include container( 4 );
26
+ @include at-breakpoint( $breakpoint-medium ) {
27
+ @include container( 8, $at-breakpoint: true );
28
+ }
29
+ @include at-breakpoint( $breakpoint-large ) {
30
+ @include container( $total-columns, $at-breakpoint: true );
31
+ }
32
+ }
33
+
34
+ .column {
35
+ @include span-columns( 4, $context: 4);
36
+ @include at-breakpoint( $breakpoint-medium ) {
37
+ @include span-columns( 4, $context: 8, $at-breakpoint: true);
38
+ }
39
+ @include at-breakpoint( $breakpoint-large ) {
40
+ @include span-columns( 4, $context: $total-columns, $at-breakpoint: true);
41
+ }
42
+ }
@@ -0,0 +1,61 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "../../../sass/ezy";
5
+
6
+ $column-width: 60px;
7
+ $gutter-width: 30px;
8
+ $total-columns: 12;
9
+ $is-fluid: false;
10
+
11
+ .page {
12
+ @include master( $total-columns ); // Sets max-width
13
+ }
14
+
15
+ .grid {
16
+ @include container();
17
+ }
18
+
19
+ /* -------------------------------------------------------------------- *
20
+ * Static columns: not using grid-init()
21
+ */
22
+
23
+ .span-columns-2 {
24
+ @include span-columns( 2 );
25
+ }
26
+
27
+ .span-columns-4 {
28
+ @include span-columns( 4 );
29
+ }
30
+
31
+ .span-columns-6 {
32
+ @include span-columns( 6 );
33
+ }
34
+
35
+ /* -------------------------------------------------------------------- *
36
+ * Static columns: using grid-init()
37
+ */
38
+
39
+ @include grid-init();
40
+
41
+ .span-columns-2 {
42
+ @include span-columns( 2 );
43
+ }
44
+
45
+ .span-columns-4 {
46
+ @include span-columns( 4 );
47
+ }
48
+
49
+ .span-columns-6 {
50
+ @include span-columns( 6 );
51
+ }
52
+
53
+ /* -------------------------------------------------------------------- *
54
+ * Grid colum spanning more columns than layout
55
+ */
56
+
57
+ .span-columns-18 {
58
+ @include span-columns( 18 );
59
+ }
60
+
61
+
@@ -0,0 +1,66 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "../../sass/ezy";
5
+
6
+ // ---------------------------------------------------------------------------
7
+ // Media
8
+
9
+ $width-1: 400px;
10
+ $width-2: 800px;
11
+
12
+ $breakpoint-1-a: set-breakpoint( $max: $width-1 );
13
+ $breakpoint-1-b: set-breakpoint( $max: $width-1, $legacy-support: true );
14
+ $breakpoint-2-a: set-breakpoint( $min: $width-1+1, $max: $width-2 );
15
+ $breakpoint-2-b: set-breakpoint( $min: $width-1+1, $max: $width-2, $legacy-support: true );
16
+ $breakpoint-3-a: set-breakpoint( $min: $width-2+1);
17
+ $breakpoint-3-b: set-breakpoint( $min: $width-2+1, $legacy-support: true);
18
+ $breakpoint-4-a: set-breakpoint( $custom: "(min-width: 40em) and (max-width: 80em)");
19
+ $breakpoint-4-b: set-breakpoint( $custom: "(min-width: 40em) and (max-width: 80em)", $legacy-support: true);
20
+
21
+ .test{
22
+ @include at-breakpoint( $breakpoint-1-a ) {
23
+ content: "Breakpoint 1 (A)";
24
+ }
25
+ @include at-breakpoint( $breakpoint-1-b ) {
26
+ content: "Breakpoint 1 (B)";
27
+ }
28
+ @include at-breakpoint( $breakpoint-2-a ) {
29
+ content: "Breakpoint 2 (A)";
30
+ }
31
+ @include at-breakpoint( $breakpoint-2-b ) {
32
+ content: "Breakpoint 2 (B)";
33
+ }
34
+ @include at-breakpoint( $breakpoint-3-a ) {
35
+ content: "Breakpoint 3 (A)";
36
+ }
37
+ @include at-breakpoint( $breakpoint-3-b ) {
38
+ content: "Breakpoint 3 (B)";
39
+ }
40
+ @include at-breakpoint( $breakpoint-4-a ) {
41
+ content: "Breakpoint 4 (A)";
42
+ }
43
+ @include at-breakpoint( $breakpoint-4-b ) {
44
+ content: "Breakpoint 4 (B)";
45
+ }
46
+
47
+ // -------------------------------------------------------------------- *
48
+ // Force legacy support
49
+
50
+ @include at-breakpoint( $breakpoint-1-a, $legacy-support: true ) {
51
+ content: "Forcing legacy support";
52
+ }
53
+
54
+ // -------------------------------------------------------------------- *
55
+ // Custom legacy selector
56
+
57
+ $legacy-selector: ".ie8";
58
+
59
+ @include at-breakpoint( $breakpoint-2-b ) {
60
+ content: "Custom legacy selector";
61
+ }
62
+
63
+
64
+ }
65
+
66
+
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ezy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Frej Raahede Nielsen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: compass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.12.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.12.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: sass
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.0
41
+ description: Ezy Grid is a light weight grid framework for use with SASS. It's simple,
42
+ but smart and will allow you to create even the most complex responsive layouts.
43
+ email: frejraahede@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - README.md
49
+ - ezy.gemspec
50
+ - VERSION
51
+ - lib/ezy.rb
52
+ - sass/_ezy.scss
53
+ - sass/ezy/_clearfix.scss
54
+ - sass/ezy/_functions.scss
55
+ - sass/ezy/_grid.scss
56
+ - sass/ezy/_media.scss
57
+ - templates/project/_settings.scss
58
+ - templates/project/index.html
59
+ - templates/project/manifest.rb
60
+ - templates/project/screen.scss
61
+ - test/config.rb
62
+ - test/css/grid/fluid.css
63
+ - test/css/grid/responsive.css
64
+ - test/css/grid/static.css
65
+ - test/css/media.css
66
+ - test/scss/grid/fluid.scss
67
+ - test/scss/grid/responsive.scss
68
+ - test/scss/grid/static.scss
69
+ - test/scss/media.scss
70
+ homepage: http://github.com/raahede/
71
+ licenses: []
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.0.6
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Responsive grid framework for SASS
93
+ test_files: []