piecss 0.1.0.alpha.01
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 +7 -0
- data/README.md +7 -0
- data/lib/piecss.rb +6 -0
- data/sass/piecss/behavior.scss +11 -0
- data/sass/piecss/behavior/anchor.scss +30 -0
- data/sass/piecss/behavior/base.scss +4 -0
- data/sass/piecss/behavior/base/normalize.scss +458 -0
- data/sass/piecss/behavior/base/preset.scss +57 -0
- data/sass/piecss/behavior/form.scss +120 -0
- data/sass/piecss/behavior/grid.scss +4 -0
- data/sass/piecss/behavior/grid/layout.scss +170 -0
- data/sass/piecss/behavior/grid/rhythm.scss +54 -0
- data/sass/piecss/behavior/list.scss +189 -0
- data/sass/piecss/settings.scss +18 -0
- data/sass/piecss/settings/base.scss +177 -0
- data/sass/piecss/settings/breakpoint.scss +32 -0
- data/sass/piecss/settings/constants.scss +147 -0
- data/sass/piecss/settings/fonts.scss +31 -0
- data/sass/piecss/settings/fonts/_asap.scss +44 -0
- data/sass/piecss/settings/fonts/_bree-serif.scss +23 -0
- data/sass/piecss/settings/fonts/_example.scss +43 -0
- data/sass/piecss/settings/fonts/_lato.scss +32 -0
- data/sass/piecss/settings/fonts/_monospace.scss +39 -0
- data/sass/piecss/settings/fonts/_pt-sans.scss +40 -0
- data/sass/piecss/settings/fonts/_raleway.scss +31 -0
- data/sass/piecss/settings/fonts/_righteous.scss +23 -0
- data/sass/piecss/settings/fonts/_roboto.scss +34 -0
- data/sass/piecss/settings/fonts/_sans-serif.scss +39 -0
- data/sass/piecss/settings/fonts/_serif.scss +39 -0
- data/sass/piecss/settings/fonts/_sofia-pro.scss +40 -0
- data/sass/piecss/settings/fonts/_varela-round.scss +24 -0
- data/sass/piecss/settings/fonts/_verdana.scss +40 -0
- data/sass/piecss/settings/fonts/icon-fonts/_fontawesome.scss +33 -0
- data/sass/piecss/settings/fonts/icon-fonts/_foundation-accessability.scss +75 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_bootstrap.scss +84 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_core.scss +129 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_extras.scss +93 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_icons.scss +381 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_mixins.scss +48 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_path.scss +14 -0
- data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_variables.scss +734 -0
- data/sass/piecss/settings/fonts/icon-fonts/foundation-accessability/_settings.scss +28 -0
- data/sass/piecss/settings/form.scss +664 -0
- data/sass/piecss/settings/grid.scss +157 -0
- data/sass/piecss/settings/list.scss +216 -0
- data/sass/piecss/utilities.scss +16 -0
- data/sass/piecss/utilities/README.md +105 -0
- data/sass/piecss/utilities/breakpoint.scss +46 -0
- data/sass/piecss/utilities/cache.scss +74 -0
- data/sass/piecss/utilities/elements.scss +182 -0
- data/sass/piecss/utilities/image.scss +58 -0
- data/sass/piecss/utilities/layout.scss +367 -0
- data/sass/piecss/utilities/list.scss +26 -0
- data/sass/piecss/utilities/miscellaneous.scss +260 -0
- data/sass/piecss/utilities/rhythm.scss +173 -0
- data/sass/piecss/utilities/sides.scss +376 -0
- data/sass/piecss/utilities/typography.scss +295 -0
- data/sass/piecss/utilities/units.scss +166 -0
- data/templates/project/_settings.scss +24 -0
- data/templates/project/examples.html +224 -0
- data/templates/project/manifest.rb +13 -0
- data/templates/project/screen.scss +96 -0
- metadata +133 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
// Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
|
2
|
+
|
3
|
+
|
4
|
+
// Content:
|
5
|
+
// 1. Functions
|
6
|
+
// breakpoint
|
7
|
+
|
8
|
+
|
9
|
+
// 1. FUNCTIONS
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Expects a valid breakpoint expression like (min-width: 30em)
|
13
|
+
* A collection of pre-defined breakpoints are defined in [settings/breakpoints](*). Override and add breakpoints in your project's settings file.
|
14
|
+
*
|
15
|
+
* @example scss
|
16
|
+
* $small_handheld: "(max-width: #{to-unit(480px,1em,16px)})";
|
17
|
+
* @include breakpoint($small_handheld);
|
18
|
+
*
|
19
|
+
* @access public
|
20
|
+
* @since 0.1
|
21
|
+
*
|
22
|
+
* @param {String} $breakpoints - A valid breakpoint
|
23
|
+
* @param {Map} $media - The media to which this breakpoint applies
|
24
|
+
*/
|
25
|
+
@mixin breakpoint($breakpoints, $media: "only screen")
|
26
|
+
{
|
27
|
+
$breakpoints: unquote($breakpoints);
|
28
|
+
$query: ();
|
29
|
+
|
30
|
+
@if list-separator($breakpoints)=="comma" {
|
31
|
+
|
32
|
+
@each $breakpoint in $breakpoints {
|
33
|
+
$breakpoint: unquote($breakpoint);
|
34
|
+
$query: append($query, $breakpoint, comma);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
@else {
|
38
|
+
$query: append($query, $breakpoints, comma);
|
39
|
+
}
|
40
|
+
|
41
|
+
$query: "#{unquote($media)} and #{unquote($query)}";
|
42
|
+
|
43
|
+
@media #{$query} {
|
44
|
+
@content;
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
// Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
|
2
|
+
|
3
|
+
|
4
|
+
// Content:
|
5
|
+
// 1. Variables
|
6
|
+
// smart-cache
|
7
|
+
// 2. Mixins
|
8
|
+
// smart-cache
|
9
|
+
|
10
|
+
|
11
|
+
// 1. Variables
|
12
|
+
|
13
|
+
|
14
|
+
/**
|
15
|
+
* This is where we collect the properties and their selectors
|
16
|
+
*
|
17
|
+
* @type {Map}
|
18
|
+
*/
|
19
|
+
|
20
|
+
$smart-cache: ();
|
21
|
+
|
22
|
+
|
23
|
+
// 1. Functions
|
24
|
+
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Function smart-cache
|
28
|
+
*
|
29
|
+
* @example scss
|
30
|
+
* %inline-block {
|
31
|
+
* @include smart-cache((
|
32
|
+
* display: inline-block
|
33
|
+
* ));
|
34
|
+
* }
|
35
|
+
* %no-padding {
|
36
|
+
* @include smart-cache((
|
37
|
+
* padding: 0
|
38
|
+
* ));
|
39
|
+
* }
|
40
|
+
* %no-margin {
|
41
|
+
* @include smart-cache((
|
42
|
+
* margin: 0,
|
43
|
+
* ));
|
44
|
+
* }
|
45
|
+
*
|
46
|
+
* @todo This mixin is under construction and experimental - do not use yet
|
47
|
+
*
|
48
|
+
* @since 0.1
|
49
|
+
*
|
50
|
+
* @param {Map} $properties - Map of CSS properties
|
51
|
+
*/
|
52
|
+
|
53
|
+
@mixin smart-cache($properties) {
|
54
|
+
|
55
|
+
// Looping through all properties/values from map
|
56
|
+
@each $property, $value in $declarations {
|
57
|
+
// Get the stored values for the current property
|
58
|
+
$stored-values: map-get($smart-cache, $property);
|
59
|
+
|
60
|
+
// If the value doesn't exist in stored values
|
61
|
+
@if not index($stored-values, $value) {
|
62
|
+
// Add it
|
63
|
+
$smart-cache: map-merge($smart-cache, ($property: append($stored-values or (), $value))) !global;
|
64
|
+
// And create a placeholder at root level
|
65
|
+
@at-root %#{$property}-#{length(map-get($smart-cache, $property))} {
|
66
|
+
#{$property}: $value;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
// Extend the placeholder
|
71
|
+
@extend %#{$property}-#{index(map-get($smart-cache, $property), $value)};
|
72
|
+
}
|
73
|
+
|
74
|
+
}
|
@@ -0,0 +1,182 @@
|
|
1
|
+
// Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
|
2
|
+
|
3
|
+
|
4
|
+
// Content:
|
5
|
+
// 1. Functions
|
6
|
+
// add-element
|
7
|
+
// add-properties
|
8
|
+
// 2. Mixins
|
9
|
+
// element
|
10
|
+
// elements
|
11
|
+
|
12
|
+
|
13
|
+
// 1. FUNCTIONS
|
14
|
+
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Mixes in a new namespace (selector) and css properties into an elements collection.
|
18
|
+
*
|
19
|
+
* @access public
|
20
|
+
* @since 0.1
|
21
|
+
*
|
22
|
+
* @param {Map} $elements - Map, a collection of $selector: $property pairs
|
23
|
+
* @param {Map} $selector - The selector under which the properties will be rendered, for example: %placeholder
|
24
|
+
* @param {Map} $properties (()) - Map of CSS properties
|
25
|
+
*
|
26
|
+
* @return {Map}
|
27
|
+
*/
|
28
|
+
|
29
|
+
@function add-element($elements, $selector, $properties: ())
|
30
|
+
{
|
31
|
+
$_: (
|
32
|
+
#{$selector}: $properties
|
33
|
+
);
|
34
|
+
$elements: map-merge($elements, $_);
|
35
|
+
@return $elements;
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Mixes in properties into a selector namespace
|
40
|
+
*
|
41
|
+
* @access public
|
42
|
+
* @since 0.1
|
43
|
+
*
|
44
|
+
* @param {Map} $properties - Map of CSS properties
|
45
|
+
* @param {Map} $selector - The selector under which the properties will be rendered, for example: %placeholder
|
46
|
+
* @param {Map} $elements - Map, a collection of $selector: $property pairs
|
47
|
+
*
|
48
|
+
* @return {Map}
|
49
|
+
*/
|
50
|
+
|
51
|
+
@function add-properties($properties, $selector, $elements)
|
52
|
+
{
|
53
|
+
|
54
|
+
@if not map-has-key($elements, $selector) {
|
55
|
+
$elements: add-element($elements, $selector);
|
56
|
+
}
|
57
|
+
|
58
|
+
// Merge the nested property-map first
|
59
|
+
$element: map-get($elements, $selector);
|
60
|
+
$element: map-merge($element, $properties);
|
61
|
+
|
62
|
+
// Merge the property-map with the element collection
|
63
|
+
$_: (
|
64
|
+
#{$selector}: $element
|
65
|
+
);
|
66
|
+
$elements: map-merge($elements, $_);
|
67
|
+
|
68
|
+
@return $elements;
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* @alias add-properties
|
73
|
+
*/
|
74
|
+
@function add-props($properties, $selector, $elements)
|
75
|
+
{
|
76
|
+
$elements: add-properties($properties, $selector, $elements);
|
77
|
+
@return $elements;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* @alias add-properties
|
82
|
+
*/
|
83
|
+
@function merge-properties($properties, $selector, $elements)
|
84
|
+
{
|
85
|
+
$elements: add-properties($properties, $selector, $elements);
|
86
|
+
@return $elements;
|
87
|
+
}
|
88
|
+
|
89
|
+
/**
|
90
|
+
* @alias add-properties
|
91
|
+
*/
|
92
|
+
@function merge-props($properties, $selector, $elements)
|
93
|
+
{
|
94
|
+
$elements: add-properties($properties, $selector, $elements);
|
95
|
+
@return $elements;
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
// 2. MIXINS
|
100
|
+
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Mixes in properties
|
104
|
+
*
|
105
|
+
* @access public
|
106
|
+
* @since 0.1
|
107
|
+
*
|
108
|
+
* @param {Map} $element - Map of CSS properties
|
109
|
+
*/
|
110
|
+
|
111
|
+
@mixin properties($element)
|
112
|
+
{
|
113
|
+
// Lift out properties that have their own mixins
|
114
|
+
@if map-has-key($element, margin) {
|
115
|
+
$value: map-get($element, margin);
|
116
|
+
$element: map-remove($element, margin);
|
117
|
+
@include margin($value);
|
118
|
+
}
|
119
|
+
@if map-has-key($element, padding) {
|
120
|
+
$value: map-get($element, padding);
|
121
|
+
$element: map-remove($element, padding);
|
122
|
+
@include padding($value);
|
123
|
+
}
|
124
|
+
@if map-has-key($element, border-radius) {
|
125
|
+
$value: map-get($element, border-radius);
|
126
|
+
$element: map-remove($element, border-radius);
|
127
|
+
@include border-radius($value);
|
128
|
+
}
|
129
|
+
@if map-has-key($element, box-shadow) {
|
130
|
+
$value: map-get($element, box-shadow);
|
131
|
+
$element: map-remove($element, box-shadow);
|
132
|
+
@include box-shadow($value);
|
133
|
+
}
|
134
|
+
@if map-has-key($element, font-type) {
|
135
|
+
$value: ();
|
136
|
+
$value: append( $value, map-get($element, font-type));
|
137
|
+
@if map-has-key($element, font-size) {
|
138
|
+
$value: append( ($value), map-get($element, font-size));
|
139
|
+
}
|
140
|
+
@if map-has-key($element, line-height) {
|
141
|
+
$value: append($value, map-get($element, line-height));
|
142
|
+
}
|
143
|
+
$element: map-remove($element, font-family);
|
144
|
+
$element: map-remove($element, font-size);
|
145
|
+
$element: map-remove($element, line-height);
|
146
|
+
$element: map-remove($element, font);
|
147
|
+
|
148
|
+
@include font(nth($value,1), nth($value,2), nth($value,3));
|
149
|
+
}
|
150
|
+
@if map-has-key($element, font) {
|
151
|
+
$value: map-get($element, font);
|
152
|
+
$element: map-remove($element, font);
|
153
|
+
@include font(nth($value,1), nth($value,2), nth($value,3));
|
154
|
+
}
|
155
|
+
|
156
|
+
$properties: map-keys($element);
|
157
|
+
|
158
|
+
@each $property in $properties {
|
159
|
+
#{$property}: map-get($element, $property);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Mixes in all elements from an element collection
|
166
|
+
*
|
167
|
+
* @access public
|
168
|
+
* @since 0.1
|
169
|
+
*
|
170
|
+
* @param {Map} $elements - Map, a collection of $selector: $property pairs
|
171
|
+
*/
|
172
|
+
|
173
|
+
@mixin elements($elements) {
|
174
|
+
$selectors: map-keys($elements);
|
175
|
+
|
176
|
+
@each $selector in $selectors {
|
177
|
+
#{$selector} {
|
178
|
+
$element: map-get($elements, $selector);
|
179
|
+
@include properties($element);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
// Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
|
2
|
+
|
3
|
+
|
4
|
+
// Content:
|
5
|
+
// 1. Functions
|
6
|
+
// proportion
|
7
|
+
// orientation
|
8
|
+
|
9
|
+
|
10
|
+
// 1. FUNCTIONS
|
11
|
+
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Calculates the proportions of an element based on its width and height
|
15
|
+
*
|
16
|
+
* @since 0.1
|
17
|
+
*
|
18
|
+
* @todo: do something when numbers are not the same units
|
19
|
+
*
|
20
|
+
* @param {Map} $size - Map of width and height pairs (width: 100px, height: 100px)
|
21
|
+
*
|
22
|
+
* @return {Number}
|
23
|
+
*/
|
24
|
+
|
25
|
+
@function proportion($size)
|
26
|
+
{
|
27
|
+
$width: map-get($size, width);
|
28
|
+
$height: map-get($size, height);
|
29
|
+
|
30
|
+
@return $width / $height;
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Returns a string for horizontal, portrait or square proportions
|
35
|
+
*
|
36
|
+
* @since 0.1
|
37
|
+
*
|
38
|
+
* @param {Map} $size - Map of width and height pairs (width: 100px, height: 100px)
|
39
|
+
*
|
40
|
+
* @return {String}
|
41
|
+
*/
|
42
|
+
|
43
|
+
@function orientation($size)
|
44
|
+
{
|
45
|
+
$proportion: proportion($size);
|
46
|
+
|
47
|
+
@if $proportion > 1 {
|
48
|
+
@return landscape;
|
49
|
+
}
|
50
|
+
|
51
|
+
@if $proportion < 1 {
|
52
|
+
@return portrait;
|
53
|
+
}
|
54
|
+
|
55
|
+
@if $proportion == 1 {
|
56
|
+
@return square;
|
57
|
+
}
|
58
|
+
}
|
@@ -0,0 +1,367 @@
|
|
1
|
+
// Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
|
2
|
+
|
3
|
+
|
4
|
+
// Content
|
5
|
+
//
|
6
|
+
// 1. Functions
|
7
|
+
// percentage
|
8
|
+
// fraction-to-text
|
9
|
+
// 2. Mixins
|
10
|
+
// 2a. Columns
|
11
|
+
// column
|
12
|
+
// column-behavior
|
13
|
+
// column-width
|
14
|
+
// gutters
|
15
|
+
// 2b. Containers
|
16
|
+
// root
|
17
|
+
// bleed
|
18
|
+
// container-behavior
|
19
|
+
// 2c. Source Ordering
|
20
|
+
// move
|
21
|
+
// pull
|
22
|
+
// push
|
23
|
+
// reset-source-order
|
24
|
+
|
25
|
+
|
26
|
+
// 1. FUNCTIONS
|
27
|
+
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Convert a fraction to a percentage.
|
31
|
+
*
|
32
|
+
* @deprecated
|
33
|
+
*
|
34
|
+
* @param {Number} $fraction (1/3) - A fraction, e.g. 1/2
|
35
|
+
*
|
36
|
+
* @return {Number} - The resulting percentage value
|
37
|
+
*/
|
38
|
+
|
39
|
+
@function fraction-to-percentage($fraction: 1/3)
|
40
|
+
{
|
41
|
+
@return percentage($fraction);
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Convert a fraction to a word.
|
47
|
+
* Used to build style rules based on column widths.
|
48
|
+
* For values up to #/16.
|
49
|
+
*
|
50
|
+
* @example scss
|
51
|
+
* .#{fraction-to-text(1/2)} {
|
52
|
+
* // Column properties }
|
53
|
+
* // Output:
|
54
|
+
* .half {
|
55
|
+
* // Column properties }
|
56
|
+
*
|
57
|
+
* @since 0.1
|
58
|
+
*
|
59
|
+
* @param {Number} $fraction - A fraction, e.g. 1/2
|
60
|
+
*
|
61
|
+
* @return {String}
|
62
|
+
*/
|
63
|
+
|
64
|
+
@function fraction-to-text($fraction)
|
65
|
+
{
|
66
|
+
@if $fraction == 1/1 { @return "full"; }
|
67
|
+
@if $fraction == 1/2 { @return "half"; }
|
68
|
+
@if $fraction == 1/3 { @return "third"; }
|
69
|
+
@if $fraction == 1/4 { @return "fourth"; }
|
70
|
+
@if $fraction == 1/5 { @return "fifth"; }
|
71
|
+
@if $fraction == 1/6 { @return "sixth"; }
|
72
|
+
@if $fraction == 1/7 { @return "seventh"; }
|
73
|
+
@if $fraction == 1/8 { @return "eighth"; }
|
74
|
+
@if $fraction == 1/9 { @return "ninth"; }
|
75
|
+
@if $fraction == 1/10 { @return "tenth"; }
|
76
|
+
@if $fraction == 1/11 { @return "eleventh"; }
|
77
|
+
@if $fraction == 1/12 { @return "twelfth"; }
|
78
|
+
@if $fraction == 1/13 { @return "thirteenth"; }
|
79
|
+
@if $fraction == 1/14 { @return "fourteenth"; }
|
80
|
+
@if $fraction == 1/15 { @return "fifteenth"; }
|
81
|
+
@if $fraction == 1/16 { @return "sixteenth"; }
|
82
|
+
@if $fraction == 2/3 { @return "two-third"; }
|
83
|
+
@if $fraction == 3/4 { @return "three-fourth"; }
|
84
|
+
@if $fraction == 2/5 { @return "two-fifth"; }
|
85
|
+
@if $fraction == 3/5 { @return "three-fifth"; }
|
86
|
+
@if $fraction == 4/5 { @return "four-fifth"; }
|
87
|
+
@if $fraction == 5/6 { @return "five-sixth"; }
|
88
|
+
@if $fraction == 2/7 { @return "two-seventh"; }
|
89
|
+
@if $fraction == 3/7 { @return "three-seventh"; }
|
90
|
+
@if $fraction == 4/7 { @return "four-seventh"; }
|
91
|
+
@if $fraction == 5/7 { @return "five-seventh"; }
|
92
|
+
@if $fraction == 6/7 { @return "six-seventh"; }
|
93
|
+
@if $fraction == 3/8 { @return "three-eighth"; }
|
94
|
+
@if $fraction == 5/8 { @return "five-eighth"; }
|
95
|
+
@if $fraction == 7/8 { @return "seven-eighth"; }
|
96
|
+
@if $fraction == 2/9 { @return "two-ninth"; }
|
97
|
+
@if $fraction == 4/9 { @return "four-ninth"; }
|
98
|
+
@if $fraction == 5/9 { @return "five-ninth"; }
|
99
|
+
@if $fraction == 7/9 { @return "seven-ninth"; }
|
100
|
+
@if $fraction == 8/9 { @return "eight-ninth"; }
|
101
|
+
@if $fraction == 3/10 { @return "three-tenth"; }
|
102
|
+
@if $fraction == 7/10 { @return "seven-tenth"; }
|
103
|
+
@if $fraction == 9/10 { @return "nine-tenth"; }
|
104
|
+
@if $fraction == 2/11 { @return "two-eleventh"; }
|
105
|
+
@if $fraction == 3/11 { @return "three-eleventh"; }
|
106
|
+
@if $fraction == 4/11 { @return "four-eleventh"; }
|
107
|
+
@if $fraction == 5/11 { @return "five-eleventh"; }
|
108
|
+
@if $fraction == 6/11 { @return "six-eleventh"; }
|
109
|
+
@if $fraction == 7/11 { @return "seven-eleventh"; }
|
110
|
+
@if $fraction == 8/11 { @return "eight-eleventh"; }
|
111
|
+
@if $fraction == 9/11 { @return "nine-eleventh"; }
|
112
|
+
@if $fraction == 10/11 { @return "ten-eleventh"; }
|
113
|
+
@if $fraction == 5/12 { @return "five-twelfth"; }
|
114
|
+
@if $fraction == 7/12 { @return "seven-twelfth"; }
|
115
|
+
@if $fraction == 9/12 { @return "nine-twelfth"; }
|
116
|
+
@if $fraction == 11/12 { @return "eleven-twelfth"; }
|
117
|
+
@if $fraction == 2/13 { @return "two-thirteenth"; }
|
118
|
+
@if $fraction == 3/13 { @return "three-thirteenth"; }
|
119
|
+
@if $fraction == 4/13 { @return "four-thirteenth"; }
|
120
|
+
@if $fraction == 5/13 { @return "five-thirteenth"; }
|
121
|
+
@if $fraction == 6/13 { @return "six-thirteenth"; }
|
122
|
+
@if $fraction == 7/13 { @return "seven-thirteenth"; }
|
123
|
+
@if $fraction == 8/13 { @return "eight-thirteenth"; }
|
124
|
+
@if $fraction == 9/13 { @return "nine-thirteenth"; }
|
125
|
+
@if $fraction == 10/13 { @return "ten-thirteenth"; }
|
126
|
+
@if $fraction == 11/13 { @return "twelve-thirteenth"; }
|
127
|
+
@if $fraction == 12/13 { @return "thirteen-thirteenth"; }
|
128
|
+
@if $fraction == 3/14 { @return "three-fourteenth"; }
|
129
|
+
@if $fraction == 5/14 { @return "five-fourteenth"; }
|
130
|
+
@if $fraction == 9/14 { @return "nine-fourteenth"; }
|
131
|
+
@if $fraction == 11/14 { @return "eleven-fourteenth"; }
|
132
|
+
@if $fraction == 13/14 { @return "thirteen-fourteenth"; }
|
133
|
+
@if $fraction == 2/15 { @return "two-fifteenth"; }
|
134
|
+
@if $fraction == 4/15 { @return "four-fifteenth"; }
|
135
|
+
@if $fraction == 7/15 { @return "seven-fifteenth"; }
|
136
|
+
@if $fraction == 8/15 { @return "eight-fifteenth"; }
|
137
|
+
@if $fraction == 11/15 { @return "eleven-fifteenth"; }
|
138
|
+
@if $fraction == 13/15 { @return "thirteen-fifteenth"; }
|
139
|
+
@if $fraction == 14/15 { @return "fourteen-fifteenth"; }
|
140
|
+
@if $fraction == 3/16 { @return "three-sixteenth"; }
|
141
|
+
@if $fraction == 5/16 { @return "five-sixteenth"; }
|
142
|
+
@if $fraction == 7/16 { @return "seven-sixteenth"; }
|
143
|
+
@if $fraction == 9/16 { @return "nine-sixteenth"; }
|
144
|
+
@if $fraction == 11/16 { @return "eleven-sixteenth"; }
|
145
|
+
@if $fraction == 13/16 { @return "thirteen-sixteenth"; }
|
146
|
+
@if $fraction == 15/16 { @return "sixteen-sixteenth"; }
|
147
|
+
|
148
|
+
@return false;
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
// 2. MIXINS
|
153
|
+
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Shorthand mixin for column.
|
157
|
+
* Uses padding by default, can be overridden to use margins instead which is especially helpful when assigning backgrounds or borders.
|
158
|
+
*
|
159
|
+
* @since 0.1
|
160
|
+
*
|
161
|
+
* @param {Number} $fraction (1/1) - A fraction, e.g. 1/2
|
162
|
+
* @param {Number | Bool} $apply-padding (1/2) - A fraction, e.g. 1/2, or false
|
163
|
+
* @param {Number | Bool} $apply-margin (false) - A fraction, e.g. 1/2, or false
|
164
|
+
*/
|
165
|
+
|
166
|
+
@mixin column($fraction: 1/1, $apply-padding: 1/2, $apply-margin: false)
|
167
|
+
{
|
168
|
+
@include column-behavior();
|
169
|
+
@include column-width($fraction);
|
170
|
+
|
171
|
+
@if $apply-padding {
|
172
|
+
@include gutters($apply-padding);
|
173
|
+
}
|
174
|
+
|
175
|
+
@if $apply-margin {
|
176
|
+
@include gutters($apply-margin, true);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Mixin column-behavior: prepares an element to behave as a column. Widths must be set separately with [column-width](./#mixin-column-width).
|
183
|
+
*
|
184
|
+
* @since 0.1
|
185
|
+
*
|
186
|
+
* @param {Bool} $column-float (false) - If true, render columns as left floated block element. If false, render as inline-blocks.
|
187
|
+
* @param {Bool | Number} $negative-right-margin (false) - If set, applies a negative right margin to force inline-blocks to render without gaps. Only use this if you cannot minify your markup.
|
188
|
+
*/
|
189
|
+
|
190
|
+
@mixin column-behavior($column-float: $column-float, $negative-right-margin: $negative-right-margin)
|
191
|
+
{
|
192
|
+
@if $column-float {
|
193
|
+
display: block;
|
194
|
+
float: left;
|
195
|
+
}
|
196
|
+
@else {
|
197
|
+
@include inline-block(top);
|
198
|
+
@if $negative-right-margin {
|
199
|
+
margin-right: $negative-right-margin !important;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Mixin column-width. If [$negative-right-margin]() is set, it will automatically remove if from columns that span the full width of their containers.
|
207
|
+
*
|
208
|
+
* @since 0.1
|
209
|
+
*
|
210
|
+
* @param {Number} $fraction (1/1) - A fraction, e.g. 1/2
|
211
|
+
*/
|
212
|
+
|
213
|
+
@mixin column-width($fraction: $column-width-default)
|
214
|
+
{
|
215
|
+
width: percentage($fraction);
|
216
|
+
|
217
|
+
// Remove negative margin on elements that span full width of their container
|
218
|
+
@if $fraction == 1/1 and $negative-right-margin {
|
219
|
+
margin-right: 0;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Mixes in gutter properties. Gutters are declared inside the column (padding) by default, on both sides. Can be overridden to use margins instead, which is helpful when assigning backgrounds or borders
|
226
|
+
*
|
227
|
+
* @since 0.1
|
228
|
+
*
|
229
|
+
* @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
|
230
|
+
* @param {Bool} $use-margin (false) - If true, will render gutters outside the column using margins
|
231
|
+
*/
|
232
|
+
|
233
|
+
@mixin gutters($fraction: 1/2, $use-margin: false)
|
234
|
+
{
|
235
|
+
$both: length($fraction);
|
236
|
+
|
237
|
+
$left: $fraction;
|
238
|
+
$right: $fraction;
|
239
|
+
|
240
|
+
@if $both > 1 {
|
241
|
+
$left: nth($fraction,1);
|
242
|
+
$right: nth($fraction,2);
|
243
|
+
}
|
244
|
+
|
245
|
+
@if ($use-margin) {
|
246
|
+
@if $left != false {
|
247
|
+
margin-left: hrhythm($left);
|
248
|
+
}
|
249
|
+
@if $right != false {
|
250
|
+
margin-right: hrhythm($right);
|
251
|
+
}
|
252
|
+
}
|
253
|
+
@else {
|
254
|
+
@if $left != false {
|
255
|
+
padding-left: hrhythm($left);
|
256
|
+
}
|
257
|
+
@if $right != false {
|
258
|
+
padding-right: hrhythm($right);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
}
|
262
|
+
|
263
|
+
|
264
|
+
/**
|
265
|
+
* Fixes content width and aligns in viewport. [$root-position](./#variable-root-position) is defind in grid settings. Centers content inside the viewport by default.
|
266
|
+
*
|
267
|
+
* @since 0.1
|
268
|
+
*
|
269
|
+
* @param {Number} $root-max-width (72em) - The maximum width of your content
|
270
|
+
*/
|
271
|
+
|
272
|
+
@mixin root($root-max-width: $root-max-width, $set-display: false)
|
273
|
+
{
|
274
|
+
@if $root-position==center {
|
275
|
+
margin: 0 auto;
|
276
|
+
}
|
277
|
+
|
278
|
+
max-width: $root-max-width;
|
279
|
+
}
|
280
|
+
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Use it to remove column spacing on columns
|
284
|
+
*
|
285
|
+
* @since 0.1
|
286
|
+
*
|
287
|
+
* @param {Bool} $use-margin (false)
|
288
|
+
*/
|
289
|
+
|
290
|
+
@mixin container-behavior($use-margin: false)
|
291
|
+
{
|
292
|
+
@if $use-margin {
|
293
|
+
margin-left: 0;
|
294
|
+
margin-right: 0;
|
295
|
+
}
|
296
|
+
@else {
|
297
|
+
padding-left: 0;
|
298
|
+
padding-right: 0;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Mixin to reverse padding on a container.
|
305
|
+
* Use it to remove padded column spacing on columns, helpful when nesting columns and when applying backgrounds.
|
306
|
+
*
|
307
|
+
* @since 0.1
|
308
|
+
*
|
309
|
+
* @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
|
310
|
+
*/
|
311
|
+
|
312
|
+
@mixin bleed($fraction: -1/2)
|
313
|
+
{
|
314
|
+
@include gutters($fraction, true);
|
315
|
+
}
|
316
|
+
|
317
|
+
|
318
|
+
/**
|
319
|
+
* Mixin for soure ordering
|
320
|
+
*
|
321
|
+
* @since 0.1
|
322
|
+
*
|
323
|
+
* @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
|
324
|
+
*/
|
325
|
+
|
326
|
+
@mixin move($fraction)
|
327
|
+
{
|
328
|
+
left: percentage($fraction);
|
329
|
+
}
|
330
|
+
|
331
|
+
|
332
|
+
/**
|
333
|
+
* @alias move
|
334
|
+
*/
|
335
|
+
|
336
|
+
@mixin push($fraction)
|
337
|
+
{
|
338
|
+
@include move($fraction);
|
339
|
+
}
|
340
|
+
|
341
|
+
|
342
|
+
/**
|
343
|
+
* @alias move
|
344
|
+
*/
|
345
|
+
|
346
|
+
@mixin pull($fraction)
|
347
|
+
{
|
348
|
+
@include move(-1*$fraction);
|
349
|
+
}
|
350
|
+
|
351
|
+
|
352
|
+
/**
|
353
|
+
* Mixin for soure ordering.
|
354
|
+
* Will reset positioning for smallest breakpoint.
|
355
|
+
*
|
356
|
+
* @since 0.1
|
357
|
+
*/
|
358
|
+
|
359
|
+
@mixin reset-source-order()
|
360
|
+
{
|
361
|
+
@if $column-breakpoint {
|
362
|
+
@include breakpoint( $column-breakpoint ) {
|
363
|
+
position: static;
|
364
|
+
position: initial;
|
365
|
+
}
|
366
|
+
}
|
367
|
+
}
|