chameleon-sass 0.0.12 → 0.5.4
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.
- checksums.yaml +4 -4
- data/README.md +47 -72
- data/assets/stylesheets/_chameleon.sass +2 -7
- data/assets/stylesheets/_config.sass +1 -1
- data/assets/stylesheets/_core.sass +3 -0
- data/assets/stylesheets/_defaults.sass +0 -1
- data/assets/stylesheets/_helpers.sass +1 -1
- data/assets/stylesheets/_library.sass +3 -0
- data/assets/stylesheets/_mixins.sass +2 -1
- data/assets/stylesheets/config/_sizing.scss +9 -0
- data/assets/stylesheets/helpers/_box.sass +73 -0
- data/assets/stylesheets/helpers/_position.sass +24 -0
- data/assets/stylesheets/helpers/_visibility.sass +2 -17
- data/assets/stylesheets/mixins/_responsive.sass +2 -2
- data/assets/stylesheets/mixins/_utility.sass +6 -0
- data/assets/stylesheets/objects/_containers.sass +4 -48
- data/assets/stylesheets/objects/_grid.sass +27 -31
- data/lib/chameleon-sass.rb +1 -1
- metadata +5 -2
- data/assets/stylesheets/config/_units.sass +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7365ad7febbe90e97219559e6e9d1c1ceead9f72
|
4
|
+
data.tar.gz: 788b22068a222ee198929c5e9b0c216110f54c0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33b84678c8f5730eac1148e6ffe3936c68a33d791be8f69074e37d37da712ee6b7210e4883a4d0c97765e62a6391d6aa698d7f79d425a53e04a7afa56f604f17
|
7
|
+
data.tar.gz: 00daff8a9dae07e8b621bc6e01941c6aea5fe313c38aa55ac5b186111a24b9d2ad73990a8a4350b4af9b30a1ecc2e1e3bde5e587ae96a3dc3d6fb44995b2d9af
|
data/README.md
CHANGED
@@ -1,87 +1,62 @@
|
|
1
|
-
Chameleon
|
2
|
-
=========
|
1
|
+
# Chameleon
|
3
2
|
|
3
|
+
Chameleon is a Sass layout framework for responsive web sites and applications.
|
4
4
|
|
5
|
-
|
5
|
+
At the heart of Chameleon is the ability to "turn on" classes at different screen sizes:
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
`gem 'chameleon-sass'`
|
12
|
-
|
13
|
-
Add to your main Sass stylesheet:
|
14
|
-
|
15
|
-
`@import "chameleon";`
|
16
|
-
|
17
|
-
|
18
|
-
### Installing in a Compass project
|
19
|
-
|
20
|
-
From the command line:
|
21
|
-
|
22
|
-
`gem install chameleon-sass`
|
23
|
-
|
24
|
-
Add to the top of your Compass config file (usually config.rb):
|
25
|
-
|
26
|
-
`require 'chameleon-sass'`
|
27
|
-
|
28
|
-
Add to your main Sass stylesheet:
|
29
|
-
|
30
|
-
`@import "chameleon"`
|
31
|
-
|
32
|
-
|
33
|
-
### Installing in a Bower project
|
34
|
-
|
35
|
-
From the command line:
|
36
|
-
|
37
|
-
`bower install chameleon-sass`
|
38
|
-
|
39
|
-
If you are using Compass you can add the import path to your Compass config file (usually config.rb):
|
40
|
-
|
41
|
-
`add_import_path "bower_components/chameleon-sass/assets/stylesheets/"`
|
42
|
-
|
43
|
-
Otherwise, you will need to manually add the above path to your @import.
|
44
|
-
|
45
|
-
Add to your main Sass stylesheet:
|
46
|
-
|
47
|
-
`@import "chameleon";`
|
48
|
-
|
49
|
-
|
50
|
-
### Generating a responsive grid
|
7
|
+
```html
|
8
|
+
<div class="padded padded-small-on-mobile"></div>
|
9
|
+
```
|
51
10
|
|
52
|
-
|
11
|
+
Out of the box Chameleon adds 0Kb to your project. Generate only the classes that you need for your project.
|
53
12
|
|
54
|
-
|
13
|
+
```scss
|
14
|
+
@include classes('padded', $on: 'base');
|
15
|
+
@include classes('padded-right', $on: 'base mobile');
|
16
|
+
```
|
55
17
|
|
56
18
|
```
|
57
|
-
|
19
|
+
.padded {
|
20
|
+
padding: 20px;
|
21
|
+
}
|
22
|
+
|
23
|
+
.padded-right {
|
24
|
+
padding-right: 20px;
|
25
|
+
}
|
26
|
+
|
27
|
+
@media screen and (max-width: 479px) {
|
28
|
+
.padded-right-on-mobile {
|
29
|
+
padding-right: 20px;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
```
|
58
33
|
|
59
|
-
|
60
|
-
@include grid-defaults();
|
34
|
+
Chameleon selectors be used anywhere in your stylesheet - even if they weren't generated into classes.
|
61
35
|
|
62
|
-
|
63
|
-
|
36
|
+
```scss
|
37
|
+
.myModule {
|
38
|
+
@extend %padded;
|
39
|
+
@extend %padded-small-on-mobile;
|
40
|
+
@extend %padded-on-tablet;
|
41
|
+
border: 3px dashed red;
|
42
|
+
}
|
43
|
+
```
|
64
44
|
|
65
|
-
|
66
|
-
@include classes("col-1-3", $on: "base");
|
67
|
-
@include classes("col-1-4", $on: "base");
|
45
|
+
You can also create selectors of your own using Chameleon's core mixins.
|
68
46
|
|
69
|
-
|
70
|
-
@include
|
47
|
+
```scss
|
48
|
+
@include placeholder('myHelper') {
|
49
|
+
color: red;
|
50
|
+
}
|
51
|
+
@include classes('myHelper', $on: 'base mobile tablet-up');
|
71
52
|
```
|
72
|
-
Here we use the default breakpoint expressions defined by Chameleon to generate classes that work for different viewport sizes.
|
73
53
|
|
74
|
-
|
54
|
+
Multi-element modifiers provide a powerful, concise and expressive way to compose modules.
|
75
55
|
|
76
|
-
```
|
77
|
-
<div class="row cols-spaced">
|
78
|
-
<div class="col-1-
|
79
|
-
|
80
|
-
|
81
|
-
<div class="col-1-2">
|
82
|
-
<div class="panel">Half</div>
|
83
|
-
</div>
|
56
|
+
```html
|
57
|
+
<div class="row cols-spaced cols-to-rows-on-mobile">
|
58
|
+
<div class="col-1-3"></div>
|
59
|
+
<div class="col-1-3"></div>
|
60
|
+
<div class="col-1-3"></div>
|
84
61
|
</div>
|
85
|
-
```
|
86
|
-
|
87
|
-
Congrats! You just generated a super easy to use, easily customisable, responsive grid system.
|
62
|
+
```
|
@@ -1 +1,2 @@
|
|
1
|
-
@import "mixins/responsive"
|
1
|
+
@import "mixins/responsive"
|
2
|
+
@import "mixins/utility"
|
@@ -1,3 +1,76 @@
|
|
1
|
+
$box-map: ('spaced': 'margin', 'padded': 'padding')
|
2
|
+
$position-list: ('top' 'left' 'bottom' 'right')
|
3
|
+
|
4
|
+
// Display
|
5
|
+
+placeholders("block")
|
6
|
+
display: block
|
7
|
+
|
8
|
+
+placeholders("inline-block")
|
9
|
+
display: inline-block
|
10
|
+
|
11
|
+
|
12
|
+
// Size
|
1
13
|
+placeholders("widest")
|
2
14
|
display: block
|
3
15
|
width: 100%
|
16
|
+
max-width: 100%
|
17
|
+
|
18
|
+
+placeholders("tallest")
|
19
|
+
display: block
|
20
|
+
height: 100%
|
21
|
+
max-height: 100%
|
22
|
+
|
23
|
+
|
24
|
+
// Padding / Margin / Spacing
|
25
|
+
=rows($prop, $size)
|
26
|
+
#{$prop}-top: $size
|
27
|
+
#{$prop}-bottom: $size
|
28
|
+
|
29
|
+
=cols($prop, $size)
|
30
|
+
#{$prop}-left: $size
|
31
|
+
#{$prop}-right: $size
|
32
|
+
|
33
|
+
@each $box-label, $box-property in $box-map
|
34
|
+
|
35
|
+
+placeholders('#{$box-label}')
|
36
|
+
#{$box-property}: map-get($sizing-map, 'default')
|
37
|
+
|
38
|
+
+placeholders('#{$box-label}-rows')
|
39
|
+
+rows($box-property, map-get($sizing-map, 'default'))
|
40
|
+
|
41
|
+
+placeholders('#{$box-label}-cols')
|
42
|
+
+cols($box-property, map-get($sizing-map, 'default'))
|
43
|
+
|
44
|
+
@each $position in $position-list
|
45
|
+
+placeholders('#{$box-label}-#{$position}')
|
46
|
+
#{$box-property}-#{$position}: map-get($sizing-map, 'default')
|
47
|
+
|
48
|
+
@each $size-name, $size in $sizing-map
|
49
|
+
+placeholders('#{$box-label}-#{$size-name}')
|
50
|
+
#{$box-property}: $size
|
51
|
+
|
52
|
+
+placeholders('#{$box-label}-rows-#{$size-name}')
|
53
|
+
+rows($box-property, $size)
|
54
|
+
|
55
|
+
+placeholders('#{$box-label}-cols-#{$size-name}')
|
56
|
+
+cols($box-property, $size)
|
57
|
+
|
58
|
+
@each $position in $position-list
|
59
|
+
+placeholders('#{$box-label}-#{$position}-#{$size-name}')
|
60
|
+
#{$box-property}-#{$position}: #{$size}
|
61
|
+
|
62
|
+
|
63
|
+
=inline-blocks-spaced-defaults
|
64
|
+
[class*="inline-blocks-spaced"] > *
|
65
|
+
letter-spacing: normal
|
66
|
+
|
67
|
+
@each $size-name, $size in $sizing-map
|
68
|
+
+placeholders('inline-blocks-spaced-#{$size}')
|
69
|
+
letter-spacing: $size
|
70
|
+
+write-once($ref: 'IBSD')
|
71
|
+
+inline-blocks-spaced-defaults
|
72
|
+
|
73
|
+
+placeholders('inline-blocks-spaced-#{$size}')
|
74
|
+
letter-spacing: $size
|
75
|
+
+write-once($ref: 'IBSD')
|
76
|
+
+inline-blocks-spaced-defaults
|
@@ -1,9 +1,33 @@
|
|
1
|
+
+placeholders("aligned-left")
|
2
|
+
text-align: left
|
3
|
+
|
1
4
|
+placeholders("aligned-right")
|
2
5
|
text-align: right
|
3
6
|
|
4
7
|
+placeholders("aligned-center")
|
5
8
|
text-align: center
|
6
9
|
|
10
|
+
|
11
|
+
+placeholders("positioned-absolute")
|
12
|
+
position: absolute
|
13
|
+
|
14
|
+
+placeholders("positioned-relative")
|
15
|
+
position: relative
|
16
|
+
|
17
|
+
+placeholders("positioned-fixed")
|
18
|
+
position: fixed
|
19
|
+
|
20
|
+
+placeholders("positioned-static")
|
21
|
+
position: static
|
22
|
+
|
23
|
+
|
24
|
+
+placeholders("floated-left")
|
25
|
+
float: left
|
26
|
+
|
27
|
+
+placeholders("floated-right")
|
28
|
+
float: right
|
29
|
+
|
30
|
+
|
7
31
|
+placeholders("expanded")
|
8
32
|
&:before,
|
9
33
|
&:after
|
@@ -1,13 +1,11 @@
|
|
1
|
-
//
|
2
|
-
|
3
|
-
// Hide from both screenreaders and browsers: h5bp.com/u
|
1
|
+
// Hide from both screenreaders and browsers
|
4
2
|
|
5
3
|
+placeholders("hidden")
|
6
4
|
display: none !important
|
7
5
|
visibility: hidden
|
8
6
|
|
9
7
|
|
10
|
-
// Hide only visually, but have it available for screenreaders
|
8
|
+
// Hide only visually, but have it available for screenreaders
|
11
9
|
|
12
10
|
+placeholders("concealed")
|
13
11
|
border: 0 !important
|
@@ -20,19 +18,6 @@
|
|
20
18
|
width: 1px !important
|
21
19
|
|
22
20
|
|
23
|
-
// Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p
|
24
|
-
|
25
|
-
+placeholders("concealed-focusable")
|
26
|
-
&:active,
|
27
|
-
&:focus
|
28
|
-
clip: auto
|
29
|
-
height: auto
|
30
|
-
margin: 0
|
31
|
-
overflow: visible
|
32
|
-
position: static
|
33
|
-
width: auto
|
34
|
-
|
35
|
-
|
36
21
|
// Hide visually and from screenreaders, but maintain layout
|
37
22
|
|
38
23
|
+placeholders("camouflaged")
|
@@ -94,8 +94,8 @@ $devices: (null)
|
|
94
94
|
// Genenerate a list of classes for different breakpoints
|
95
95
|
// Usage: +classes(big-thing, mobile tablet desktop-up)
|
96
96
|
|
97
|
-
=classes($name, $on:
|
98
|
-
$devices: if($on, $
|
97
|
+
=classes($name, $on: "base")
|
98
|
+
$devices: if($on == "all", $devices, $on)
|
99
99
|
@each $device in $devices
|
100
100
|
$postfix: if($device == "base", "", -on-#{$device})
|
101
101
|
+on($device)
|
@@ -1,50 +1,6 @@
|
|
1
|
-
$width-
|
2
|
-
|
3
|
-
$width-container-small: rem(500)
|
4
|
-
$width-container-tiny: rem(250)
|
5
|
-
|
6
|
-
=container($width-container)
|
7
|
-
|
8
|
-
$larger-than-fablet: if($width-container > rem($device-width-tablet - 1), true, false)
|
9
|
-
|
10
|
-
max-width: $width-container
|
1
|
+
=container($max-width, $min-margin)
|
2
|
+
max-width: $max-width
|
11
3
|
margin: 0 auto
|
12
4
|
|
13
|
-
|
14
|
-
|
15
|
-
margin: 0 $unit-big
|
16
|
-
|
17
|
-
+on("fablet-down")
|
18
|
-
margin: 0 $unit
|
19
|
-
|
20
|
-
@else
|
21
|
-
+mq($to: px($width-container + $unit * 2))
|
22
|
-
margin: 0 $unit
|
23
|
-
|
24
|
-
%container
|
25
|
-
+container($width-container)
|
26
|
-
|
27
|
-
%container-medium
|
28
|
-
+container($width-container-medium)
|
29
|
-
|
30
|
-
%container-small
|
31
|
-
+container($width-container-small)
|
32
|
-
|
33
|
-
%container-tiny
|
34
|
-
+container($width-container-tiny)
|
35
|
-
|
36
|
-
|
37
|
-
// Complex col/container layouts
|
38
|
-
%col-left-edge-to-1-3-container
|
39
|
-
@extend %col
|
40
|
-
width: calc((100vw - #{$width-container})/2 + (#{$width-container} * 1/3))
|
41
|
-
|
42
|
-
@media all and (max-width: $width-container)
|
43
|
-
width: calc(100vw * 1/3)
|
44
|
-
|
45
|
-
%col-to-2-3-container
|
46
|
-
@extend %col
|
47
|
-
width: $width-container * 2/3
|
48
|
-
|
49
|
-
@media all and (max-width: $width-container)
|
50
|
-
width: 66.666666%
|
5
|
+
+mq($to: $max-width + $min-margin * 2)
|
6
|
+
margin: 0 $min-margin
|
@@ -1,16 +1,13 @@
|
|
1
|
-
=grid-defaults
|
1
|
+
=grid-defaults($unmin: false, $spacing: -0.3em)
|
2
2
|
.row
|
3
3
|
@extend %expanded
|
4
|
-
letter-spacing: -0.25em
|
5
4
|
|
6
|
-
|
7
|
-
letter-spacing:
|
5
|
+
@if $unmin == true
|
6
|
+
letter-spacing: $spacing
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
.row.no-cols
|
13
|
-
letter-spacing: normal
|
8
|
+
& > *,
|
9
|
+
&.no-cols
|
10
|
+
letter-spacing: normal
|
14
11
|
|
15
12
|
[class^="col-"],
|
16
13
|
[class*=" col-"]
|
@@ -22,7 +19,6 @@
|
|
22
19
|
display: inline-block
|
23
20
|
min-height: 1px
|
24
21
|
vertical-align: top
|
25
|
-
letter-spacing: normal
|
26
22
|
word-spacing: normal
|
27
23
|
|
28
24
|
+placeholders("col-1-2")
|
@@ -107,16 +103,20 @@
|
|
107
103
|
padding-left: $gutter
|
108
104
|
|
109
105
|
+placeholders("cols-spaced-small")
|
110
|
-
+cols-spaced($
|
106
|
+
+cols-spaced(map-get($sizing-map, 'small'))
|
111
107
|
|
112
108
|
+placeholders("cols-spaced")
|
113
|
-
+cols-spaced($
|
109
|
+
+cols-spaced(map-get($sizing-map, 'default'))
|
114
110
|
|
115
111
|
+placeholders("cols-spaced-big")
|
116
|
-
+cols-spaced($
|
112
|
+
+cols-spaced(map-get($sizing-map, 'big'))
|
117
113
|
|
118
114
|
+placeholders("cols-spaced-huge")
|
119
|
-
+cols-spaced($
|
115
|
+
+cols-spaced(map-get($sizing-map, 'huge'))
|
116
|
+
|
117
|
+
@each $size-name, $size in $sizing-map
|
118
|
+
+placeholders("cols-spaced-#{$size-name}")
|
119
|
+
+cols-spaced($size)
|
120
120
|
|
121
121
|
|
122
122
|
// Row spacing - add baseline gutter
|
@@ -126,25 +126,21 @@
|
|
126
126
|
padding-bottom: $_gutter
|
127
127
|
|
128
128
|
// Space cols that have been switched to rows too
|
129
|
-
&[class*="cols-to-rows"]
|
130
|
-
margin-bottom:
|
129
|
+
&[class*="cols-to-rows"] > *
|
130
|
+
margin-bottom: $_gutter
|
131
131
|
|
132
|
-
|
133
|
-
|
132
|
+
// Suck up margin from the last visible child
|
133
|
+
// Use negative margin in case the last child isn't visible
|
134
|
+
// Use :after in case someone else slaps a margin class on the element
|
135
|
+
&:after
|
136
|
+
content: ''
|
137
|
+
display: table
|
138
|
+
margin-bottom: -$_gutter
|
134
139
|
|
135
|
-
+placeholders("rows-spaced-small")
|
136
|
-
+rows-spaced($unit-small)
|
137
140
|
|
138
141
|
+placeholders("rows-spaced")
|
139
|
-
+rows-spaced($
|
140
|
-
|
141
|
-
+placeholders("rows-spaced-big")
|
142
|
-
+rows-spaced($unit-big)
|
143
|
-
|
144
|
-
+placeholders("rows-spaced-huge")
|
145
|
-
+rows-spaced($unit-huge)
|
142
|
+
+rows-spaced(map-get($sizing-map, 'default'))
|
146
143
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
padding-bottom: 0
|
144
|
+
@each $size-name, $size in $sizing-map
|
145
|
+
+placeholders("rows-spaced-#{$size-name}")
|
146
|
+
+rows-spaced($size)
|
data/lib/chameleon-sass.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chameleon-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Grant
|
@@ -19,20 +19,23 @@ files:
|
|
19
19
|
- README.md
|
20
20
|
- assets/stylesheets/_chameleon.sass
|
21
21
|
- assets/stylesheets/_config.sass
|
22
|
+
- assets/stylesheets/_core.sass
|
22
23
|
- assets/stylesheets/_defaults.sass
|
23
24
|
- assets/stylesheets/_functions.sass
|
24
25
|
- assets/stylesheets/_helpers.sass
|
26
|
+
- assets/stylesheets/_library.sass
|
25
27
|
- assets/stylesheets/_mixins.sass
|
26
28
|
- assets/stylesheets/_objects.sass
|
27
29
|
- assets/stylesheets/config/_base-sizing.sass
|
28
30
|
- assets/stylesheets/config/_breakpoints.scss
|
29
|
-
- assets/stylesheets/config/
|
31
|
+
- assets/stylesheets/config/_sizing.scss
|
30
32
|
- assets/stylesheets/functions/_maps.sass
|
31
33
|
- assets/stylesheets/functions/_units.scss
|
32
34
|
- assets/stylesheets/helpers/_box.sass
|
33
35
|
- assets/stylesheets/helpers/_position.sass
|
34
36
|
- assets/stylesheets/helpers/_visibility.sass
|
35
37
|
- assets/stylesheets/mixins/_responsive.sass
|
38
|
+
- assets/stylesheets/mixins/_utility.sass
|
36
39
|
- assets/stylesheets/objects/_containers.sass
|
37
40
|
- assets/stylesheets/objects/_grid.sass
|
38
41
|
- lib/chameleon-sass.rb
|