chameleon-sass 0.0.3 → 0.0.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/assets/stylesheets/_chameleon.sass +6 -3
- data/assets/stylesheets/_config.sass +2 -0
- data/assets/stylesheets/_defaults.sass +1 -0
- data/assets/stylesheets/_functions.sass +3 -0
- data/assets/stylesheets/_helpers.sass +3 -0
- data/assets/stylesheets/_mixins.sass +1 -0
- data/assets/stylesheets/_objects.sass +3 -0
- data/assets/stylesheets/config/_base-sizing.sass +1 -0
- data/assets/stylesheets/config/_breakpoints.scss +41 -0
- data/assets/stylesheets/defaults/_units.sass +7 -0
- data/assets/stylesheets/functions/_lists.sass +0 -0
- data/assets/stylesheets/functions/_maps.sass +0 -0
- data/assets/stylesheets/functions/_units.scss +15 -0
- data/assets/stylesheets/helpers/_box.sass +3 -0
- data/assets/stylesheets/helpers/_position.sass +36 -0
- data/assets/stylesheets/helpers/_visibility.sass +39 -0
- data/assets/stylesheets/mixins/_responsive.sass +103 -0
- data/assets/stylesheets/objects/_containers.sass +50 -0
- data/assets/stylesheets/objects/_grid.sass +132 -0
- data/assets/stylesheets/objects/_list.sass +79 -0
- data/lib/chameleon-sass.rb +1 -1
- metadata +20 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68cef38e919656c36ccdba48d176740689f23b97
|
4
|
+
data.tar.gz: 8a0162d82424e011d103ccca5171d79e11796c76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45d8ebafef98fdd32ca8521a58cd713f11dfd2b9fa8d6072f6489cd5b17dc079ed1ec03596715de3eb1c22ead66436b59dcaeeaa7732eebbeb424451840bf464
|
7
|
+
data.tar.gz: 37765b8ff2eb972a8f73b8442defb5104a023b559f0aca3d7ff47084366c78dcfa73e7dfda17c2680ac775c31a05cce736733fcdbde2d24ade87d29aec560b3f
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "defaults/units"
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "mixins/responsive"
|
@@ -0,0 +1 @@
|
|
1
|
+
$font-size-base: 16px;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
// In versions 3.3 this can be udpated to a map and be much more maintainable
|
2
|
+
|
3
|
+
$breakpoints: (
|
4
|
+
"mobile" 0,
|
5
|
+
"fablet" 480px,
|
6
|
+
"tablet" 778px,
|
7
|
+
"desktop" 1040px,
|
8
|
+
"wide" 1200px
|
9
|
+
) !default;
|
10
|
+
|
11
|
+
// It's really hard to remove the units from a list fragment
|
12
|
+
// so rewrite into individual variables
|
13
|
+
// Again, with 3.3 maps this won't be required
|
14
|
+
|
15
|
+
$device-width-mobile: 0px !default;
|
16
|
+
$device-width-fablet: 480px !default;
|
17
|
+
$device-width-tablet: 778px !default;
|
18
|
+
$device-width-desktop: 1040px !default;
|
19
|
+
$device-width-wide: 1200px !default;
|
20
|
+
|
21
|
+
|
22
|
+
$device-breakpoints: (
|
23
|
+
'mobile' '(max-width: 479px)',
|
24
|
+
'mobile-and-fablet' '(max-width: 777px)',
|
25
|
+
'mobile-and-tablet' '(max-width: 1039px)',
|
26
|
+
|
27
|
+
'fablet' '(min-width: 480px) and (max-width: 777px)',
|
28
|
+
'fablet-and-tablet' '(min-width: 480px) and (max-width: 1039px)',
|
29
|
+
'fablet-up' '(min-width: 480px)',
|
30
|
+
'fablet-down' '(max-width: 777px)',
|
31
|
+
|
32
|
+
'tablet' '(min-width: 778px) and (max-width: 1039px)',
|
33
|
+
'tablet-and-desktop' '(min-width: 778px) and (max-width: 1199px)',
|
34
|
+
'tablet-up' '(min-width: 778px)',
|
35
|
+
'tablet-down' '(max-width: 1039px)',
|
36
|
+
|
37
|
+
'desktop' '(min-width: 1040px) and (max-width: 1199px)',
|
38
|
+
'desktop-up' '(min-width: 1040px)',
|
39
|
+
|
40
|
+
'wide-up' '(min-width: 1200px)'
|
41
|
+
) !default;
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
@function remove-unit($number){
|
2
|
+
@return $number / ($number * 0 + 1);
|
3
|
+
}
|
4
|
+
|
5
|
+
@function em($value) {
|
6
|
+
@return (remove-unit($value) / remove-unit($font-size-base)) * 1em;
|
7
|
+
}
|
8
|
+
|
9
|
+
@function rem($value) {
|
10
|
+
@return (remove-unit($value) / remove-unit($font-size-base)) * 1rem;
|
11
|
+
}
|
12
|
+
|
13
|
+
@function px($value) {
|
14
|
+
@return (remove-unit($value) * $font-size-base);
|
15
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
+placeholders("aligned-right")
|
2
|
+
text-align: right
|
3
|
+
|
4
|
+
+placeholders("aligned-center")
|
5
|
+
text-align: center
|
6
|
+
|
7
|
+
+placeholders("expanded")
|
8
|
+
&:before,
|
9
|
+
&:after
|
10
|
+
content: ""
|
11
|
+
display: table
|
12
|
+
|
13
|
+
&:after
|
14
|
+
clear: both
|
15
|
+
|
16
|
+
|
17
|
+
+placeholders("child-centered")
|
18
|
+
text-align: center
|
19
|
+
|
20
|
+
&::after
|
21
|
+
content: ''
|
22
|
+
display: inline-block
|
23
|
+
height: 100%
|
24
|
+
vertical-align: middle
|
25
|
+
margin-right: -0.25em
|
26
|
+
|
27
|
+
& > *
|
28
|
+
display: inline-block
|
29
|
+
vertical-align: middle
|
30
|
+
text-align: left
|
31
|
+
|
32
|
+
&.aligned-center
|
33
|
+
text-align: center
|
34
|
+
|
35
|
+
&.aligned-right
|
36
|
+
text-align: right
|
@@ -0,0 +1,39 @@
|
|
1
|
+
// H5BP visibility styles
|
2
|
+
|
3
|
+
// Hide from both screenreaders and browsers: h5bp.com/u
|
4
|
+
|
5
|
+
+placeholders("hidden")
|
6
|
+
display: none !important
|
7
|
+
visibility: hidden
|
8
|
+
|
9
|
+
|
10
|
+
// Hide only visually, but have it available for screenreaders: h5bp.com/v
|
11
|
+
|
12
|
+
+placeholders("concealed")
|
13
|
+
border: 0 !important
|
14
|
+
clip: rect(0 0 0 0) !important
|
15
|
+
height: 1px !important
|
16
|
+
margin: -1px !important
|
17
|
+
overflow: hidden !important
|
18
|
+
padding: 0 !important
|
19
|
+
position: absolute !important
|
20
|
+
width: 1px !important
|
21
|
+
|
22
|
+
|
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
|
+
// Hide visually and from screenreaders, but maintain layout
|
37
|
+
|
38
|
+
+placeholders("camouflaged")
|
39
|
+
visibility: hidden
|
@@ -0,0 +1,103 @@
|
|
1
|
+
=on($_device)
|
2
|
+
@each $breakpoint in $device-breakpoints
|
3
|
+
$device: nth($breakpoint, 1)
|
4
|
+
$expression: nth($breakpoint, 2)
|
5
|
+
@if $_device == $device and $expression
|
6
|
+
@media all and #{$expression}
|
7
|
+
@content
|
8
|
+
@if $_device == "base"
|
9
|
+
@content
|
10
|
+
|
11
|
+
|
12
|
+
=mq($from: false, $to: false)
|
13
|
+
|
14
|
+
$min-width: 0
|
15
|
+
$max-width: 0
|
16
|
+
$expression: "all"
|
17
|
+
|
18
|
+
@if $from
|
19
|
+
@if type-of($from) == number
|
20
|
+
$min-width: $from
|
21
|
+
@else
|
22
|
+
@each $breakpoint in $breakpoints
|
23
|
+
$name: nth($breakpoint, 1)
|
24
|
+
$width: nth($breakpoint, 2)
|
25
|
+
|
26
|
+
@if $from == $name and $width
|
27
|
+
$min-width: $width
|
28
|
+
|
29
|
+
@if $min-width
|
30
|
+
$min-expression: "(min-width: #{$min-width})"
|
31
|
+
|
32
|
+
@if $to
|
33
|
+
@if type-of($to) == number
|
34
|
+
$max-width: $to
|
35
|
+
@else
|
36
|
+
@each $breakpoint in $breakpoints
|
37
|
+
$name: nth($breakpoint, 1)
|
38
|
+
$width: nth($breakpoint, 2)
|
39
|
+
|
40
|
+
@if $to == $name and $width
|
41
|
+
$max-width: $width
|
42
|
+
|
43
|
+
@if $min-width != 0
|
44
|
+
$expression: "#{$expression} and (min-width: #{$min-width})"
|
45
|
+
|
46
|
+
@if $max-width != 0
|
47
|
+
$expression: "#{$expression} and (max-width: #{$max-width})"
|
48
|
+
|
49
|
+
@media #{$expression}
|
50
|
+
@content
|
51
|
+
|
52
|
+
|
53
|
+
// Helper variable: just the device names
|
54
|
+
$devices: (null)
|
55
|
+
|
56
|
+
@each $item in $device-breakpoints
|
57
|
+
$device: unquote(#{nth($item, 1)})
|
58
|
+
$devices: append($devices, $device, space)
|
59
|
+
|
60
|
+
|
61
|
+
=debug-breakpoints
|
62
|
+
@each $breakpoint in $breakpoints
|
63
|
+
$device: nth($breakpoint, 1)
|
64
|
+
$min-width: nth($breakpoint, 2)
|
65
|
+
|
66
|
+
+mq($from: $device)
|
67
|
+
body:before
|
68
|
+
content: '#{$device} (#{$min-width}+)'
|
69
|
+
position: fixed
|
70
|
+
left: 0
|
71
|
+
right: 0
|
72
|
+
bottom: 0
|
73
|
+
padding: 1rem 0
|
74
|
+
text-align: center
|
75
|
+
background: white
|
76
|
+
opacity: 0.65
|
77
|
+
z-index: 100
|
78
|
+
|
79
|
+
|
80
|
+
// It's not possible to extend into media queries so this mixin
|
81
|
+
// creates, for every breakpoint, a named version of the placeholder
|
82
|
+
|
83
|
+
=placeholders($name)
|
84
|
+
%#{$name}
|
85
|
+
@content
|
86
|
+
|
87
|
+
@each $breakpoint in $device-breakpoints
|
88
|
+
$device: nth($breakpoint, 1)
|
89
|
+
+on($device)
|
90
|
+
%#{$name}-on-#{$device}
|
91
|
+
@content
|
92
|
+
|
93
|
+
|
94
|
+
// Genenerate a list of classes for different breakpoints
|
95
|
+
// Usage: +classes(big-thing, mobile tablet desktop-up)
|
96
|
+
|
97
|
+
=classes($name, $on: false)
|
98
|
+
$devices: if($on, $on, $devices)
|
99
|
+
@each $device in $devices
|
100
|
+
$postfix: if($device == "base", "", -on-#{$device})
|
101
|
+
+on($device)
|
102
|
+
.#{$name}#{$postfix}
|
103
|
+
@extend %#{$name}#{$postfix}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
$width-container: rem(1000)
|
2
|
+
$width-container-medium: rem(700)
|
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
|
11
|
+
margin: 0 auto
|
12
|
+
|
13
|
+
@if $larger-than-fablet
|
14
|
+
+mq($to: px($width-container + $unit-big * 2))
|
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%
|
@@ -0,0 +1,132 @@
|
|
1
|
+
=grid-defaults
|
2
|
+
.row
|
3
|
+
@extend %expanded
|
4
|
+
letter-spacing: -0.25em
|
5
|
+
|
6
|
+
+on("fablet-down")
|
7
|
+
letter-spacing: -0.27em
|
8
|
+
|
9
|
+
> *
|
10
|
+
letter-spacing: normal
|
11
|
+
|
12
|
+
.row.no-cols
|
13
|
+
letter-spacing: normal
|
14
|
+
|
15
|
+
[class^="col-"],
|
16
|
+
[class*=" col-"]
|
17
|
+
@extend %col
|
18
|
+
@extend %expanded
|
19
|
+
|
20
|
+
|
21
|
+
+placeholders("col")
|
22
|
+
display: inline-block
|
23
|
+
min-height: 1px
|
24
|
+
vertical-align: top
|
25
|
+
letter-spacing: normal
|
26
|
+
word-spacing: normal
|
27
|
+
|
28
|
+
+placeholders("col-1-2")
|
29
|
+
width: 50%
|
30
|
+
|
31
|
+
+placeholders("col-1-3")
|
32
|
+
width: 33.333333%
|
33
|
+
|
34
|
+
+placeholders("col-2-3")
|
35
|
+
width: 66.666666%
|
36
|
+
|
37
|
+
+placeholders("col-1-4")
|
38
|
+
width: 25%
|
39
|
+
|
40
|
+
+placeholders("col-3-4")
|
41
|
+
width: 75%
|
42
|
+
|
43
|
+
|
44
|
+
// Switch cols to rows (stack 'em)
|
45
|
+
|
46
|
+
+placeholders("cols-to-rows")
|
47
|
+
&.row
|
48
|
+
display: block
|
49
|
+
margin-left: 0
|
50
|
+
|
51
|
+
& > *
|
52
|
+
display: block
|
53
|
+
width: 100% !important // override col width
|
54
|
+
padding: 0 !important // override col spacing
|
55
|
+
|
56
|
+
&:last-child
|
57
|
+
margin-bottom: 0
|
58
|
+
|
59
|
+
|
60
|
+
// Reverse column order
|
61
|
+
|
62
|
+
+placeholders("cols-reversed")
|
63
|
+
direction: rtl
|
64
|
+
|
65
|
+
> *
|
66
|
+
direction: ltr
|
67
|
+
text-align: left
|
68
|
+
|
69
|
+
|
70
|
+
// Equal height columns
|
71
|
+
// Can't be used with reversed
|
72
|
+
|
73
|
+
+placeholders("cols-equal-height")
|
74
|
+
display: table-row
|
75
|
+
|
76
|
+
> *
|
77
|
+
display: table-cell
|
78
|
+
|
79
|
+
> :first-child
|
80
|
+
padding-left: 0
|
81
|
+
|
82
|
+
|
83
|
+
// Column spacing - add gutter
|
84
|
+
|
85
|
+
=cols-spaced($gutter)
|
86
|
+
margin-left: -$gutter
|
87
|
+
|
88
|
+
& > *
|
89
|
+
padding-left: $gutter
|
90
|
+
|
91
|
+
+placeholders("cols-spaced-small")
|
92
|
+
+cols-spaced($unit-small)
|
93
|
+
|
94
|
+
+placeholders("cols-spaced")
|
95
|
+
+cols-spaced($unit)
|
96
|
+
|
97
|
+
+placeholders("cols-spaced-big")
|
98
|
+
+cols-spaced($unit-big)
|
99
|
+
|
100
|
+
+placeholders("cols-spaced-huge")
|
101
|
+
+cols-spaced($unit-huge)
|
102
|
+
|
103
|
+
|
104
|
+
// Row spacing - add baseline gutter
|
105
|
+
|
106
|
+
=rows-spaced($_gutter)
|
107
|
+
& > .row
|
108
|
+
padding-bottom: $_gutter
|
109
|
+
|
110
|
+
// Space cols that have been switched to rows too
|
111
|
+
&[class*="cols-to-rows"]
|
112
|
+
margin-bottom: -$_gutter // removes gutter below last row / cols
|
113
|
+
|
114
|
+
& > *
|
115
|
+
margin-bottom: $_gutter
|
116
|
+
|
117
|
+
+placeholders("rows-spaced-small")
|
118
|
+
+rows-spaced($unit-small)
|
119
|
+
|
120
|
+
+placeholders("rows-spaced")
|
121
|
+
+rows-spaced($unit)
|
122
|
+
|
123
|
+
+placeholders("rows-spaced-big")
|
124
|
+
+rows-spaced($unit-big)
|
125
|
+
|
126
|
+
+placeholders("rows-spaced-huge")
|
127
|
+
+rows-spaced($unit-huge)
|
128
|
+
|
129
|
+
=rows-spaced-defaults
|
130
|
+
// This can happily be applied to all rows
|
131
|
+
.row:last-child
|
132
|
+
padding-bottom: 0
|
@@ -0,0 +1,79 @@
|
|
1
|
+
+placeholders("list-bulletless")
|
2
|
+
margin: 0
|
3
|
+
padding: 0
|
4
|
+
|
5
|
+
li
|
6
|
+
list-style: none
|
7
|
+
|
8
|
+
// Also declare as mixin because +placeholders()
|
9
|
+
// cannot @extend %placeholders in multiple breakpoints
|
10
|
+
|
11
|
+
=prepend-slash
|
12
|
+
&:before
|
13
|
+
content: '/'
|
14
|
+
margin: 0 12px 0 8px
|
15
|
+
font-weight: normal
|
16
|
+
|
17
|
+
=append-slash
|
18
|
+
&:after
|
19
|
+
content: '/'
|
20
|
+
margin: 0 12px 0 8px
|
21
|
+
font-weight: normal
|
22
|
+
|
23
|
+
+placeholders("appended-slash")
|
24
|
+
+append-slash
|
25
|
+
|
26
|
+
+placeholders("prepended-slash")
|
27
|
+
+prepend-slash
|
28
|
+
|
29
|
+
|
30
|
+
+placeholders("list-inline")
|
31
|
+
margin: 0
|
32
|
+
padding: 0
|
33
|
+
|
34
|
+
li
|
35
|
+
display: inline-block
|
36
|
+
list-style: none
|
37
|
+
margin-right: $unit
|
38
|
+
vertical-align: top
|
39
|
+
|
40
|
+
&:last-child
|
41
|
+
margin-right: 0
|
42
|
+
|
43
|
+
|
44
|
+
+placeholders("list-inline--unspaced")
|
45
|
+
li
|
46
|
+
margin-right: 0
|
47
|
+
|
48
|
+
|
49
|
+
+placeholders("list-inline--pipes")
|
50
|
+
li
|
51
|
+
border-right: 1px solid $color-bg-gray-brown
|
52
|
+
padding-right: $unit-small
|
53
|
+
margin-right: $unit-small - rem(4) // inline space
|
54
|
+
|
55
|
+
&:last-child
|
56
|
+
padding-right: 0
|
57
|
+
border-right: none
|
58
|
+
|
59
|
+
|
60
|
+
+placeholders("list-inline--slashes")
|
61
|
+
li
|
62
|
+
margin: 0
|
63
|
+
|
64
|
+
li
|
65
|
+
+prepend-slash
|
66
|
+
|
67
|
+
li:first-child:before
|
68
|
+
content: ''
|
69
|
+
margin: 0
|
70
|
+
|
71
|
+
|
72
|
+
+placeholders("list--stacked")
|
73
|
+
margin: 0
|
74
|
+
padding: 0
|
75
|
+
|
76
|
+
li
|
77
|
+
list-style: none
|
78
|
+
padding: 1rem 0
|
79
|
+
border-bottom: 1px solid #ccc
|
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.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Grant
|
@@ -18,6 +18,25 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- README.md
|
20
20
|
- assets/stylesheets/_chameleon.sass
|
21
|
+
- assets/stylesheets/_config.sass
|
22
|
+
- assets/stylesheets/_defaults.sass
|
23
|
+
- assets/stylesheets/_functions.sass
|
24
|
+
- assets/stylesheets/_helpers.sass
|
25
|
+
- assets/stylesheets/_mixins.sass
|
26
|
+
- assets/stylesheets/_objects.sass
|
27
|
+
- assets/stylesheets/config/_base-sizing.sass
|
28
|
+
- assets/stylesheets/config/_breakpoints.scss
|
29
|
+
- assets/stylesheets/defaults/_units.sass
|
30
|
+
- assets/stylesheets/functions/_lists.sass
|
31
|
+
- assets/stylesheets/functions/_maps.sass
|
32
|
+
- assets/stylesheets/functions/_units.scss
|
33
|
+
- assets/stylesheets/helpers/_box.sass
|
34
|
+
- assets/stylesheets/helpers/_position.sass
|
35
|
+
- assets/stylesheets/helpers/_visibility.sass
|
36
|
+
- assets/stylesheets/mixins/_responsive.sass
|
37
|
+
- assets/stylesheets/objects/_containers.sass
|
38
|
+
- assets/stylesheets/objects/_grid.sass
|
39
|
+
- assets/stylesheets/objects/_list.sass
|
21
40
|
- lib/chameleon-sass.rb
|
22
41
|
homepage: https://github.com/djgrant/chameleon
|
23
42
|
licenses:
|