gliss-layout 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +4 -0
- data/lib/gliss.rb +1 -1
- data/readme.md +9 -9
- data/stylesheets/_gliss.scss +4 -4
- data/stylesheets/gliss/_core.scss +25 -25
- data/stylesheets/gliss/_modules.scss +19 -19
- metadata +1 -2
- data/stylesheets/gliss.zip +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96d0fc6c4e645bf9826a608ee848d7cf8b38bb08
|
4
|
+
data.tar.gz: 2e2d54c3e36d974607411604a6cf2c7fd12c0d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc089e406d3e974d4a42d6d1dc138bf872743e459a3372d3edfc0daf95a87d632fbf24dff2ae76e0e145cb3003e58463b2501dd40ab4e5945208664447388ca0
|
7
|
+
data.tar.gz: 2050bf10fe24efaebc87d3832dc1c22ea80ef3dbcd6c78cd16d6a9e7539cdc2decf819dfa720ad695cde84e21d0f4c5033b2e312b6976ff86eb8a16541911daf
|
data/changelog.md
CHANGED
data/lib/gliss.rb
CHANGED
data/readme.md
CHANGED
@@ -42,13 +42,13 @@ First, you are going to want to configure Gliss. Here are the main variables to
|
|
42
42
|
<tr>
|
43
43
|
<th>Variable</th><th>Default</th><th>Description</th></tr>
|
44
44
|
<tr>
|
45
|
-
<td>$max-width</td><td>80rem</td><td>Max width of content container. This must be a fixed width (em, rem or px)</td></tr>
|
45
|
+
<td>$gliss-max-width</td><td>80rem</td><td>Max width of content container. This must be a fixed width (em, rem or px)</td></tr>
|
46
46
|
<tr>
|
47
|
-
<td>$gutter</td><td>1rem</td><td>Gutter width, must be same units as $max-width.</td></tr>
|
47
|
+
<td>$gliss-gutter</td><td>1rem</td><td>Gutter width, must be same units as $max-width.</td></tr>
|
48
48
|
<tr>
|
49
|
-
<td>$margin</td><td>4%</td><td>Margins on either side of the content container.</td></tr>
|
49
|
+
<td>$gliss-margin</td><td>4%</td><td>Margins on either side of the content container.</td></tr>
|
50
50
|
<tr>
|
51
|
-
<td>$cols</td><td>12</td><td>Number of columns the grid is divided into.</td></tr>
|
51
|
+
<td>$gliss-cols</td><td>12</td><td>Number of columns the grid is divided into.</td></tr>
|
52
52
|
</table>
|
53
53
|
|
54
54
|
So far this just provides you with a basic toolset, but if you want to have something more out of the box to work with, set `$gliss-modules` to `true` and define these variables as needed:
|
@@ -69,11 +69,11 @@ So far this just provides you with a basic toolset, but if you want to have some
|
|
69
69
|
|
70
70
|
Gliss is primarily designed to help out with math by providing a few mixins that set the width constraints and alignment on elements.
|
71
71
|
|
72
|
-
The primary mixin you will use is `
|
72
|
+
The primary mixin you will use is `gliss()` and you can pass the small and large constraints to it. If we wanted `foo` to be 6 columns wide at small sizes and 3 columns wide at the largest sizes then we would write it like this:
|
73
73
|
|
74
74
|
```scss
|
75
75
|
foo {
|
76
|
-
@include
|
76
|
+
@include gliss(6,3);
|
77
77
|
}
|
78
78
|
```
|
79
79
|
|
@@ -90,9 +90,9 @@ For alignment, you can choose left, right, or center by using the following mixi
|
|
90
90
|
|
91
91
|
```scss
|
92
92
|
foo {
|
93
|
-
@include
|
94
|
-
@include
|
95
|
-
@include
|
93
|
+
@include gliss-center();
|
94
|
+
@include gliss-left();
|
95
|
+
@include gliss-right();
|
96
96
|
}
|
97
97
|
```
|
98
98
|
|
data/stylesheets/_gliss.scss
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
// Max width of content container. This must be a fixed width (em or px)
|
2
|
-
$max-width:
|
2
|
+
$gliss-max-width: 80rem !default;
|
3
3
|
// Gutter width, must be same units as $max-width.
|
4
|
-
$gutter:
|
4
|
+
$gliss-gutter: 1rem !default;
|
5
5
|
// Margins on either side of the content container.
|
6
|
-
$margin:
|
6
|
+
$gliss-margin: 4% !default;
|
7
7
|
// Number of columns the grid is divided into.
|
8
|
-
$cols:
|
8
|
+
$gliss-cols: 12 !default;
|
9
9
|
|
10
10
|
// Chose to write gliss classes.
|
11
11
|
// By default, only the math tools are avalible.
|
@@ -1,52 +1,52 @@
|
|
1
1
|
// Non-configurable variables for internal use:
|
2
2
|
|
3
3
|
// Find the width of the margins within the context of the container
|
4
|
-
$margin-inv: (100% / (100 - $margin * 2) * $margin);
|
4
|
+
$gliss-margin-inv: (100% / (100 - $gliss-margin * 2) * $gliss-margin);
|
5
5
|
|
6
6
|
|
7
7
|
// Upper limit for elements on the grid. This is a fixed width.
|
8
8
|
@function grid-max(
|
9
9
|
$max:$max,
|
10
|
-
$cols:$cols,
|
11
|
-
$max-width:$max-width,
|
12
|
-
$gutter:$gutter
|
10
|
+
$gliss-cols:$gliss-cols,
|
11
|
+
$gliss-max-width:$gliss-max-width,
|
12
|
+
$gliss-gutter:$gliss-gutter
|
13
13
|
) {
|
14
14
|
|
15
15
|
// Total width of the columns minus the gutters
|
16
|
-
$cols-max-width: $max-width - ($gutter * ($cols - 1));
|
16
|
+
$gliss-cols-max-width: $gliss-max-width - ($gliss-gutter * ($gliss-cols - 1));
|
17
17
|
// Find the max width of a simgle column as a fixed width.
|
18
|
-
$col-max-width: ($cols-max-width / $cols);
|
18
|
+
$col-max-width: ($gliss-cols-max-width / $gliss-cols);
|
19
19
|
|
20
20
|
// All the columns plus gutters.
|
21
|
-
@return ($col-max-width * $max) + ($gutter * ($max - 1));
|
21
|
+
@return ($col-max-width * $max) + ($gliss-gutter * ($max - 1));
|
22
22
|
}
|
23
23
|
|
24
24
|
// The lower constraint, how small can this get?
|
25
25
|
@function grid-min(
|
26
26
|
$min:$min,
|
27
|
-
$cols:$cols,
|
28
|
-
$max-width:$max-width,
|
29
|
-
$gutter:$gutter
|
27
|
+
$gliss-cols:$gliss-cols,
|
28
|
+
$gliss-max-width:$gliss-max-width,
|
29
|
+
$gliss-gutter:$gliss-gutter
|
30
30
|
) {
|
31
31
|
|
32
32
|
// Make sure not to divide by zero.
|
33
|
-
@if $min < $cols {
|
34
|
-
@return calc(#{(100% / $cols) * $min} + #{$gutter * ($min - $cols) / ($cols)});
|
33
|
+
@if $min < $gliss-cols {
|
34
|
+
@return calc(#{(100% / $gliss-cols) * $min} + #{$gliss-gutter * ($min - $gliss-cols) / ($gliss-cols)});
|
35
35
|
}
|
36
36
|
@return 100%;
|
37
37
|
}
|
38
38
|
|
39
|
-
@mixin
|
39
|
+
@mixin gliss(
|
40
40
|
$min:false, // Lower limit (compiles to % constraint)
|
41
41
|
$max:false, // Upper limit (compiles to fixed constraint)
|
42
|
-
$cols:$cols,
|
43
|
-
$max-width:$max-width,
|
44
|
-
$gutter:$gutter
|
42
|
+
$gliss-cols:$gliss-cols,
|
43
|
+
$gliss-max-width:$gliss-max-width,
|
44
|
+
$gliss-gutter:$gliss-gutter
|
45
45
|
) {
|
46
46
|
|
47
47
|
// Write max width first as it is mapped to just width.
|
48
48
|
@if $max {
|
49
|
-
width: grid-max($max,$cols,$max-width,$gutter);
|
49
|
+
width: grid-max($max,$gliss-cols,$gliss-max-width,$gliss-gutter);
|
50
50
|
} @else {
|
51
51
|
// If unspecified, use 100% to ensure the min-width is fulled.
|
52
52
|
width: 100%;
|
@@ -57,7 +57,7 @@ $margin-inv: (100% / (100 - $margin * 2) * $margin);
|
|
57
57
|
// the elements will hit higher %s.
|
58
58
|
// This is the upper bounds on that % but on a smaller screen.
|
59
59
|
@if $min {
|
60
|
-
max-width: grid-min($min,$cols,$max-width,$gutter);
|
60
|
+
max-width: grid-min($min,$gliss-cols,$gliss-max-width,$gliss-gutter);
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
@@ -65,33 +65,33 @@ $margin-inv: (100% / (100 - $margin * 2) * $margin);
|
|
65
65
|
// Alignment
|
66
66
|
|
67
67
|
// Center a thing
|
68
|
-
@mixin
|
68
|
+
@mixin gliss-center {
|
69
69
|
margin-left: auto;
|
70
70
|
margin-right: auto;
|
71
71
|
}
|
72
72
|
|
73
73
|
// Align right
|
74
|
-
@mixin
|
74
|
+
@mixin gliss-right(
|
75
75
|
$offset:0
|
76
76
|
) {
|
77
77
|
|
78
78
|
@if $offset != 0 {
|
79
|
-
$offset: calc(#{(100% / $cols) * $offset} + #{($gutter * ($offset - $cols) / ($cols)) + ($gutter)});
|
79
|
+
$offset: calc(#{(100% / $gliss-cols) * $offset} + #{($gliss-gutter * ($offset - $gliss-cols) / ($gliss-cols)) + ($gliss-gutter)});
|
80
80
|
}
|
81
81
|
|
82
82
|
float: right;
|
83
|
-
margin: 0 $offset 0 $gutter;
|
83
|
+
margin: 0 $offset 0 $gliss-gutter;
|
84
84
|
}
|
85
85
|
|
86
86
|
// Align left
|
87
|
-
@mixin
|
87
|
+
@mixin gliss-left(
|
88
88
|
$offset:0
|
89
89
|
) {
|
90
90
|
|
91
91
|
@if $offset != 0 {
|
92
|
-
$offset: calc(#{(100% / $cols) * $offset} + #{($gutter * ($offset - $cols) / ($cols)) + ($gutter)});
|
92
|
+
$offset: calc(#{(100% / $gliss-cols) * $offset} + #{($gliss-gutter * ($offset - $gliss-cols) / ($gliss-cols)) + ($gliss-gutter)});
|
93
93
|
}
|
94
94
|
|
95
95
|
float: left;
|
96
|
-
margin: 0 $gutter 0 $offset;
|
96
|
+
margin: 0 $gliss-gutter 0 $offset;
|
97
97
|
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
@if $gliss-modules {
|
2
2
|
#{$gliss-wrapper} {
|
3
|
-
padding: 0 $margin;
|
3
|
+
padding: 0 $gliss-margin;
|
4
4
|
margin: 0 auto;
|
5
|
-
max-width: $max-width;
|
5
|
+
max-width: $gliss-max-width;
|
6
6
|
}
|
7
7
|
|
8
8
|
// Text level elements
|
9
9
|
#{$gliss-text} {
|
10
|
-
@include
|
11
|
-
@include
|
10
|
+
@include gliss-center();
|
11
|
+
@include gliss(12,6);
|
12
12
|
body.show-grid & {
|
13
13
|
background: rgba(#f00,.1);
|
14
14
|
}
|
@@ -16,40 +16,40 @@
|
|
16
16
|
|
17
17
|
// figure logic
|
18
18
|
#{$gliss-figure} {
|
19
|
-
margin: 0 ($margin-inv * -1);
|
20
|
-
@media (min-width: ($max-width / 3)) {
|
19
|
+
margin: 0 ($gliss-margin-inv * -1);
|
20
|
+
@media (min-width: ($gliss-max-width / 3)) {
|
21
21
|
&._quarter {
|
22
|
-
@include
|
23
|
-
@include
|
22
|
+
@include gliss-right();
|
23
|
+
@include gliss(6,3);
|
24
24
|
&._left {
|
25
|
-
@include
|
25
|
+
@include gliss-left();
|
26
26
|
}
|
27
27
|
}
|
28
28
|
|
29
29
|
&._third {
|
30
|
-
@include
|
31
|
-
@include
|
30
|
+
@include gliss-right();
|
31
|
+
@include gliss(6,4);
|
32
32
|
&._left {
|
33
|
-
@include
|
33
|
+
@include gliss-left();
|
34
34
|
}
|
35
35
|
}
|
36
36
|
|
37
37
|
&._half {
|
38
|
-
@include
|
39
|
-
@include
|
38
|
+
@include gliss-right();
|
39
|
+
@include gliss(6);
|
40
40
|
&._left {
|
41
|
-
@include
|
41
|
+
@include gliss-left();
|
42
42
|
}
|
43
43
|
}
|
44
44
|
&._hang {
|
45
|
-
margin: 0 ($margin-inv * -1) 0 0;
|
45
|
+
margin: 0 ($gliss-margin-inv * -1) 0 0;
|
46
46
|
float: right;
|
47
47
|
width: calc(
|
48
|
-
(100% - #{grid-max(6)}) / 2 + #{$margin-inv} + #{
|
48
|
+
(100% - #{grid-max(6)}) / 2 + #{$gliss-margin-inv} + #{gliss-max(6)}
|
49
49
|
);
|
50
|
-
max-width: 100% + $margin-inv * 2;
|
50
|
+
max-width: 100% + $gliss-margin-inv * 2;
|
51
51
|
&._left {
|
52
|
-
margin: 0 0 0 ($margin-inv * -1);
|
52
|
+
margin: 0 0 0 ($gliss-margin-inv * -1);
|
53
53
|
float: left;
|
54
54
|
}
|
55
55
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gliss-layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Kellum
|
@@ -42,7 +42,6 @@ files:
|
|
42
42
|
- license.md
|
43
43
|
- readme.md
|
44
44
|
- stylesheets/_gliss.scss
|
45
|
-
- stylesheets/gliss.zip
|
46
45
|
- stylesheets/gliss/_core.scss
|
47
46
|
- stylesheets/gliss/_modules.scss
|
48
47
|
homepage: http://product.voxmedia.com
|
data/stylesheets/gliss.zip
DELETED
Binary file
|