crispy-grid 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -46,8 +46,7 @@ Pending. Please have a look at the source.
46
46
 
47
47
  gem 'crispy-grid'
48
48
 
49
- 2. In your project configuration file (e.g. initializers/compass.rb)
50
- add:
49
+ 2. In your project configuration file (e.g. initializers/compass.rb, [you might want to](https://github.com/Compass/compass-rails/blob/stable/README.md#configuration) create one if it does not exist yet) add:
51
50
 
52
51
  require 'crispy-grid'
53
52
 
@@ -55,19 +54,19 @@ Pending. Please have a look at the source.
55
54
 
56
55
  ### Configuration for a Single Device
57
56
 
58
- The grid configuration is layed out for multiple devices.
59
- Though, you can also use Crispy Grid the classic way without any overhead.
60
- Just provide one setting and ignore the fact that the variables are
61
- written in plural.
57
+ Tell Crispy Grid to use a single device by setting the singular
58
+ configuration options `$device`, `$grid-column-width`, and `grid-gutter-width`.
62
59
 
63
- // Copy this into your app in order to customize the grid
64
- $devices: desktop
65
- $grid-column-widths: 30px
66
- $grid-gutter-widths: 10px
67
- $grid-columns: 25
60
+ ``` sass
61
+ // Copy this into your app in order to customize the grid
62
+ $device: desktop
63
+ $grid-column-width: 30px
64
+ $grid-gutter-width: 10px
65
+ $grid-columns: 24
68
66
 
69
- // Import Crispy Grid below the configuration
70
- @import crispy/grid
67
+ // Import Crispy Grid below the configuration
68
+ @import crispy/grid
69
+ ```
71
70
 
72
71
  ### Configuration for Multiple Devices
73
72
 
@@ -76,21 +75,21 @@ The nth entry of any of the following lists belongs to the nth device (the order
76
75
  The first device is the default for all grid helpers.
77
76
  Consider to set mobile as default device when following the mobile-first design approach.
78
77
 
79
- // Copy this into your app in order to customize the grid
80
- $devices: desktop, tablet, handheld-640, handheld-320
81
- $grid-column-widths: 30px, 30px, 20px, 20px
82
- $grid-gutter-widths: 10px, 10px, 5px, 5px
83
- $grid-columns: 30, 25, 25, 13
78
+ ``` sass
79
+ // Copy this into your app in order to customize the grid
80
+ $devices: desktop, tablet, handheld-640, handheld-320
81
+ $grid-column-widths: 30px, 30px, 20px, 20px
82
+ $grid-gutter-widths: 10px, 10px, 5px, 5px
83
+ $grid-columns: 30, 24, 24, 13
84
84
 
85
- // Import Crispy Grid below the configuration
86
- @import crispy/grid
85
+ // Import Crispy Grid below the configuration
86
+ @import crispy/grid
87
+ ```
87
88
 
88
- ## License
89
+ ## Changelog
89
90
 
90
- See MIT-LICENSE.
91
+ There is one. [Have a look at it](https://github.com/ChristianPeters/crispy-grid/blob/master/CHANGELOG.md).
91
92
 
92
- ## TODO
93
+ ## License
93
94
 
94
- - Make use of @extend in order to reduce CSS output
95
- - Return calculation of inner box width for further use as column width
96
- of children
95
+ See MIT-LICENSE.
@@ -1,15 +1,25 @@
1
1
  // Crispy Grid Configuration
2
2
  //==========================
3
3
 
4
+ // Configuration for a Single Device
5
+ // ----------------------------------
6
+ // Tell Crispy Grid to use a single device by setting the $device variable.
7
+
8
+ // $device: desktop
9
+ // $grid-column-width: 30px
10
+ // $grid-gutter-width: 10px
11
+ // $grid-columns: 24
12
+
13
+ // Configuration for Multiple Devices
14
+ // ----------------------------------
4
15
  // Configure grid for every device you whish to respond to
5
16
  // The nth entry of any list belongs to the nth device (the order of $devices matters).
6
- // The lists can take any number of devices, including 1.
7
- // If you do not plan to support multiple devices, you may want to delete all but the first entries.
8
17
  // The first device is the default for all grid helpers.
9
18
  // Consider to set mobile as default device when following the mobile-first design approach.
10
- $devices: desktop, tablet, handheld-640, handheld-320 !default
11
- $grid-column-widths: 30px, 30px, 20px, 20px !default
12
- $grid-gutter-widths: 10px, 10px, 5px, 5px !default
13
- $grid-columns: 30, 25, 25, 13 !default
19
+
20
+ // $devices: desktop, tablet, handheld-640, handheld-320
21
+ // $grid-column-widths: 30px, 30px, 20px, 20px
22
+ // $grid-gutter-widths: 10px, 10px, 5px, 5px
23
+ // $grid-columns: 30, 25, 25, 13
14
24
 
15
25
  @import crispy/grid
@@ -2,17 +2,28 @@
2
2
 
3
3
  // Grid Configuration Accessors
4
4
  //=============================
5
+ $device: false !default
6
+ $devices: false !default
7
+ $grid-column-width: false !default
8
+ $grid-column-widths: false !default
9
+ $grid-gutter-width: false !default
10
+ $grid-gutter-widths: false !default
11
+ $grid-columns: 24 !default
12
+
5
13
  @function default-device()
6
- @return nth($devices, 1)
14
+ @return $device or nth($devices, 1)
7
15
 
8
16
  @function grid-column-width($device: default-device())
9
- @return nth($grid-column-widths, index($devices, $device))
17
+ @return $grid-column-width or nth($grid-column-widths, index($devices, $device))
10
18
 
11
19
  @function grid-gutter-width($device: default-device())
12
- @return nth($grid-gutter-widths, index($devices, $device))
20
+ @return $grid-gutter-width or nth($grid-gutter-widths, index($devices, $device))
13
21
 
14
22
  @function grid-columns($device: default-device())
15
- @return nth($grid-columns, index($devices, $device))
23
+ @if type-of($grid-columns) == list
24
+ @return nth($grid-columns, index($devices, $device))
25
+ @else
26
+ @return $grid-columns
16
27
 
17
28
  // Note that the gutter is only between the columns, i.e. you have 1 gutter less than columns
18
29
  @function grid-gutters($device: default-device())
@@ -1,17 +1,27 @@
1
1
  // Crispy Grid Configuration
2
2
  //==========================
3
- // Copy this into your app in order to customize the grid
3
+ // Copy this into your app and uncomment and customize the respective configuration variables
4
4
 
5
- // Configure grid for every device you whish to respond to
5
+ // Configuration for a Single Device
6
+ // ----------------------------------
7
+ // Tell Crispy Grid to use a single device by setting the $device variable.
8
+
9
+ // $device: desktop
10
+ // $grid-column-width: 30px
11
+ // $grid-gutter-width: 10px
12
+ // $grid-columns: 24
13
+
14
+ // Configuration for Multiple Devices
15
+ // ----------------------------------
16
+ // Configure grid for every device you whish to respond to.
6
17
  // The nth entry of any list belongs to the nth device (the order of $devices matters).
7
- // The lists can take any number of devices, including 1.
8
- // If you do not plan to support multiple devices, you may want to delete all but the first entries.
9
18
  // The first device is the default for all grid helpers.
10
19
  // Consider to set mobile as default device when following the mobile-first design approach.
11
- $devices: desktop, tablet, handheld-640, handheld-320 !default
12
- $grid-column-widths: 30px, 30px, 20px, 20px !default
13
- $grid-gutter-widths: 10px, 10px, 5px, 5px !default
14
- $grid-columns: 30, 25, 25, 13 !default
20
+
21
+ // $devices: desktop, tablet, handheld-640, handheld-320
22
+ // $grid-column-widths: 30px, 30px, 20px, 20px
23
+ // $grid-gutter-widths: 10px, 10px, 5px, 5px
24
+ // $grid-columns: 30, 25, 25, 13
15
25
 
16
26
  // This import statement has to be included in your application stylesheet
17
27
  @import crispy/grid
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: crispy-grid
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Christian Peters
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-30 00:00:00 Z
13
+ date: 2012-05-04 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: compass
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements: []
74
74
 
75
75
  rubyforge_project:
76
- rubygems_version: 1.8.7
76
+ rubygems_version: 1.8.17
77
77
  signing_key:
78
78
  specification_version: 3
79
79
  summary: A Compass-based Grid that strives for lean & sane CSS and supports complex layouts