crispy-grid 0.3.0 → 0.3.1
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.
- data/README.md +25 -26
- data/stylesheets/_crispy-grid.sass +16 -6
- data/stylesheets/crispy/_grid.sass +15 -4
- data/templates/project/_crispy-grid.sass +18 -8
- metadata +3 -3
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
|
-
|
59
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
-
|
70
|
-
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
86
|
-
|
85
|
+
// Import Crispy Grid below the configuration
|
86
|
+
@import crispy/grid
|
87
|
+
```
|
87
88
|
|
88
|
-
##
|
89
|
+
## Changelog
|
89
90
|
|
90
|
-
|
91
|
+
There is one. [Have a look at it](https://github.com/ChristianPeters/crispy-grid/blob/master/CHANGELOG.md).
|
91
92
|
|
92
|
-
##
|
93
|
+
## License
|
93
94
|
|
94
|
-
-
|
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
|
-
|
11
|
-
$
|
12
|
-
$grid-
|
13
|
-
$grid-
|
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
|
-
@
|
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
|
3
|
+
// Copy this into your app and uncomment and customize the respective configuration variables
|
4
4
|
|
5
|
-
//
|
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
|
-
|
12
|
-
$
|
13
|
-
$grid-
|
14
|
-
$grid-
|
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.
|
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:
|
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.
|
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
|