piecss 0.2.0.0 → 0.3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/piecss.rb +16 -5
- data/sass/piecss/_settings.scss +6 -3
- data/sass/piecss/_utilities.scss +3 -0
- data/sass/piecss/behavior/_anchor.scss +1 -1
- data/sass/piecss/settings/_base.scss +5 -25
- data/sass/piecss/settings/_breakpoint.scss +112 -18
- data/sass/piecss/settings/_button.scss +2 -2
- data/sass/piecss/settings/_colour.scss +152 -0
- data/sass/piecss/settings/_constants.scss +0 -143
- data/sass/piecss/settings/_font.scss +0 -21
- data/sass/piecss/settings/_form.scss +7 -9
- data/sass/piecss/settings/{_grid.scss → _layout.scss} +43 -44
- data/sass/piecss/settings/_list.scss +1 -1
- data/sass/piecss/settings/_miscellaneous.scss +5 -0
- data/sass/piecss/settings/_rhythm.scss +0 -0
- data/sass/piecss/settings/_typography.scss +13 -0
- data/sass/piecss/settings/fonts/_example.scss +36 -36
- data/sass/piecss/settings/fonts/_monospace.scss +33 -33
- data/sass/piecss/settings/fonts/_sans-serif.scss +33 -33
- data/sass/piecss/settings/fonts/_serif.scss +33 -33
- data/sass/piecss/settings/fonts/_verdana.scss +34 -34
- data/sass/piecss/utilities/_breakpoint.scss +5 -5
- data/sass/piecss/utilities/_cache.scss +8 -4
- data/sass/piecss/utilities/_colour.scss +37 -0
- data/sass/piecss/utilities/_element.scss +85 -88
- data/sass/piecss/utilities/_image.scss +20 -22
- data/sass/piecss/utilities/_layout.scss +382 -213
- data/sass/piecss/utilities/_list.scss +2 -0
- data/sass/piecss/utilities/_miscellaneous.scss +161 -99
- data/sass/piecss/utilities/_rhythm.scss +27 -59
- data/sass/piecss/utilities/_side.scss +155 -154
- data/sass/piecss/utilities/_string.scss +68 -0
- data/sass/piecss/utilities/_svg.scss +47 -0
- data/sass/piecss/utilities/_typography.scss +96 -107
- data/sass/piecss/utilities/_unit.scss +85 -50
- data/templates/project/_sets/_button.scss +1 -1
- data/templates/project/_sets/_form.scss +1 -1
- data/templates/project/_sets.scss +1 -1
- data/templates/project/_settings.scss +1 -1
- metadata +13 -40
- data/sass/piecss/settings/fonts/_asap.scss +0 -44
- data/sass/piecss/settings/fonts/_bree-serif.scss +0 -23
- data/sass/piecss/settings/fonts/_lato.scss +0 -32
- data/sass/piecss/settings/fonts/_pt-sans.scss +0 -40
- data/sass/piecss/settings/fonts/_raleway.scss +0 -31
- data/sass/piecss/settings/fonts/_righteous.scss +0 -23
- data/sass/piecss/settings/fonts/_roboto-slab.scss +0 -37
- data/sass/piecss/settings/fonts/_roboto.scss +0 -35
- data/sass/piecss/settings/fonts/_sofia-pro.scss +0 -40
- data/sass/piecss/settings/fonts/_varela-round.scss +0 -24
- data/sass/piecss/settings/fonts/icon-fonts/_fontawesome.scss +0 -33
- data/sass/piecss/settings/fonts/icon-fonts/_foundation-accessability.scss +0 -75
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_bootstrap.scss +0 -84
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_core.scss +0 -129
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_extras.scss +0 -93
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_icons.scss +0 -381
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_mixins.scss +0 -48
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_path.scss +0 -14
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_variables.scss +0 -734
- data/sass/piecss/settings/fonts/icon-fonts/foundation-accessability/_settings.scss +0 -28
@@ -54,21 +54,25 @@ $smart-cache: ();
|
|
54
54
|
|
55
55
|
// Looping through all properties/values from map
|
56
56
|
@each $property, $value in $declarations {
|
57
|
+
|
57
58
|
// Get the stored values for the current property
|
58
59
|
$stored-values: map-get($smart-cache, $property);
|
59
|
-
|
60
|
+
|
60
61
|
// If the value doesn't exist in stored values
|
61
62
|
@if not index($stored-values, $value) {
|
63
|
+
|
62
64
|
// Add it
|
63
65
|
$smart-cache: map-merge($smart-cache, ($property: append($stored-values or (), $value))) !global;
|
66
|
+
|
64
67
|
// And create a placeholder at root level
|
65
68
|
@at-root %#{$property}-#{length(map-get($smart-cache, $property))} {
|
66
69
|
#{$property}: $value;
|
67
70
|
}
|
68
71
|
}
|
69
|
-
|
72
|
+
|
70
73
|
// Extend the placeholder
|
71
|
-
|
74
|
+
// scss-lint:disable PlaceholderInExtend
|
75
|
+
@extend "%#{$property}-#{index(map-get($smart-cache, $property), $value)}";
|
76
|
+
// scss-lint:enable PlaceholderInExtend
|
72
77
|
}
|
73
|
-
|
74
78
|
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
|
2
|
+
|
3
|
+
|
4
|
+
// Content:
|
5
|
+
// 1. Functions
|
6
|
+
// shade
|
7
|
+
|
8
|
+
|
9
|
+
// 1. Functions
|
10
|
+
|
11
|
+
|
12
|
+
///
|
13
|
+
/// Mixin to force consistent shades in a project.
|
14
|
+
/// Set acceptable shades in the colour settings.
|
15
|
+
/// If a shade is not acceptable, the function throws an errror
|
16
|
+
///
|
17
|
+
/// @since 0.1
|
18
|
+
///
|
19
|
+
/// @throws Only these values are excepted: #{$shades}, assuming 100%
|
20
|
+
///
|
21
|
+
/// @param {Number} $shade - A percentage
|
22
|
+
/// @param {String} $color - A colour
|
23
|
+
/// @param {String} $mix-color ($color-highlight) - A colour to mix with
|
24
|
+
///
|
25
|
+
/// @return {Bool}
|
26
|
+
///
|
27
|
+
|
28
|
+
@function shade($shade: 100%, $color: $color-body, $mix-color: $color-highlight) {
|
29
|
+
|
30
|
+
// Only these shase values are valid
|
31
|
+
@if not(unit($shade) == "%") or not(index($shades, $shade)) {
|
32
|
+
@error "Only these values are excepted: #{implode($shades)}, assuming 100%";
|
33
|
+
@return $color;
|
34
|
+
}
|
35
|
+
|
36
|
+
@return mix($mix-color, $color, $shade);
|
37
|
+
}
|
@@ -26,13 +26,12 @@
|
|
26
26
|
/// @return {Map}
|
27
27
|
///
|
28
28
|
|
29
|
-
@function add-element($elements, $selector, $properties: ())
|
30
|
-
|
31
|
-
$
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
@return $elements;
|
29
|
+
@function add-element($elements, $selector, $properties: ()) {
|
30
|
+
$_: (
|
31
|
+
#{$selector}: $properties
|
32
|
+
);
|
33
|
+
$elements: map-merge($elements, $_);
|
34
|
+
@return $elements;
|
36
35
|
}
|
37
36
|
|
38
37
|
///
|
@@ -48,51 +47,50 @@
|
|
48
47
|
/// @return {Map}
|
49
48
|
///
|
50
49
|
|
51
|
-
@function add-properties($properties, $selector, $elements)
|
52
|
-
{
|
50
|
+
@function add-properties($properties, $selector, $elements) {
|
53
51
|
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
@if not map-has-key($elements, $selector) {
|
53
|
+
$elements: add-element($elements, $selector);
|
54
|
+
}
|
57
55
|
|
58
|
-
|
59
|
-
|
60
|
-
|
56
|
+
// Merge the nested property-map first
|
57
|
+
$element: map-get($elements, $selector);
|
58
|
+
$element: map-merge($element, $properties);
|
61
59
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
60
|
+
// Merge the property-map with the element collection
|
61
|
+
$_: (
|
62
|
+
#{$selector}: $element
|
63
|
+
);
|
64
|
+
$elements: map-merge($elements, $_);
|
67
65
|
|
68
|
-
|
66
|
+
@return $elements;
|
69
67
|
}
|
70
68
|
|
71
69
|
///
|
72
70
|
/// @alias add-properties
|
73
71
|
///
|
74
|
-
@function add-props($properties, $selector, $elements)
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
@function add-props($properties, $selector, $elements) {
|
73
|
+
$elements: add-properties($properties, $selector, $elements);
|
74
|
+
|
75
|
+
@return $elements;
|
78
76
|
}
|
79
77
|
|
80
78
|
///
|
81
79
|
/// @alias add-properties
|
82
80
|
///
|
83
|
-
@function merge-properties($properties, $selector, $elements)
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
@function merge-properties($properties, $selector, $elements) {
|
82
|
+
$elements: add-properties($properties, $selector, $elements);
|
83
|
+
|
84
|
+
@return $elements;
|
87
85
|
}
|
88
86
|
|
89
87
|
///
|
90
88
|
/// @alias add-properties
|
91
89
|
///
|
92
|
-
@function merge-props($properties, $selector, $elements)
|
93
|
-
|
94
|
-
|
95
|
-
|
90
|
+
@function merge-props($properties, $selector, $elements) {
|
91
|
+
$elements: add-properties($properties, $selector, $elements);
|
92
|
+
|
93
|
+
@return $elements;
|
96
94
|
}
|
97
95
|
|
98
96
|
|
@@ -108,57 +106,56 @@
|
|
108
106
|
/// @param {Map} $element - Map of CSS properties
|
109
107
|
///
|
110
108
|
|
111
|
-
@mixin properties($element)
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
109
|
+
@mixin properties($element) {
|
110
|
+
// Lift out properties that have their own mixins
|
111
|
+
@if map-has-key($element, margin) {
|
112
|
+
$value: map-get($element, margin);
|
113
|
+
$element: map-remove($element, margin);
|
114
|
+
@include margin($value);
|
115
|
+
}
|
116
|
+
@if map-has-key($element, padding) {
|
117
|
+
$value: map-get($element, padding);
|
118
|
+
$element: map-remove($element, padding);
|
119
|
+
@include padding($value);
|
120
|
+
}
|
121
|
+
/* Using Autoprefix now */
|
122
|
+
// @if map-has-key($element, border-radius) {
|
123
|
+
// $value: map-get($element, border-radius);
|
124
|
+
// $element: map-remove($element, border-radius);
|
125
|
+
// @include border-radius($value);
|
126
|
+
// }
|
127
|
+
// @if map-has-key($element, box-shadow) {
|
128
|
+
// $value: map-get($element, box-shadow);
|
129
|
+
// $element: map-remove($element, box-shadow);
|
130
|
+
// @include box-shadow($value);
|
131
|
+
// }
|
132
|
+
@if map-has-key($element, font-type) {
|
133
|
+
$value: ();
|
134
|
+
$value: append($value, map-get($element, font-type));
|
135
|
+
@if map-has-key($element, font-size) {
|
136
|
+
$value: append(($value), map-get($element, font-size));
|
118
137
|
}
|
119
|
-
@if map-has-key($element,
|
120
|
-
|
121
|
-
$element: map-remove($element, padding);
|
122
|
-
@include padding($value);
|
123
|
-
}
|
124
|
-
/* Using Autoprefix now */
|
125
|
-
// @if map-has-key($element, border-radius) {
|
126
|
-
// $value: map-get($element, border-radius);
|
127
|
-
// $element: map-remove($element, border-radius);
|
128
|
-
// @include border-radius($value);
|
129
|
-
// }
|
130
|
-
// @if map-has-key($element, box-shadow) {
|
131
|
-
// $value: map-get($element, box-shadow);
|
132
|
-
// $element: map-remove($element, box-shadow);
|
133
|
-
// @include box-shadow($value);
|
134
|
-
// }
|
135
|
-
@if map-has-key($element, font-type) {
|
136
|
-
$value: ();
|
137
|
-
$value: append( $value, map-get($element, font-type));
|
138
|
-
@if map-has-key($element, font-size) {
|
139
|
-
$value: append( ($value), map-get($element, font-size));
|
140
|
-
}
|
141
|
-
@if map-has-key($element, line-height) {
|
142
|
-
$value: append($value, map-get($element, line-height));
|
143
|
-
}
|
144
|
-
$element: map-remove($element, font-family);
|
145
|
-
$element: map-remove($element, font-size);
|
146
|
-
$element: map-remove($element, line-height);
|
147
|
-
$element: map-remove($element, font);
|
148
|
-
|
149
|
-
@include font(nth($value,1), nth($value,2), nth($value,3));
|
150
|
-
}
|
151
|
-
@if map-has-key($element, font) {
|
152
|
-
$value: map-get($element, font);
|
153
|
-
$element: map-remove($element, font);
|
154
|
-
@include font(nth($value,1), nth($value,2), nth($value,3));
|
155
|
-
}
|
156
|
-
|
157
|
-
$properties: map-keys($element);
|
158
|
-
|
159
|
-
@each $property in $properties {
|
160
|
-
#{$property}: map-get($element, $property);
|
138
|
+
@if map-has-key($element, line-height) {
|
139
|
+
$value: append($value, map-get($element, line-height));
|
161
140
|
}
|
141
|
+
$element: map-remove($element, font-family);
|
142
|
+
$element: map-remove($element, font-size);
|
143
|
+
$element: map-remove($element, line-height);
|
144
|
+
$element: map-remove($element, font);
|
145
|
+
|
146
|
+
@include font(nth($value, 1), nth($value, 2), nth($value, 3));
|
147
|
+
}
|
148
|
+
@if map-has-key($element, font) {
|
149
|
+
$value: map-get($element, font);
|
150
|
+
$element: map-remove($element, font);
|
151
|
+
@include font(nth($value, 1), nth($value, 2), nth($value, 3));
|
152
|
+
}
|
153
|
+
|
154
|
+
$properties: map-keys($element);
|
155
|
+
|
156
|
+
@each $property in $properties {
|
157
|
+
#{$property}: map-get($element, $property);
|
158
|
+
}
|
162
159
|
}
|
163
160
|
|
164
161
|
|
@@ -172,12 +169,12 @@
|
|
172
169
|
///
|
173
170
|
|
174
171
|
@mixin elements($elements) {
|
175
|
-
|
172
|
+
$selectors: map-keys($elements);
|
176
173
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
}
|
174
|
+
@each $selector in $selectors {
|
175
|
+
#{$selector} {
|
176
|
+
$element: map-get($elements, $selector);
|
177
|
+
@include properties($element);
|
182
178
|
}
|
179
|
+
}
|
183
180
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
///
|
14
|
-
/// Calculates the proportions of an element based on its width and height
|
14
|
+
/// Calculates the proportions of an element based on its width and height
|
15
15
|
///
|
16
16
|
/// @since 0.1
|
17
17
|
///
|
@@ -19,15 +19,14 @@
|
|
19
19
|
///
|
20
20
|
/// @param {Map} $size - Map of width and height pairs (width: 100px, height: 100px)
|
21
21
|
///
|
22
|
-
/// @return {Number}
|
22
|
+
/// @return {Number}
|
23
23
|
///
|
24
24
|
|
25
|
-
@function proportion($size)
|
26
|
-
|
27
|
-
|
28
|
-
$height: map-get($size, height);
|
25
|
+
@function proportion($size) {
|
26
|
+
$width: map-get($size, width);
|
27
|
+
$height: map-get($size, height);
|
29
28
|
|
30
|
-
|
29
|
+
@return $width / $height;
|
31
30
|
}
|
32
31
|
|
33
32
|
///
|
@@ -37,22 +36,21 @@
|
|
37
36
|
///
|
38
37
|
/// @param {Map} $size - Map of width and height pairs (width: 100px, height: 100px)
|
39
38
|
///
|
40
|
-
/// @return {String}
|
39
|
+
/// @return {String}
|
41
40
|
///
|
42
41
|
|
43
|
-
@function orientation($size)
|
44
|
-
|
45
|
-
$proportion: proportion($size);
|
42
|
+
@function orientation($size) {
|
43
|
+
$proportion: proportion($size);
|
46
44
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
@if $proportion > 1 {
|
46
|
+
@return landscape;
|
47
|
+
}
|
48
|
+
|
49
|
+
@if $proportion < 1 {
|
50
|
+
@return portrait;
|
51
|
+
}
|
52
|
+
|
53
|
+
@if $proportion == 1 {
|
54
|
+
@return square;
|
55
|
+
}
|
58
56
|
}
|