respondsass 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,146 @@
1
+ RespondSass
2
+ =============
3
+
4
+ What is it?
5
+ -----------
6
+
7
+ Respondsass is a collection of .scss files to help speed up web development. It has been designed to be configurable but lightweight. It's built 320 mobile first and up, using ems in the media queries. Respondsass has 3 objectives.
8
+
9
+ Concise, optimised CSS output
10
+
11
+ The issue I saw with most frameworks was the amount of CSS in the files to created huge grid options where you may only use one or two classes. In Respondsass because you create the classes you determine how much CSS is in the outputed file and only class being used in the grid will be there.
12
+
13
+ Ems for media queries
14
+
15
+ I think this is now the defacto way to create media queries but I still see lots of frameworks using pixel values for media queries. if you want to learn more about the reason why I chose to go with em based media queries read this post by Lyza Gardner
16
+
17
+ Rems for fonts and spacing
18
+
19
+ Using rems with pixel fallbacks is a future friendly way to implement sizing for fonts and spacing. I've also created a configurable baseline grid to create a nice verticle rhythm.
20
+
21
+ Getting started
22
+ ---------------
23
+
24
+ To download the exstension go the github repository.
25
+
26
+ Creating the grid
27
+ -----------------
28
+
29
+ Creating columns is easy and is by default based of a 16 column grid. First set your html. If I wanted to set up a one row grid with 4 columns, each the same with we could do this.
30
+
31
+ <div class="container">
32
+ <div class="row">
33
+ <nav class="span-4"></nav>
34
+ <section class="span-4"></section>
35
+ <section class="span-4"></section>
36
+ <aside class="span-4"></aside>
37
+ </div>
38
+ </div>
39
+
40
+ Simply import the create grid partial
41
+
42
+ @import "respondsass/create-grid";
43
+
44
+ Then include create grid - this will create the default 16 column grid with a 1.25% gutter.
45
+
46
+ @include create-grid();
47
+
48
+ To create something bespoke you just pass in some parameters. If you would like a 3 column layout simple. Simply pass in how many coulmns and what the class name will be.
49
+
50
+ @include create-grid(thirds, 3);
51
+
52
+ This creates 3 column layout with class names third-1 (spans one third of containing element), thirds-2 (spans 2 thirds of containing element) and thirds-3 that is full width
53
+
54
+ We could use this by doing thing like this
55
+
56
+ <div class="container">
57
+ <div class="row">
58
+ <nav class="thirds-1"></nav>
59
+ <section class="thirds-2"></section>
60
+ </div>
61
+ </div>
62
+
63
+ Easy Nav - Navigation
64
+ ---------------------
65
+
66
+ Just some simple styling to help you get navigation up and running. I found I was doing the same things over and over again with navigation. So I have put them in a mixin.
67
+
68
+ To create a horizontal navigation with 4 links, again first create the html
69
+
70
+ <ul id="nav">
71
+ <li><a href="#">Home</a></li>
72
+ <li><a href="#">Blog</a></li>
73
+ <li><a href="#">About Us</a></li>
74
+ <li><a href="#">Contact</a></li>
75
+ </ul>
76
+ Then in your ul declaration in your sass just include:
77
+
78
+ @include horizontal-nav(4);
79
+ This will create a nice equally sized horizontal navigation that you can add extra styles such a font-sizes and colours.
80
+
81
+ For a vertical nav do the same html but include:
82
+
83
+ @include vertical-nav();
84
+
85
+ There's no parameter for this one just the declaration.
86
+
87
+ Rem sizing
88
+ ----------
89
+
90
+ This can be included in any elements css declaration and creates a future friendly rem value with pixel fallback for and declaration passed to it. As with all things you need to import the sass file.
91
+
92
+ @import "respondsass/rem-sizing";
93
+
94
+ Then to set the bottom margin of an element to 1 rem just include the following.
95
+
96
+ @include rem-sizing(margin-bottom, 1);
97
+
98
+ Simple. This can be used for any declaration. Font-size, padding, margin etc.
99
+
100
+ Buttons
101
+ -------
102
+
103
+ Buttons take 4 parameters. Border-radius, background-colour, font-colour and gradient. To use again import the sass file
104
+
105
+ @import "respondsass/buttons";
106
+
107
+ Then simply include the code. The first parameter is for border-radius and takes a pixel value, the second and third are background and font colour respectively. Both take a colour value. The final is gradient and this take either true (if you want a gradient) or false if you don't. If you choose gradient it will use the background colour passed in to create the gradient and the border. This is the order
108
+
109
+ @include button ($radius, $bg-color, $font-color, $gradient);
110
+ And this is the usage
111
+
112
+ @include button ($radius:0, $bg-color: $primaryCol, $font-color: #fff, $gradient:false);
113
+
114
+ Typography Baseline
115
+ -------------------
116
+
117
+ Simple baseline based on the baseline rhythm calculator
118
+
119
+ I tend to create a typography partial in sass in there I would set my standard stuff such as as assigning a font family to a variable and setting basic colours and sizes.
120
+
121
+ $font-face: Open Sans, HelveticaNeue, Calibri, sans-serif;
122
+
123
+ html {
124
+ -webkit-font-smoothing: antialiased;
125
+ font-size: 100%;
126
+ color: #000000;
127
+ }
128
+
129
+ Again then just make sure you have imported the baseline file
130
+
131
+ @import "respondsass/baseline";
132
+
133
+ Then just include the baseline mixin and pass in some parameters in the order below:
134
+
135
+ @include baseline($font-face, $base-line-font, $base-line-height);
136
+
137
+ So actual code would look something like this.
138
+
139
+ @include baseline($font: $font-face, $base-line-font: 14, $base-line-height: 1.5);
140
+
141
+ Get involved
142
+ ------------
143
+
144
+ This is very much an early version of the framework but if you like it please say so.
145
+
146
+ Also, if you have spot any errors or would like to contribute please get in touch matt@my-html-codes.com
@@ -0,0 +1,4 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register('respondsass',
3
+ :stylesheets_directory => File.join(File.dirname(__FILE__), '..', 'stylesheets'),
4
+ :templates_directory => File.join(File.dirname(__FILE__), '..', 'templates'))
@@ -0,0 +1,8 @@
1
+ // Your Compass Extension's Sass goes here! Run wild!
2
+ @import "respondsass/baseline";
3
+ @import "respondsass/buttons";
4
+ @import "respondsass/col-generator";
5
+ @import "respondsass/create-grid";
6
+ @import "respondsass/easy-nav";
7
+ @import "respondsass/rem-sizing";
8
+ @import "respondsass/respond-to";
@@ -0,0 +1,56 @@
1
+
2
+ $f: HelveticaNeue, Helvetica, Calibri, sans-serif !default;
3
+ $l-h: 1.5 !default;
4
+ $f-s: 16 !default;
5
+
6
+
7
+ @mixin baseline($font:$f, $base-line-font: $f-s, $base-line-height: $l-h){
8
+
9
+ $b-f-s: $base-line-font/16;
10
+
11
+ body {
12
+ @include rem-sizing(font-size, $b-f-s);
13
+ }
14
+
15
+ h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, a {
16
+ font-family: $font;
17
+ }
18
+
19
+ h1 {
20
+ @include rem-sizing(font-size, $b-f-s*1.75);
21
+ line-height: $base-line-height;
22
+ @include rem-sizing(margin-bottom, $base-line-height/($b-f-s*1.75));
23
+ }
24
+
25
+ h2 {
26
+ @include rem-sizing(font-size, $b-f-s*1.45);
27
+ line-height: $base-line-height;
28
+ @include rem-sizing(margin-bottom, $base-line-height/($b-f-s*1.45));
29
+ }
30
+
31
+ h3 {
32
+ @include rem-sizing(font-size, $b-f-s*1.285);
33
+ line-height: $base-line-height;
34
+ @include rem-sizing(margin-bottom, $base-line-height/($b-f-s*1.285));
35
+ }
36
+
37
+ h4 {
38
+ @include rem-sizing(font-size, $b-f-s*1.142);
39
+ line-height: $base-line-height;
40
+ @include rem-sizing(margin-bottom, $base-line-height/($b-f-s*1.142));
41
+ }
42
+
43
+ p, ul, blockquote, pre, td, th, label {
44
+ @include rem-sizing(font-size, $b-f-s);
45
+ line-height: $base-line-height;
46
+ @include rem-sizing(margin-bottom, $base-line-height);
47
+ }
48
+
49
+ table {
50
+ border-collapse: collapse;
51
+ @include rem-sizing(margin-bottom, $base-line-height);
52
+ }
53
+
54
+ }
55
+
56
+
@@ -0,0 +1,31 @@
1
+ @import "compass/css3";
2
+
3
+ $default-radius: 2px !default;
4
+ $default-bg-color: #ccc !default;
5
+ $default-gradient: false !default;
6
+ $default-font-size: 1 !default;
7
+ $default-font-color: #333 !default;
8
+
9
+
10
+ @mixin button ($radius: $default-radius, $bg-color: $default-bg-color, $font-color: $default-font-color, $font-size: $default-font-size, $gradient: $default-gradient){
11
+ @if $gradient == true {
12
+ @include background-image(linear-gradient(lighten($bg-color, 5%),darken($bg-color, 5%)));
13
+ } @else {
14
+ background: $bg-color;
15
+ }
16
+ display: inline-block;
17
+ *display:block;
18
+ @include rem-sizing(padding-top, .55);
19
+ @include rem-sizing(padding-bottom, .55);
20
+ @include rem-sizing(padding-right, 1);
21
+ @include rem-sizing(padding-left, 1);
22
+ outline: none;
23
+ cursor: pointer;
24
+ text-align: center;
25
+ text-decoration: none;
26
+ @include rem-sizing(font-size, 0.9);
27
+ color: $font-color;
28
+ @include border-radius($radius);
29
+ // this determines Mozilla to show the padding
30
+ border: solid 1px darken($bg-color, 10%);
31
+ }
@@ -0,0 +1,11 @@
1
+ // Set all variables
2
+
3
+ $totalColumns: 16 !default;
4
+
5
+ // Grid generation mixin
6
+
7
+ @mixin col-generator($num-columns: $col-number, $total-cols: $total-columns) {
8
+ $column-width: 100% / $total-cols; // Finding column width by dividing space left by number of columns
9
+ $width: ($num-columns * $column-width);
10
+ width: $width;
11
+ }
@@ -0,0 +1,41 @@
1
+ @import "col-generator";
2
+ @import "respond-to";
3
+ @import "rem-sizing";
4
+
5
+ .container{
6
+ margin: 0 auto;
7
+ max-width:1200px;
8
+ clear: both;
9
+ }
10
+
11
+ .row {
12
+ overflow: hidden;
13
+ clear:both;
14
+ @include rem-sizing(margin-bottom,.8);
15
+ padding: 0 2% 0 2%;
16
+ }
17
+
18
+ $class: span !default;
19
+ $cols: 16 !default;
20
+ $gutter: 1.25% !default;
21
+
22
+ @mixin create-grid ($class-name:$class, $columns:$cols, $gutter:$gutter) {
23
+
24
+ %grid-rules-#{$class-name} {
25
+ float:left;
26
+ @include box-sizing(border-box);
27
+ @include col-generator($num-columns:$columns, $total-cols:$columns);
28
+ }
29
+
30
+
31
+ @for $i from 1 through $columns{
32
+ .#{$class-name}-#{$i}{
33
+ @extend %grid-rules-#{$class-name};
34
+ @include respond-to(tablets-and-above) {
35
+ @include col-generator($num-columns:$i, $total-cols:$columns);
36
+ padding-right:0;
37
+ padding-left:$gutter;
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,44 @@
1
+ @import "rem-sizing";
2
+
3
+ @mixin horizontal-nav($num-list-items){
4
+ $list-item-pc: percentage($num-list-items/($num-list-items*$num-list-items));
5
+ text-align: right;
6
+ overflow: auto;
7
+ width: 100%;
8
+ padding:0;
9
+ list-style:none;
10
+ li {
11
+ margin: 0;
12
+ text-align: center;
13
+ overflow: auto;
14
+ float: left;
15
+ width: $list-item-pc;
16
+ padding-left:1%;
17
+ @include box-sizing(border-box);
18
+ a {
19
+ text-decoration: none;
20
+ display: block;
21
+ }
22
+ &:first-child {
23
+ padding-left:0;
24
+ }
25
+ }
26
+ }
27
+
28
+ @mixin vertical-nav(){
29
+ overflow: auto;
30
+ padding:0;
31
+ list-style:none;
32
+ li {
33
+ margin: 0;
34
+ overflow: auto;
35
+ @include box-sizing(border-box);
36
+ a {
37
+ text-decoration: none;
38
+ display: block;
39
+ @include rem-sizing(padding-bottom,.4);
40
+ @include rem-sizing(padding-left,.4);
41
+ @include rem-sizing(padding-top,.4);
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,9 @@
1
+ $default-p: margin-bottom;
2
+ $default-v: 1;
3
+ $px: px;
4
+
5
+ @mixin rem-sizing ($propery: $default-p, $value: $default-v){
6
+ $v: $value*16;
7
+ #{$propery}: #{$v}px;
8
+ #{$propery}: #{$value}rem;
9
+ }
@@ -0,0 +1,14 @@
1
+ @mixin respond-to($media) {
2
+ @if $media == wide-handhelds {
3
+ @media only screen and (min-width: 30em) and (max-width: 45.938em) { @content; }
4
+ }
5
+ @else if $media == tablets-and-above {
6
+ @media only screen and (min-width: 46em) { @content; }
7
+ }
8
+ @else if $media == tablets-landscape-and-above {
9
+ @media only screen and (min-width: 60em) { @content; }
10
+ }
11
+ @else if $media == desktop-and-above {
12
+ @media only screen and (min-width: 70em) { @content; }
13
+ }
14
+ }
@@ -0,0 +1,18 @@
1
+ # Make sure you list all the project template files here in the manifest.
2
+ stylesheet 'screen.scss', :media => 'screen, projection'
3
+
4
+ description "Respondsass: a fully configurable grid system native to compass."
5
+
6
+ help %Q{
7
+ Please see the Respondsass website for all documentation and tutorials:
8
+
9
+ http://ww.my-html-codes.com/respondsass
10
+ }
11
+
12
+ welcome_message %Q{
13
+ Please see the Respondsass website for all documentation and tutorials:
14
+
15
+ http://ww.my-html-codes.com/respondsass
16
+
17
+ To get started, set up your grid in the base partial by following the inline instructions.
18
+ }
@@ -0,0 +1,4 @@
1
+ // This is where you put the contents of the main stylesheet for the user's project.
2
+ // It should import your sass stylesheets and demonstrate how to use them.
3
+ @import "compass/reset";
4
+ @import "respondsass";
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: respondsass
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Matt Walker
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-01-08 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: compass
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 43
29
+ segments:
30
+ - 0
31
+ - 12
32
+ - 2
33
+ version: 0.12.2
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: sass
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 15
45
+ segments:
46
+ - 3
47
+ - 2
48
+ - 0
49
+ version: 3.2.0
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ description: Respondsass - Configurable responsive framework for Sass and Compass
53
+ email: matt@my-html-codes.com
54
+ executables: []
55
+
56
+ extensions: []
57
+
58
+ extra_rdoc_files: []
59
+
60
+ files:
61
+ - README.md
62
+ - lib/respondsass.rb
63
+ - templates/project/manifest.rb
64
+ - templates/project/screen.scss
65
+ - stylesheets/_respondsass.scss
66
+ - stylesheets/respondsass/_baseline.scss
67
+ - stylesheets/respondsass/_buttons.scss
68
+ - stylesheets/respondsass/_col-generator.scss
69
+ - stylesheets/respondsass/_create-grid.scss
70
+ - stylesheets/respondsass/_easy-nav.scss
71
+ - stylesheets/respondsass/_rem-sizing.scss
72
+ - stylesheets/respondsass/_respond-to.scss
73
+ homepage: http://www.my-html-codes.com/respondsass
74
+ licenses: []
75
+
76
+ post_install_message:
77
+ rdoc_options: []
78
+
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ hash: 23
96
+ segments:
97
+ - 1
98
+ - 3
99
+ - 6
100
+ version: 1.3.6
101
+ requirements: []
102
+
103
+ rubyforge_project:
104
+ rubygems_version: 1.8.25
105
+ signing_key:
106
+ specification_version: 3
107
+ summary: Easy way to create a responsive grid framework with Sass
108
+ test_files: []
109
+