compass-lucid-grid 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1 @@
1
+ #Yay!
data/lib/lucid.rb ADDED
@@ -0,0 +1,3 @@
1
+ require 'compass'
2
+ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
+ Compass::Frameworks.register('lucid', :path => extension_path)
@@ -0,0 +1,32 @@
1
+ //============================================================================//
2
+ //
3
+ // THE LUCID GRID | SETUP
4
+ // plugin by Yifei Zhang [http://yifei.co]
5
+ //
6
+ //============================================================================//
7
+
8
+ // Grid configuration
9
+ $grid-width: 960px !default;
10
+ $grid-columns: 12 !default;
11
+ $grid-gutter: 15px !default;
12
+ $grid-outer-gutter: 30px !default;
13
+
14
+ // @extend hook class names
15
+ $grid-hook-container: ".lucid-grid" !default;
16
+ $grid-hook-row: ".lucid-row" !default;
17
+ $grid-hook-column: ".lucid-column" !default;
18
+ $grid-hook-gutterless: ".lucid-gutterless" !default;
19
+
20
+ // Use "pie-clearfix" clearfix or "overflow" clearfix?
21
+ $grid-clearfix: "pie-clearfix" !default;
22
+
23
+ // Center rows by default?
24
+ $grid-centering: true !default;
25
+
26
+ //
27
+ // Imports
28
+ //
29
+
30
+ @import 'lucid/internal';
31
+ @import 'lucid/public';
32
+
@@ -0,0 +1,62 @@
1
+ //============================================================================//
2
+ //
3
+ // THE LUCID GRID | INTERNAL MIXINS
4
+ // plugin by Yifei Zhang [http://yifei.co]
5
+ //
6
+ //============================================================================//
7
+
8
+ // Calculate the base grid "unit"
9
+ $grid-inner-width: $grid-width - (2 * ($grid-outer-gutter - $grid-gutter));
10
+ $gu: $grid-inner-width / $grid-columns;
11
+
12
+ // Grid Container
13
+ // Applies the grid width and centering
14
+ @mixin _grid-container($width: $grid-width, $centered: $grid-centering);
15
+ @if $centered == true {
16
+ margin-left: auto;
17
+ margin-right: auto;
18
+ }
19
+
20
+ width: $width;
21
+ }
22
+
23
+ // Grid Rows
24
+ // Centered to create outer gutter appearance
25
+ // Applies clearfix (to contain floats)
26
+ @mixin _grid-row($clearfix) {
27
+ margin-left: auto;
28
+ margin-right: auto;
29
+
30
+ @if $clearfix == overflow {
31
+ @include clearfix;
32
+ } @else {
33
+ @include pie-clearfix;
34
+ }
35
+ }
36
+
37
+ // Styles shared by all grid elements
38
+ // Optionally include gutter
39
+ @mixin _grid-element($gutter) {
40
+ display: inline;
41
+ float: left;
42
+
43
+ @if $gutter > 0 {
44
+ margin-left: $grid-gutter;
45
+ margin-right: $grid-gutter;
46
+ }
47
+ }
48
+
49
+ // Individual styles for each grid element
50
+ @mixin _grid-element-style($columns, $offset, $gutter, $adjustment) {
51
+
52
+ // Shift element left or right with +/- $offset
53
+ @if $offset > 0 {
54
+ margin-left: ($offset * $gu) + $gutter;
55
+ } @else if $offset < 0 {
56
+ margin-left: ($offset * $gu) - $gutter;
57
+ }
58
+
59
+ // Adjust element width
60
+ width: ($columns * $gu) - $adjustment - ($gutter * 2);
61
+ }
62
+
@@ -0,0 +1,67 @@
1
+ //============================================================================//
2
+ //
3
+ // THE LUCID GRID | PUBLIC MIXINS
4
+ // plugin by Yifei Zhang [http://yifei.co]
5
+ //
6
+ //============================================================================//
7
+
8
+ // Generate @extend hooks
9
+ @mixin grid-hooks {
10
+ #{$grid-hook-container} { @include _grid-container; }
11
+ #{$grid-hook-row} { @include _grid-row($grid-clearfix); }
12
+ #{$grid-hook-column} { @include _grid-element($grid-gutter); }
13
+ #{$grid-hook-gutterless} { @include _grid-element(0); }
14
+ }
15
+
16
+ //
17
+ // Grid Mixins
18
+ //
19
+
20
+ // Container
21
+ @mixin grid {
22
+ @extend #{$grid-hook-container};
23
+ }
24
+
25
+ // Row
26
+ @mixin row {
27
+ @extend #{$grid-hook-row};
28
+ }
29
+
30
+ // Element (with gutters)
31
+ @mixin col($columns, $offset: 0, $width-adjustment: 0) {
32
+ @extend #{$grid-hook-column};
33
+ @include _grid-element-style($columns, $offset, $grid-gutter, $width-adjustment);
34
+ }
35
+
36
+ // Element (without gutters)
37
+ @mixin col-gutterless($columns, $offset: 0, $width-adjustment: 0) {
38
+ @extend #{$grid-hook-gutterless};
39
+ @include _grid-element-style($columns, $offset, 0, $width-adjustment);
40
+ }
41
+
42
+ //
43
+ // Experimental Media Query Adjustments
44
+ //
45
+
46
+ @mixin grid-adjustment($columns) {
47
+ $width: $columns * $gu;
48
+
49
+ #{$grid-hook-container} { @include _grid-container($width, false); }
50
+ }
51
+
52
+ //
53
+ // Generate Non-semantic Classes
54
+ //
55
+
56
+ @mixin grid-classes($gutterless: false, $prefix: 'g', $gutterless-prefix: 'gl') {
57
+ @for $i from 1 through $grid-columns {
58
+ .#{$prefix}#{$i} { @include col($i); }
59
+ }
60
+
61
+ @if $gutterless != false {
62
+ @for $i from 1 through $grid-columns {
63
+ .#{$gutterless-prefix}#{$i} { @include col-gutterless($i); }
64
+ }
65
+ }
66
+ }
67
+
@@ -0,0 +1,52 @@
1
+ //============================================================================//
2
+ //
3
+ // THE LUCID GRID | QUICKSTART
4
+ // plugin by Yifei Zhang [http://yifei.co]
5
+ //
6
+ // @import this into your project or paste into your base/bootstrap file
7
+ //
8
+ //============================================================================//
9
+
10
+ //
11
+ // Configuration and Initialization
12
+ //
13
+ // Already have Compass @imported? Go ahead and remove `clearfix`.
14
+ //
15
+ // Configuration $variables should be defined before Lucid is @imported.
16
+ // View the full list of options and defaults at [http://yifei.co/lucid]
17
+ //
18
+
19
+ @import "compass/utilities/general/clearfix";
20
+ @import 'lucid';
21
+
22
+ //
23
+ // @Extend Hooks (Required)
24
+ //
25
+ // Lucid uses SASS's @extend (internally!) in order to produce leaner compiled
26
+ // stylesheets*. The `grid-hooks` mixin generates four base classes that are
27
+ // reused by Lucid's other mixins through @extend.
28
+ //
29
+ // * @include misused leads to fat, repetative stylesheets. Lucid knows better.
30
+ //
31
+
32
+ @include grid-hooks;
33
+
34
+ //============================================================================//
35
+ //
36
+ // BASIC USAGE
37
+ // For the full docs, visit [http://yifei.co/lucid]
38
+ //
39
+ // @include grid; // setup a new grid container
40
+ // @include row; // setup a new grid row
41
+ //
42
+ // @include col(3); // grid element that spans 3 columns
43
+ // @include col(3, 2); // shifted 2 columns to right
44
+ // @include col(3, 2, 20px); // subtract 20px from `width` to adjust for borders/padding
45
+ // @include col-gutterless(5, 2); // "gutterless" element, identical usage to `col()`
46
+ //
47
+ // @include grid-classes; // generate .g* classes to use in markup
48
+ // @include grid-classes(true); // generate .g* and .gl* (gutterless) classes
49
+ //
50
+ // @include grid-adjustment($n); // reduce container to $n columns (width)
51
+ //
52
+ //============================================================================//
@@ -0,0 +1,49 @@
1
+ description "A Compass/SASS grid for people who love semantics."
2
+
3
+ discover :all
4
+
5
+ help %Q{
6
+ THE LUCID GRID | HELP
7
+
8
+ SETUP
9
+
10
+ @import 'lucid'
11
+ @include grid-hooks; // generate @extend hooks
12
+
13
+
14
+ BASIC USAGE
15
+
16
+ @include grid; // setup a new grid container
17
+ @include row; // setup a new grid row
18
+
19
+ @include col(3); // grid element that spans 3 columns
20
+ @include col(3, 2); // shifted 2 columns to right
21
+ @include col(3, 2, 20px); // subtract 20px from `width` to adjust for borders/padding
22
+ @include col-gutterless(5, 2); // "gutterless" element, identical usage to `col()`
23
+
24
+ @include grid-classes; // generate .g* classes to use in markup
25
+ @include grid-classes(true); // generate .g* and .gl* (gutterless) classes
26
+
27
+ @include grid-adjustment($n); // reduce container to $n columns (width)
28
+
29
+ ***
30
+
31
+ For the full docs, visit [http://yifei.co/lucid]
32
+ To view the source, visit [https://github.com/ezYZ/lucid]
33
+
34
+ }
35
+
36
+ welcome_message %Q{
37
+ THE LUCID GRID
38
+ plugin by Yifei Zhang
39
+
40
+ Congrats! Your project templating life is about to become a lot saner.
41
+
42
+ For examples and documentation, visit:
43
+ http://yifei.co/lucid
44
+
45
+ Contribute on GitHub:
46
+ https://github.com/ezYZ/lucid
47
+
48
+ ***
49
+ }
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-lucid-grid
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Yifei Zhang
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-05-21 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: compass
16
+ requirement: &85923390 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.11'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *85923390
25
+ description: A Compass/SASS grid for people who love semantics.
26
+ email: yz@yifei.co
27
+ executables: []
28
+ extensions: []
29
+ extra_rdoc_files: []
30
+ files:
31
+ - README.md
32
+ - lib/lucid.rb
33
+ - stylesheets/lucid/_internal.scss
34
+ - stylesheets/lucid/_public.scss
35
+ - stylesheets/_lucid.scss
36
+ - templates/project/manifest.rb
37
+ - templates/project/_grid.scss
38
+ homepage: http://yifei.co/lucid/
39
+ licenses: []
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 1.8.3
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: A Compass/SASS grid for people who love semantics.
62
+ test_files: []