archetype 0.0.1.pre.12 → 0.0.1.pre.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/archetype.rb +4 -0
- data/lib/archetype/actions/help.rb +16 -0
- data/lib/archetype/actions/theme.rb +73 -0
- data/lib/archetype/executor.rb +27 -0
- data/lib/archetype/functions/hash.rb +28 -12
- data/lib/archetype/functions/helpers.rb +46 -13
- data/lib/archetype/functions/styleguide_memoizer.rb +10 -2
- data/lib/archetype/sass_extensions/functions/lists.rb +36 -42
- data/lib/archetype/sass_extensions/functions/locale.rb +32 -16
- data/lib/archetype/sass_extensions/functions/styleguide.rb +127 -38
- data/lib/archetype/sass_extensions/functions/ui.rb +3 -2
- data/lib/archetype/sass_extensions/functions/version.rb +11 -6
- data/lib/archetype/sass_extensions/monkey_patches.rb +1 -1
- data/lib/archetype/version.rb +2 -2
- data/stylesheets/archetype/_base.scss +7 -2
- data/stylesheets/archetype/_config.scss +8 -1
- data/stylesheets/archetype/_hacks.scss +51 -17
- data/stylesheets/archetype/_ui.scss +16 -5
- data/stylesheets/archetype/base/_h5bp.scss +12 -12
- data/stylesheets/archetype/base/_normalize.scss +178 -139
- data/stylesheets/archetype/grid/_grid.scss +13 -13
- data/stylesheets/archetype/styleguide/components/_buttons.scss +1 -0
- data/stylesheets/archetype/util/_debug.scss +4 -4
- data/stylesheets/archetype/util/_lists.scss +1 -1
- data/stylesheets/archetype/util/_misc.scss +1 -1
- data/stylesheets/archetype/util/_rtl.scss +1 -1
- data/stylesheets/archetype/util/_spacing.scss +6 -6
- data/stylesheets/archetype/util/_styles.scss +21 -10
- data/stylesheets/archetype/util/_targeting.scss +1 -1
- data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png +0 -0
- data/test/fixtures/stylesheets/archetype/config.rb +2 -0
- data/test/fixtures/stylesheets/archetype/source/base.scss +3 -0
- data/test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss +5 -0
- data/test/fixtures/stylesheets/archetype/source/locale.scss +43 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/alerts.scss +21 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss +5 -1
- data/test/fixtures/stylesheets/archetype/source/styleguide/drop.scss +101 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/extend.scss +24 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/invalid_structures.scss +85 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/multi_value.scss +18 -0
- data/test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss +1 -1
- data/test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss +1 -1
- data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +30 -0
- data/test/fixtures/stylesheets/archetype/source/utilities/associative.scss +24 -0
- data/test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss +4 -3
- data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +8 -1
- data/test/fixtures/stylesheets/archetype/tmp/b.css +14 -0
- data/test/fixtures/stylesheets/archetype/tmp/base.css +349 -0
- data/test/fixtures/stylesheets/archetype/tmp/hacks/ie_pseudo.css +11 -0
- data/test/fixtures/stylesheets/archetype/tmp/hacks/transparent_focusable.css +4 -0
- data/test/fixtures/stylesheets/archetype/tmp/locale.css +23 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/alerts.css +711 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/buttons.css +2119 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/drop.css +63 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/extend.css +11 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/fallback_styles.css +10 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/invalid_structures.css +21 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/multi_value.css +13 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/nested_styleguides.css +28 -0
- data/test/fixtures/stylesheets/archetype/tmp/styleguide/selective_state.css +177 -0
- data/test/fixtures/stylesheets/archetype/tmp/ui/glyph_icon.css +127 -0
- data/test/fixtures/stylesheets/archetype/tmp/ui/hide_element.css +8 -0
- data/test/fixtures/stylesheets/archetype/tmp/ui/stroke.css +17 -0
- data/test/fixtures/stylesheets/archetype/tmp/ui/triangle.css +35 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/associative.css +9 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/custom_output_styler.css +8 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/if-set.css +9 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/spacing/horizontal-spacing.css +29 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/spacing/vertical-spacing.css +29 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/styles/filter.css +11 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/styles/font-family.css +16 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/styles/z-index.css +15 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/targeting/target-browser.css +105 -0
- data/test/fixtures/stylesheets/archetype/tmp/utilities/targeting/target-os.css +55 -0
- data/test/helpers/test_case.rb +2 -2
- data/test/integrations/archetype_test.rb +3 -1
- data/test/units/sass_extensions_test.rb +18 -25
- metadata +81 -3
@@ -68,7 +68,7 @@
|
|
68
68
|
// @param $left {Number} the number of units to dent left
|
69
69
|
// @param $right {Number} the number of units to dent right
|
70
70
|
// @param $direction {String} [in|out] the direction to dent
|
71
|
-
// @param $abuse {
|
71
|
+
// @param $abuse {Boolean} @see _getUnit
|
72
72
|
// @return $dent {List} list of dents
|
73
73
|
@function _gridDent($list: false, $left: 0, $right: 0, $direction: in, $abuse: false) {
|
74
74
|
$factor: if($direction == out, -1, 1) * $CONFIG_GRID_SPACING_FACTOR;
|
@@ -92,7 +92,7 @@
|
|
92
92
|
// @param $list {List} list of indents
|
93
93
|
// @param $left {Number} the number of units to indent left
|
94
94
|
// @param $right {Number} the number of units to indent right
|
95
|
-
// @param $abuse {
|
95
|
+
// @param $abuse {Boolean} @see _getUnit
|
96
96
|
// @return {List} list of indents
|
97
97
|
@function grid-indent($list: false, $left: 0, $right: 0, $abuse: false) {
|
98
98
|
@return _gridDent($list, $left, $right, $direction: in, $abuse: $abuse);
|
@@ -103,7 +103,7 @@
|
|
103
103
|
// @param $list {List} list of outdents
|
104
104
|
// @param $left {Number} the number of units to outdent left
|
105
105
|
// @param $right {Number} the number of units to outdent right
|
106
|
-
// @param $abuse {
|
106
|
+
// @param $abuse {Boolean} @see _getUnit
|
107
107
|
// @return {List} list of outdents
|
108
108
|
@function grid-outdent($list: false, $left: 0, $right: 0, $abuse: false) {
|
109
109
|
@return _gridDent($list, $left, $right, $direction: out, $abuse: $abuse);
|
@@ -217,7 +217,7 @@
|
|
217
217
|
|
218
218
|
// this lets rows clear the floated containers
|
219
219
|
// @mixin grid-row
|
220
|
-
// @param $debug {
|
220
|
+
// @param $debug {Boolean} use debug stylings
|
221
221
|
@mixin grid-row($debug: false) {
|
222
222
|
@include grid-block(true);
|
223
223
|
@include debug-hover-box(rgb(255, 0, 255), $if: ($debug or $CONFIG_GRID_DEBUG));
|
@@ -225,7 +225,7 @@
|
|
225
225
|
|
226
226
|
// output the block methods
|
227
227
|
// @mixin grid-block
|
228
|
-
// @param $row {
|
228
|
+
// @param $row {Boolean} is this block a row
|
229
229
|
@mixin grid-block($row: false) {
|
230
230
|
// FLOAT
|
231
231
|
@if($CONFIG_GRID_ALIGN_METHOD == float){
|
@@ -257,7 +257,7 @@
|
|
257
257
|
//text-space-collapse: collapse;
|
258
258
|
}
|
259
259
|
@else {
|
260
|
-
// if reading direction is
|
260
|
+
// if reading direction is different from the grid direction,
|
261
261
|
// reset the reading direction of the inner container
|
262
262
|
@if(reading-direction() != $CONFIG_GRID_DIRECTION) {
|
263
263
|
direction: reading-direction();
|
@@ -283,7 +283,7 @@
|
|
283
283
|
border-spacing: $CONFIG_GRID_GUTTER 0;
|
284
284
|
}
|
285
285
|
@else {
|
286
|
-
// if reading direction is
|
286
|
+
// if reading direction is different from the grid direction,
|
287
287
|
// reset the reading direction of the inner container
|
288
288
|
@if(reading-direction() != $CONFIG_GRID_DIRECTION) {
|
289
289
|
direction: reading-direction();
|
@@ -302,7 +302,7 @@
|
|
302
302
|
// @mixin grid-canvas
|
303
303
|
// @param $columns {Number} the number or fraction of columns to span, if fraction, must specify $of
|
304
304
|
// @param $of {Number} the total number of columns spanned, only use with fractional $columns
|
305
|
-
// @param $debug {
|
305
|
+
// @param $debug {Boolean} use debug stylings
|
306
306
|
@mixin grid-canvas($columns: false, $of: false, $debug: false) {
|
307
307
|
@include grid($columns: $columns, $of: $of, $debug: $debug, $canvas: true);
|
308
308
|
}
|
@@ -310,15 +310,15 @@
|
|
310
310
|
// the main grid mixin
|
311
311
|
// @mixin grid
|
312
312
|
// @param $columns {Number} the number or fraction of columns to span, if fraction, must specify $of
|
313
|
-
// @param $first {
|
313
|
+
// @param $first {Boolean} is this the first grid block of a row
|
314
314
|
// @param $of {Number} the total number of columns spanned, only use with fractional $columns
|
315
315
|
// @param $indent {List} the grid indents @see grid-indent
|
316
316
|
// @param $outdent {List} the grid outdents @see grid-outdent
|
317
317
|
// @param $offset {List} the grid offsets @see grid-offset, grid-push, grid-pull
|
318
|
-
// @param $canvas {
|
319
|
-
// @param $row {
|
320
|
-
// @param $center {
|
321
|
-
// @param $debug {
|
318
|
+
// @param $canvas {Boolean} treat this grid block as a canvas; a canvas is a non-floated, centered grid-block
|
319
|
+
// @param $row {Boolean} @see grid-row
|
320
|
+
// @param $center {Boolean} whether or not to center the grid block
|
321
|
+
// @param $debug {Boolean} use debug stylings
|
322
322
|
@mixin grid($columns: false, $first: false, $of: false, $indent: false, $outdent: false, $offset: false, $offset-method: $CONFIG_GRID_OFFSET_METHOD, $canvas: false, $row: false, $center: false, $debug: false) {
|
323
323
|
@if($row) {
|
324
324
|
@include grid-row($debug: $debug);
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
// check if debug is enabled
|
4
4
|
// @function is-debug-enabled
|
5
|
-
// @param $if {
|
6
|
-
// @return {
|
5
|
+
// @param $if {Boolean} optional override for $CONFIG_DEBUG
|
6
|
+
// @return {Boolean} whether or not debug is enabled
|
7
7
|
@function is-debug-enabled($if: nil) {
|
8
8
|
// debug is only available in DEV environments, so check that first
|
9
9
|
// then check if the debug flag/override is truthy
|
@@ -13,7 +13,7 @@
|
|
13
13
|
// a debug helper, print out a message
|
14
14
|
// @mixin debug-message
|
15
15
|
// @param $message {String} the message to output
|
16
|
-
// @param $if {
|
16
|
+
// @param $if {Boolean} override $CONFIG_DEBUG
|
17
17
|
@mixin debug-message($message, $if: nil) {
|
18
18
|
@if(is-debug-enabled($if)) {
|
19
19
|
@if archetype-version('sass >= 3.2') {
|
@@ -29,7 +29,7 @@
|
|
29
29
|
// @mixin debug-hover-box
|
30
30
|
// @param $color {String} the color to draw the border
|
31
31
|
// @param $opacity {Number}
|
32
|
-
// @param $if {
|
32
|
+
// @param $if {Boolean} override $CONFIG_DEBUG
|
33
33
|
@mixin debug-hover-box($color: rgb(0, 255, 255), $opacity: 0.9, $if: nil) {
|
34
34
|
@if(is-debug-enabled($if)) {
|
35
35
|
&:hover {
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// @param $list {List} the list to remove from
|
6
6
|
// @param $idx {Number} the index to remove
|
7
7
|
// @param $separator {String} the separator to use [auto|comma|space]
|
8
|
-
// @return $new-list {
|
8
|
+
// @return $new-list {Boolean} the list with removed index
|
9
9
|
@function list-remove($list: (), $idx: false, $separator: auto) {
|
10
10
|
@return list-replace($list: $list, $idx: $idx, $value: nil, $separator: $separator);
|
11
11
|
}
|
@@ -20,7 +20,7 @@ $REGISTRY_DO_ONCE: () !default;
|
|
20
20
|
// a function to prevent routines from executing multiple times
|
21
21
|
// @function do-once
|
22
22
|
// @param $name {String} name of the identifier
|
23
|
-
// @return {
|
23
|
+
// @return {Boolean} true if the first time invoked, false otherwise
|
24
24
|
@function do-once($name) {
|
25
25
|
@if index($REGISTRY_DO_ONCE, $name) {
|
26
26
|
@return false;
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// @param $value {List|String} [*|left|right] the value to augment
|
6
6
|
// @param $method {String} [border-radius|background]
|
7
7
|
// @param $force {String} [ltr|rtl] allows you to ignore reading-direction()
|
8
|
-
// @return {
|
8
|
+
// @return {Boolean|List|String} the augmented value
|
9
9
|
@function rtl($value: false, $method: false, $force: false) {
|
10
10
|
$dir: if($force, $force, reading-direction());
|
11
11
|
@if($value == false) {
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// @private
|
6
6
|
// @param $unit {Number} unit of measurement
|
7
7
|
// @param $direction {String} [horizontal|vertical] spacing
|
8
|
-
// @param $abuse {
|
8
|
+
// @param $abuse {Boolean} @see _getUnit
|
9
9
|
// @return {String} the calculated spacing
|
10
10
|
@function _spacing($unit: nil, $direction: horizontal, $abuse: false) {
|
11
11
|
@if $unit == nil {
|
@@ -19,7 +19,7 @@
|
|
19
19
|
// horizonatl spacing calculations
|
20
20
|
// @function horizontal-spacing
|
21
21
|
// @param $unit {Number} unit of measurement
|
22
|
-
// @param $abuse {
|
22
|
+
// @param $abuse {Boolean} @see _getUnit
|
23
23
|
// @return {String} the calculated horizontal spacing
|
24
24
|
@function horizontal-spacing($unit, $abuse: false) {
|
25
25
|
@return _spacing($unit, $abuse: $abuse);
|
@@ -28,7 +28,7 @@
|
|
28
28
|
// vertical spacing calculations
|
29
29
|
// @function vertical-spacing
|
30
30
|
// @param $unit {Number} unit of measurement
|
31
|
-
// @param $abuse {
|
31
|
+
// @param $abuse {Boolean} @see _getUnit
|
32
32
|
// @return {String} the calculated vertical spacing
|
33
33
|
@function vertical-spacing($unit, $abuse: false) {
|
34
34
|
@return _spacing($unit, $direction: vertical, $abuse: $abuse);
|
@@ -40,7 +40,7 @@
|
|
40
40
|
// @param $top {Number} the units to offset from the top
|
41
41
|
// @param $bottom {Number} the units to offset from the bottom
|
42
42
|
// @param $method {String} [margin|padding] offset method
|
43
|
-
// @param $abuse {
|
43
|
+
// @param $abuse {Boolean} @see _getUnit
|
44
44
|
@mixin vertical-spacing($list: false, $top: nil, $bottom: nil, $method: false, $abuse: false) {
|
45
45
|
$list: get-collection($list, ($top $bottom), $min: 2);
|
46
46
|
@include _spacing($list, vertical, $method: $method, $abuse: $abuse);
|
@@ -51,7 +51,7 @@
|
|
51
51
|
// @param $left {Number} the units to offset from the left
|
52
52
|
// @param $right {Number} the units to offset from the right
|
53
53
|
// @param $method {String} [margin|padding] offset method
|
54
|
-
// @param $abuse {
|
54
|
+
// @param $abuse {Boolean} @see _getUnit
|
55
55
|
@mixin horizontal-spacing($list: false, $left: nil, $right: nil, $method: false, $abuse: false) {
|
56
56
|
$list: get-collection($list, ($left $right), $min: 2);
|
57
57
|
@include _spacing($list, $method: $method, $abuse: $abuse);
|
@@ -62,7 +62,7 @@
|
|
62
62
|
// @private
|
63
63
|
// @param $units {List} the list of units e.g. (1) => $left:1 $right:1; (1 0) => $left:1 $right:0;
|
64
64
|
// @param $method {String} [margin|padding] offset method
|
65
|
-
// @param $abuse {
|
65
|
+
// @param $abuse {Boolean} @see _getUnit
|
66
66
|
@mixin _spacing($units, $direction: horizontal, $method: false, $abuse: false) {
|
67
67
|
@if(not $method) {
|
68
68
|
$method: $CONFIG_SPACING_METHOD;
|
@@ -10,7 +10,6 @@
|
|
10
10
|
// @param $value {*} the CSS value to output
|
11
11
|
@mixin _outputStyle($property, $value: nil) {
|
12
12
|
@if($value != nil) {
|
13
|
-
// !!DO NOT COPY TO ARCHETYPE - this mixin is specific to _round_button.scss
|
14
13
|
@if($property == round-button-ie-support) {
|
15
14
|
@include round-button-ie-support($value)
|
16
15
|
}
|
@@ -40,9 +39,9 @@
|
|
40
39
|
// @param $property {String} the CSS property to output
|
41
40
|
// @param $value {*} the CSS value to output
|
42
41
|
@mixin output-style($property, $value: nil) {
|
43
|
-
|
42
|
+
|
43
|
+
@if($property != nil and length(-compass-list($value)) > 0 and first-value-of(-compass-list($value)) != nil and not index($CONFIG_DISABLED_CSS, $property)) {
|
44
44
|
// for mixins, we need to do some custom work
|
45
|
-
// has-custom-output-styler: copy & pasted from latest github repo 10/3/2013
|
46
45
|
// check to see if we have a custom output styler (pre)
|
47
46
|
@if has-custom-output-styler($property, $value, pre) == true {
|
48
47
|
@include custom-output-styler($property, $value, $method: pre);
|
@@ -87,8 +86,14 @@
|
|
87
86
|
@else if($property == stretch) { @include stretch(); }
|
88
87
|
// appearance
|
89
88
|
@else if($property == appearance) { @include appearance($value); }
|
90
|
-
|
89
|
+
// unhide-element
|
90
|
+
@else if($property == unhide-element) { @include unhide-element(); }
|
91
|
+
// ellipsis
|
92
|
+
@else if($property == ellipsis) { @include ellipsis(); }
|
93
|
+
// scale
|
91
94
|
@else if($property == scale) { @include scale($value); }
|
95
|
+
@else if($property == glyph-icon) { @include glyph-icon(nth($value, 1), nth($value, 2), nth($value, 3), nth($value, 4), nth($value, 5)); }
|
96
|
+
@else if($property == extend) { @extend #{$value}; }
|
92
97
|
// animations
|
93
98
|
@else if($property == animation) {
|
94
99
|
@if archetype-version('compass >= 0.13') {
|
@@ -158,7 +163,6 @@
|
|
158
163
|
}
|
159
164
|
//ellipsis
|
160
165
|
@else if($property == ellipsis) { @include ellipsis(); }
|
161
|
-
// has-custom-output-styler: copy & pasted from latest github repo 10/3/2013
|
162
166
|
// check to see if we have a custom output styler (post)
|
163
167
|
@else if has-custom-output-styler($property, $value, post) == true {
|
164
168
|
@include custom-output-styler($property, $value, $method: post);
|
@@ -169,10 +173,10 @@
|
|
169
173
|
}
|
170
174
|
|
171
175
|
// convert a list of key-value pairs into CSS rules
|
172
|
-
// @mixin
|
173
|
-
// @param
|
174
|
-
// @param
|
175
|
-
// @param
|
176
|
+
// @mixin to-styles
|
177
|
+
// @param $list {List} a key-value paired list of ($property $value)
|
178
|
+
// @param $states {Boolean|List} if true, output all states; if false, output no states; if a list, output only the states in the list
|
179
|
+
// @param $exclude {List} a list of styles to exclude from output
|
176
180
|
@mixin to-styles($list: (), $states: true, $selectors: true, $exclude: ()) {
|
177
181
|
$exclude: -compass-list($exclude);
|
178
182
|
$states-data: ();
|
@@ -228,7 +232,14 @@
|
|
228
232
|
}
|
229
233
|
|
230
234
|
@function _getSelectorSelector($selector) {
|
231
|
-
|
235
|
+
$selector: first-value-of(-compass-list($selector));
|
236
|
+
@if $selector == $CORE_GLYPH_SELECTOR_VAR {
|
237
|
+
$selector: $archetype-glyph-selector;
|
238
|
+
}
|
239
|
+
@elseif $selector == $CORE_GLYPH_SELECTOR_VAR {
|
240
|
+
$selector: $archetype-pseudo-selector;
|
241
|
+
}
|
242
|
+
@return $selector;
|
232
243
|
}
|
233
244
|
|
234
245
|
// mixin for outputting filters in legacy IE
|
@@ -3,7 +3,7 @@
|
|
3
3
|
@function _isLegacySupported($vendor, $comparator, $version) {
|
4
4
|
// we currently only check for legacy IE support
|
5
5
|
@if $vendor != ie { @return true; }
|
6
|
-
$compass-not-legacy-ie-version: 9;
|
6
|
+
$compass-not-legacy-ie-version: 9; // the version if IE that Compass starts considering `legacy`
|
7
7
|
$min-ie-legacy-support: 999;
|
8
8
|
@if($legacy-support-for-ie8) { $min-ie-legacy-support: 8; }
|
9
9
|
@if($legacy-support-for-ie7) { $min-ie-legacy-support: 7; }
|
Binary file
|
@@ -0,0 +1,43 @@
|
|
1
|
+
@import "archetype";
|
2
|
+
|
3
|
+
// test for a simple locale
|
4
|
+
.en_US {
|
5
|
+
@if(locale(en_US)) {
|
6
|
+
content: "en_US";
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
// test for a wildcard territory
|
11
|
+
.en_wild {
|
12
|
+
@if(locale(en_)) {
|
13
|
+
content: "en_*";
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
// test for a wildcard language
|
18
|
+
.wild_US {
|
19
|
+
@if(locale(_US)) {
|
20
|
+
content: "*_US";
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
// multiple locales, one valid
|
25
|
+
.one {
|
26
|
+
@if(locale(de_DE fr_FR pt_ en_US)) {
|
27
|
+
content: "one of de_DE fr_FR pt_ en_US";
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
// multiple locales, none valid
|
32
|
+
.not {
|
33
|
+
@if(not locale(ja_JP pt_BR _GB de_)) {
|
34
|
+
content: "not one of ja_JP pt_BR _GB de_";
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
// test that the lang() alias works
|
39
|
+
.lang {
|
40
|
+
@if(lang(en_US)) {
|
41
|
+
content: "en_US";
|
42
|
+
}
|
43
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@import "archetype";
|
2
|
+
|
3
|
+
@each $type in (error success notice yield) {
|
4
|
+
.alert.#{$type} {
|
5
|
+
@include styleguide($type alert);
|
6
|
+
.dismiss {
|
7
|
+
@include styleguide(close in a $type alert);
|
8
|
+
}
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
$CONFIG_GENERATED_TAG_INLINE: false;
|
13
|
+
|
14
|
+
@each $type in (error success notice yield) {
|
15
|
+
.alert.#{$type} {
|
16
|
+
@include styleguide($type alert);
|
17
|
+
.dismiss {
|
18
|
+
@include styleguide(close in a $type alert);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@import "archetype";
|
1
|
+
@import "archetype";
|
2
2
|
|
3
3
|
@each $context in container, bristol, punchcut {
|
4
4
|
.#{$context} {
|
@@ -12,3 +12,7 @@
|
|
12
12
|
}
|
13
13
|
}
|
14
14
|
}
|
15
|
+
|
16
|
+
.test-exclude {
|
17
|
+
@include styleguide(small secondary button in a container, $exclude: width height border-radius padding font-size line-height cursor);
|
18
|
+
}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
@import "archetype";
|
2
|
+
|
3
|
+
@if not styleguide-component-exists(dropping-styles-test, $CONFIG_THEME) {
|
4
|
+
$a-blackhole: styleguide-add-component(dropping-styles-test, (), (
|
5
|
+
(default, (
|
6
|
+
display block,
|
7
|
+
color red,
|
8
|
+
background green,
|
9
|
+
(states, (
|
10
|
+
(hover, (
|
11
|
+
styleguide module,
|
12
|
+
border (2px solid red),
|
13
|
+
(selectors, (
|
14
|
+
('.test', (
|
15
|
+
padding 100px,
|
16
|
+
margin 20px
|
17
|
+
)),
|
18
|
+
nil
|
19
|
+
))
|
20
|
+
)),
|
21
|
+
nil
|
22
|
+
))
|
23
|
+
)),
|
24
|
+
(parent, (
|
25
|
+
display none,
|
26
|
+
color black
|
27
|
+
)),
|
28
|
+
(heir, (
|
29
|
+
inherit (parent),
|
30
|
+
nil
|
31
|
+
)),
|
32
|
+
(dropped, (
|
33
|
+
drop true,
|
34
|
+
color yellow
|
35
|
+
)),
|
36
|
+
(dropped2, (
|
37
|
+
drop true,
|
38
|
+
color yellow,
|
39
|
+
(states, (
|
40
|
+
(hover, (
|
41
|
+
color blue,
|
42
|
+
nil
|
43
|
+
)),
|
44
|
+
(active, (
|
45
|
+
color green,
|
46
|
+
width 100%
|
47
|
+
)),
|
48
|
+
nil
|
49
|
+
))
|
50
|
+
)),
|
51
|
+
(dropped3, (
|
52
|
+
color purple,
|
53
|
+
(states, (
|
54
|
+
drop hover, // TODO: this is currently throwing an ambiguous warning, need to investigate
|
55
|
+
nil
|
56
|
+
)),
|
57
|
+
nil
|
58
|
+
)),
|
59
|
+
(dropped4, (
|
60
|
+
color purple,
|
61
|
+
(states, (
|
62
|
+
(hover, (
|
63
|
+
drop selectors,
|
64
|
+
nil
|
65
|
+
)),
|
66
|
+
nil
|
67
|
+
))
|
68
|
+
)),
|
69
|
+
nil
|
70
|
+
), $CONFIG_THEME);
|
71
|
+
}
|
72
|
+
|
73
|
+
.dropping-styles-test {
|
74
|
+
/* should contain hover state and .test selector */
|
75
|
+
@include styleguide(dropping-styles-test);
|
76
|
+
&.parent {
|
77
|
+
/* should contain hover state and .test selector */
|
78
|
+
@include styleguide(parent dropping-styles-test);
|
79
|
+
}
|
80
|
+
&.heir {
|
81
|
+
/* should contain hover state and .test selector */
|
82
|
+
@include styleguide(heir dropping-styles-test);
|
83
|
+
}
|
84
|
+
&.dropped {
|
85
|
+
/* should only contain color:yellow */
|
86
|
+
@include styleguide(dropped dropping-styles-test);
|
87
|
+
}
|
88
|
+
&.dropped2 {
|
89
|
+
/* should contain color:yellow, custom :hover, :active */
|
90
|
+
@include styleguide(dropped2 dropping-styles-test);
|
91
|
+
}
|
92
|
+
&.dropped3 {
|
93
|
+
/* should only contain color:purple */
|
94
|
+
@include styleguide(dropped3 dropping-styles-test);
|
95
|
+
}
|
96
|
+
// TODO fix this guy: drops nested multiple levels deep don't resolve yet :(
|
97
|
+
//&.dropped4 {
|
98
|
+
// /* should contain color:purple, :hover, but no `.test` selector */
|
99
|
+
// @include styleguide(dropped4 dropping-styles-test);
|
100
|
+
//}
|
101
|
+
}
|