@madgex/design-system 1.0.1
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.
- package/.env-example +1 -0
- package/.eslintignore +2 -0
- package/.eslintrc.js +6 -0
- package/.prettierignore +3 -0
- package/.prettierrc +7 -0
- package/.vscode/launch.json +19 -0
- package/README.md +112 -0
- package/babel.config.js +12 -0
- package/commitlint.config.js +1 -0
- package/delivery/jenkinsfile +100 -0
- package/docs/01-index.njk +11 -0
- package/docs/tokens/colour.njk +43 -0
- package/docs/tokens/spacing.njk +5 -0
- package/fractal-theme/assets/css/styles.css +41 -0
- package/fractal.js +80 -0
- package/gulpfile.js +30 -0
- package/package.json +56 -0
- package/src/components/Button/_macro.njk +3 -0
- package/src/components/Button/_template.njk +35 -0
- package/src/components/Button/button.config.js +22 -0
- package/src/components/Button/button.njk +7 -0
- package/src/components/Button/button.scss +36 -0
- package/src/components/_preview.njk +16 -0
- package/src/core/functions/__index.scss +1 -0
- package/src/core/functions/_color.scss +0 -0
- package/src/core/helpers/__index.scss +11 -0
- package/src/core/helpers/_media-queries.scss +21 -0
- package/src/core/index.scss +31 -0
- package/src/core/utilities/__index.scss +3 -0
- package/src/core/utilities/_clearfix.scss +7 -0
- package/src/core/utilities/_mixins.scss +13 -0
- package/src/core/utilities/_visually-hidden.scss +20 -0
- package/src/core/vendor/_sass-mq.scss +360 -0
- package/src/patterns/form/form.njk +2 -0
- package/tasks/css.js +18 -0
- package/tasks/fractal.js +29 -0
- package/tasks/tokens.js +9 -0
- package/tokens/_config.js +159 -0
- package/tokens/color.json +24 -0
- package/tokens/font.json +9 -0
- package/tokens/size.json +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'color';
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@import 'media-queries';
|
|
2
|
+
|
|
3
|
+
// $font-sizes: tokens('size-font');
|
|
4
|
+
|
|
5
|
+
// @function font-size($key: 'base', $isMobile: null) {
|
|
6
|
+
// @if $isMobile == null {
|
|
7
|
+
// @return map-get($font-sizes, $key);
|
|
8
|
+
// } @else {
|
|
9
|
+
// @return map-get($font-sizes-mobile, $key);
|
|
10
|
+
// }
|
|
11
|
+
// }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Pass our breakpoints and static breakpoint definitions through to sass-mq.
|
|
2
|
+
$mq-breakpoints: (
|
|
3
|
+
mobile: $mds-size-breakpoint-sm,
|
|
4
|
+
tablet: $mds-size-breakpoint-md,
|
|
5
|
+
desktop: $mds-size-breakpoint-lg
|
|
6
|
+
) !default;
|
|
7
|
+
|
|
8
|
+
// This is a horrible, horrible hack to prevent the 'dev mode' CSS to display
|
|
9
|
+
// the current breakpoint from being included multiple times.
|
|
10
|
+
//
|
|
11
|
+
// We can't use the `exports` mixin for this because import directives cannot be
|
|
12
|
+
// used within control directives ðŸ˜
|
|
13
|
+
$sass-mq-already-included: false !default;
|
|
14
|
+
|
|
15
|
+
@if $sass-mq-already-included {
|
|
16
|
+
$mq-show-breakpoints: ();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@import '../vendor/sass-mq';
|
|
20
|
+
|
|
21
|
+
$sass-mq-already-included: true;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@import '../../tokens/build/scss/variables';
|
|
2
|
+
@import 'functions/_index';
|
|
3
|
+
@import 'utilities/_index';
|
|
4
|
+
@import 'helpers/_index';
|
|
5
|
+
|
|
6
|
+
// body {
|
|
7
|
+
// color: $mds-color-base;
|
|
8
|
+
// font-family: $mds-font-family-base;
|
|
9
|
+
|
|
10
|
+
// @include mq($from: mobile) {
|
|
11
|
+
// background-color: $mds-color-primary;
|
|
12
|
+
// }
|
|
13
|
+
// @include mq($until: tablet) {
|
|
14
|
+
// background-color: $mds-color-secondary;
|
|
15
|
+
// }
|
|
16
|
+
// }
|
|
17
|
+
|
|
18
|
+
*,
|
|
19
|
+
*::before,
|
|
20
|
+
*::after {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
body {
|
|
25
|
+
font-family: $mds-font-family-base;
|
|
26
|
+
font-size: $mds-size-font-md;
|
|
27
|
+
color: color('base');
|
|
28
|
+
overflow-x: hidden;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@import '../components/button/button';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Used to prevent text selection on an element
|
|
2
|
+
@mixin mds-prevent-user-select {
|
|
3
|
+
-webkit-user-select: none;
|
|
4
|
+
-moz-user-select: none;
|
|
5
|
+
user-select: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@mixin mds-focusable {
|
|
9
|
+
&:focus {
|
|
10
|
+
outline: $mds-size-focus-width solid $mds-size-focus-width;
|
|
11
|
+
outline-offset: 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@mixin mds-visually-hidden() {
|
|
2
|
+
position: absolute;
|
|
3
|
+
|
|
4
|
+
width: 1px;
|
|
5
|
+
height: 1px;
|
|
6
|
+
// If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
clip: rect(0 0 0 0);
|
|
12
|
+
clip-path: inset(50%);
|
|
13
|
+
|
|
14
|
+
border: 0;
|
|
15
|
+
|
|
16
|
+
// For long content, line feeds are not interpreted as spaces and small width
|
|
17
|
+
// causes content to wrap 1 word per line:
|
|
18
|
+
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
// sass-lint:disable-all
|
|
2
|
+
|
|
3
|
+
@charset "UTF-8"; // Fixes an issue where Ruby locale is not set properly
|
|
4
|
+
// See https://github.com/sass-mq/sass-mq/pull/10
|
|
5
|
+
|
|
6
|
+
/// Base font size on the `<body>` element
|
|
7
|
+
/// @type Number (unit)
|
|
8
|
+
$mq-base-font-size: 16px !default;
|
|
9
|
+
|
|
10
|
+
/// Responsive mode
|
|
11
|
+
///
|
|
12
|
+
/// Set to `false` to enable support for browsers that do not support @media queries,
|
|
13
|
+
/// (IE <= 8, Firefox <= 3, Opera <= 9)
|
|
14
|
+
///
|
|
15
|
+
/// You could create a stylesheet served exclusively to older browsers,
|
|
16
|
+
/// where @media queries are rasterized
|
|
17
|
+
///
|
|
18
|
+
/// @example scss
|
|
19
|
+
/// // old-ie.scss
|
|
20
|
+
/// $mq-responsive: false;
|
|
21
|
+
/// @import 'main'; // @media queries in this file will be rasterized up to $mq-static-breakpoint
|
|
22
|
+
/// // larger breakpoints will be ignored
|
|
23
|
+
///
|
|
24
|
+
/// @type Boolean
|
|
25
|
+
/// @link https://github.com/sass-mq/sass-mq#responsive-mode-off Disabled responsive mode documentation
|
|
26
|
+
$mq-responsive: true !default;
|
|
27
|
+
|
|
28
|
+
/// Breakpoint list
|
|
29
|
+
///
|
|
30
|
+
/// Name your breakpoints in a way that creates a ubiquitous language
|
|
31
|
+
/// across team members. It will improve communication between
|
|
32
|
+
/// stakeholders, designers, developers, and testers.
|
|
33
|
+
///
|
|
34
|
+
/// @type Map
|
|
35
|
+
/// @link https://github.com/sass-mq/sass-mq#seeing-the-currently-active-breakpoint Full documentation and examples
|
|
36
|
+
$mq-breakpoints: (
|
|
37
|
+
mobile: 320px,
|
|
38
|
+
tablet: 740px,
|
|
39
|
+
desktop: 980px,
|
|
40
|
+
wide: 1300px
|
|
41
|
+
) !default;
|
|
42
|
+
|
|
43
|
+
/// Static breakpoint (for fixed-width layouts)
|
|
44
|
+
///
|
|
45
|
+
/// Define the breakpoint from $mq-breakpoints that should
|
|
46
|
+
/// be used as the target width for the fixed-width layout
|
|
47
|
+
/// (i.e. when $mq-responsive is set to 'false') in a old-ie.scss
|
|
48
|
+
///
|
|
49
|
+
/// @example scss
|
|
50
|
+
/// // tablet-only.scss
|
|
51
|
+
/// //
|
|
52
|
+
/// // Ignore all styles above tablet breakpoint,
|
|
53
|
+
/// // and fix the styles (e.g. layout) at tablet width
|
|
54
|
+
/// $mq-responsive: false;
|
|
55
|
+
/// $mq-static-breakpoint: tablet;
|
|
56
|
+
/// @import 'main'; // @media queries in this file will be rasterized up to tablet
|
|
57
|
+
/// // larger breakpoints will be ignored
|
|
58
|
+
///
|
|
59
|
+
/// @type String
|
|
60
|
+
/// @link https://github.com/sass-mq/sass-mq#adding-custom-breakpoints Full documentation and examples
|
|
61
|
+
$mq-static-breakpoint: desktop !default;
|
|
62
|
+
|
|
63
|
+
/// Show breakpoints in the top right corner
|
|
64
|
+
///
|
|
65
|
+
/// If you want to display the currently active breakpoint in the top
|
|
66
|
+
/// right corner of your site during development, add the breakpoints
|
|
67
|
+
/// to this list, ordered by width, e.g. (mobile, tablet, desktop).
|
|
68
|
+
///
|
|
69
|
+
/// @type map
|
|
70
|
+
$mq-show-breakpoints: () !default;
|
|
71
|
+
|
|
72
|
+
/// Customize the media type (e.g. `@media screen` or `@media print`)
|
|
73
|
+
/// By default sass-mq uses an "all" media type (`@media all and …`)
|
|
74
|
+
///
|
|
75
|
+
/// @type String
|
|
76
|
+
/// @link https://github.com/sass-mq/sass-mq#changing-media-type Full documentation and examples
|
|
77
|
+
$mq-media-type: all !default;
|
|
78
|
+
|
|
79
|
+
/// Convert pixels to ems
|
|
80
|
+
///
|
|
81
|
+
/// @param {Number} $px - value to convert
|
|
82
|
+
/// @param {Number} $base-font-size ($mq-base-font-size) - `<body>` font size
|
|
83
|
+
///
|
|
84
|
+
/// @example scss
|
|
85
|
+
/// $font-size-in-ems: mq-px2em(16px);
|
|
86
|
+
/// p { font-size: mq-px2em(16px); }
|
|
87
|
+
///
|
|
88
|
+
/// @requires $mq-base-font-size
|
|
89
|
+
/// @returns {Number}
|
|
90
|
+
@function mq-px2em($px, $base-font-size: $mq-base-font-size) {
|
|
91
|
+
@if unitless($px) {
|
|
92
|
+
@warn "Assuming #{$px} to be in pixels, attempting to convert it into pixels.";
|
|
93
|
+
@return mq-px2em($px * 1px, $base-font-size);
|
|
94
|
+
} @else if unit($px) == em {
|
|
95
|
+
@return $px;
|
|
96
|
+
}
|
|
97
|
+
@return ($px / $base-font-size) * 1em;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/// Get a breakpoint's width
|
|
101
|
+
///
|
|
102
|
+
/// @param {String} $name - Name of the breakpoint. One of $mq-breakpoints
|
|
103
|
+
///
|
|
104
|
+
/// @example scss
|
|
105
|
+
/// $tablet-width: mq-get-breakpoint-width(tablet);
|
|
106
|
+
/// @media (min-width: mq-get-breakpoint-width(desktop)) {}
|
|
107
|
+
///
|
|
108
|
+
/// @requires {Variable} $mq-breakpoints
|
|
109
|
+
///
|
|
110
|
+
/// @returns {Number} Value in pixels
|
|
111
|
+
@function mq-get-breakpoint-width($name, $breakpoints: $mq-breakpoints) {
|
|
112
|
+
@if map-has-key($breakpoints, $name) {
|
|
113
|
+
@return map-get($breakpoints, $name);
|
|
114
|
+
} @else {
|
|
115
|
+
@warn "Breakpoint #{$name} wasn't found in $breakpoints.";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/// Media Query mixin
|
|
120
|
+
///
|
|
121
|
+
/// @param {String | Boolean} $from (false) - One of $mq-breakpoints
|
|
122
|
+
/// @param {String | Boolean} $until (false) - One of $mq-breakpoints
|
|
123
|
+
/// @param {String | Boolean} $and (false) - Additional media query parameters
|
|
124
|
+
/// @param {String} $media-type ($mq-media-type) - Media type: screen, print…
|
|
125
|
+
///
|
|
126
|
+
/// @ignore Undocumented API, for advanced use only:
|
|
127
|
+
/// @ignore @param {Map} $breakpoints ($mq-breakpoints)
|
|
128
|
+
/// @ignore @param {String} $static-breakpoint ($mq-static-breakpoint)
|
|
129
|
+
///
|
|
130
|
+
/// @content styling rules, wrapped into a @media query when $responsive is true
|
|
131
|
+
///
|
|
132
|
+
/// @requires {Variable} $mq-media-type
|
|
133
|
+
/// @requires {Variable} $mq-breakpoints
|
|
134
|
+
/// @requires {Variable} $mq-static-breakpoint
|
|
135
|
+
/// @requires {function} mq-px2em
|
|
136
|
+
/// @requires {function} mq-get-breakpoint-width
|
|
137
|
+
///
|
|
138
|
+
/// @link https://github.com/sass-mq/sass-mq#responsive-mode-on-default Full documentation and examples
|
|
139
|
+
///
|
|
140
|
+
/// @example scss
|
|
141
|
+
/// .element {
|
|
142
|
+
/// @include mq($from: mobile) {
|
|
143
|
+
/// color: red;
|
|
144
|
+
/// }
|
|
145
|
+
/// @include mq($until: tablet) {
|
|
146
|
+
/// color: blue;
|
|
147
|
+
/// }
|
|
148
|
+
/// @include mq(mobile, tablet) {
|
|
149
|
+
/// color: green;
|
|
150
|
+
/// }
|
|
151
|
+
/// @include mq($from: tablet, $and: '(orientation: landscape)') {
|
|
152
|
+
/// color: teal;
|
|
153
|
+
/// }
|
|
154
|
+
/// @include mq(950px) {
|
|
155
|
+
/// color: hotpink;
|
|
156
|
+
/// }
|
|
157
|
+
/// @include mq(tablet, $media-type: screen) {
|
|
158
|
+
/// color: hotpink;
|
|
159
|
+
/// }
|
|
160
|
+
/// // Advanced use:
|
|
161
|
+
/// $my-breakpoints: (L: 900px, XL: 1200px);
|
|
162
|
+
/// @include mq(L, $breakpoints: $my-breakpoints, $static-breakpoint: L) {
|
|
163
|
+
/// color: hotpink;
|
|
164
|
+
/// }
|
|
165
|
+
/// }
|
|
166
|
+
@mixin mq(
|
|
167
|
+
$from: false,
|
|
168
|
+
$until: false,
|
|
169
|
+
$and: false,
|
|
170
|
+
$media-type: $mq-media-type,
|
|
171
|
+
$breakpoints: $mq-breakpoints,
|
|
172
|
+
$responsive: $mq-responsive,
|
|
173
|
+
$static-breakpoint: $mq-static-breakpoint
|
|
174
|
+
) {
|
|
175
|
+
$min-width: 0;
|
|
176
|
+
$max-width: 0;
|
|
177
|
+
$media-query: '';
|
|
178
|
+
|
|
179
|
+
// From: this breakpoint (inclusive)
|
|
180
|
+
@if $from {
|
|
181
|
+
@if type-of($from) == number {
|
|
182
|
+
$min-width: mq-px2em($from);
|
|
183
|
+
} @else {
|
|
184
|
+
$min-width: mq-px2em(mq-get-breakpoint-width($from, $breakpoints));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Until: that breakpoint (exclusive)
|
|
189
|
+
@if $until {
|
|
190
|
+
@if type-of($until) == number {
|
|
191
|
+
$max-width: mq-px2em($until);
|
|
192
|
+
} @else {
|
|
193
|
+
$max-width: mq-px2em(mq-get-breakpoint-width($until, $breakpoints)) - 0.01em;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Responsive support is disabled, rasterize the output outside @media blocks
|
|
198
|
+
// The browser will rely on the cascade itself.
|
|
199
|
+
@if $responsive == false {
|
|
200
|
+
$static-breakpoint-width: mq-get-breakpoint-width($static-breakpoint, $breakpoints);
|
|
201
|
+
$target-width: mq-px2em($static-breakpoint-width);
|
|
202
|
+
|
|
203
|
+
// Output only rules that start at or span our target width
|
|
204
|
+
@if (
|
|
205
|
+
$and ==
|
|
206
|
+
false and
|
|
207
|
+
$min-width <=
|
|
208
|
+
$target-width and
|
|
209
|
+
($until == false or $max-width >= $target-width) and
|
|
210
|
+
$media-type !=
|
|
211
|
+
'print'
|
|
212
|
+
) {
|
|
213
|
+
@content;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Responsive support is enabled, output rules inside @media queries
|
|
218
|
+
@else {
|
|
219
|
+
@if $min-width != 0 {
|
|
220
|
+
$media-query: '#{$media-query} and (min-width: #{$min-width})';
|
|
221
|
+
}
|
|
222
|
+
@if $max-width != 0 {
|
|
223
|
+
$media-query: '#{$media-query} and (max-width: #{$max-width})';
|
|
224
|
+
}
|
|
225
|
+
@if $and {
|
|
226
|
+
$media-query: '#{$media-query} and #{$and}';
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Remove unnecessary media query prefix 'all and '
|
|
230
|
+
@if ($media-type == 'all' and $media-query != '') {
|
|
231
|
+
$media-type: '';
|
|
232
|
+
$media-query: str-slice(unquote($media-query), 6);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@media #{$media-type + $media-query} {
|
|
236
|
+
@content;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/// Quick sort
|
|
242
|
+
///
|
|
243
|
+
/// @author Sam Richards
|
|
244
|
+
/// @access private
|
|
245
|
+
/// @param {List} $list - List to sort
|
|
246
|
+
/// @returns {List} Sorted List
|
|
247
|
+
@function _mq-quick-sort($list) {
|
|
248
|
+
$less: ();
|
|
249
|
+
$equal: ();
|
|
250
|
+
$large: ();
|
|
251
|
+
|
|
252
|
+
@if length($list) > 1 {
|
|
253
|
+
$seed: nth($list, ceil(length($list) / 2));
|
|
254
|
+
|
|
255
|
+
@each $item in $list {
|
|
256
|
+
@if ($item == $seed) {
|
|
257
|
+
$equal: append($equal, $item);
|
|
258
|
+
} @else if ($item < $seed) {
|
|
259
|
+
$less: append($less, $item);
|
|
260
|
+
} @else if ($item > $seed) {
|
|
261
|
+
$large: append($large, $item);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@return join(join(_mq-quick-sort($less), $equal), _mq-quick-sort($large));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@return $list;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/// Sort a map by values (works with numbers only)
|
|
272
|
+
///
|
|
273
|
+
/// @access private
|
|
274
|
+
/// @param {Map} $map - Map to sort
|
|
275
|
+
/// @returns {Map} Map sorted by value
|
|
276
|
+
@function _mq-map-sort-by-value($map) {
|
|
277
|
+
$map-sorted: ();
|
|
278
|
+
$map-keys: map-keys($map);
|
|
279
|
+
$map-values: map-values($map);
|
|
280
|
+
$map-values-sorted: _mq-quick-sort($map-values);
|
|
281
|
+
|
|
282
|
+
// Reorder key/value pairs based on key values
|
|
283
|
+
@each $value in $map-values-sorted {
|
|
284
|
+
$index: index($map-values, $value);
|
|
285
|
+
$key: nth($map-keys, $index);
|
|
286
|
+
$map-sorted: map-merge(
|
|
287
|
+
$map-sorted,
|
|
288
|
+
(
|
|
289
|
+
$key: $value
|
|
290
|
+
)
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
// Unset the value in $map-values to prevent the loop
|
|
294
|
+
// from finding the same index twice
|
|
295
|
+
$map-values: set-nth($map-values, $index, 0);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@return $map-sorted;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/// Add a breakpoint
|
|
302
|
+
///
|
|
303
|
+
/// @param {String} $name - Name of the breakpoint
|
|
304
|
+
/// @param {Number} $width - Width of the breakpoint
|
|
305
|
+
///
|
|
306
|
+
/// @requires {Variable} $mq-breakpoints
|
|
307
|
+
///
|
|
308
|
+
/// @example scss
|
|
309
|
+
/// @include mq-add-breakpoint(tvscreen, 1920px);
|
|
310
|
+
/// @include mq(tvscreen) {}
|
|
311
|
+
@mixin mq-add-breakpoint($name, $width) {
|
|
312
|
+
$new-breakpoint: (
|
|
313
|
+
$name: $width
|
|
314
|
+
);
|
|
315
|
+
$mq-breakpoints: map-merge($mq-breakpoints, $new-breakpoint) !global;
|
|
316
|
+
$mq-breakpoints: _mq-map-sort-by-value($mq-breakpoints) !global;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/// Show the active breakpoint in the top right corner of the viewport
|
|
320
|
+
/// @link https://github.com/sass-mq/sass-mq#seeing-the-currently-active-breakpoint
|
|
321
|
+
///
|
|
322
|
+
/// @param {List} $show-breakpoints ($mq-show-breakpoints) - List of breakpoints to show in the top right corner
|
|
323
|
+
/// @param {Map} $breakpoints ($mq-breakpoints) - Breakpoint names and sizes
|
|
324
|
+
///
|
|
325
|
+
/// @requires {Variable} $mq-breakpoints
|
|
326
|
+
/// @requires {Variable} $mq-show-breakpoints
|
|
327
|
+
///
|
|
328
|
+
/// @example scss
|
|
329
|
+
/// // Show breakpoints using global settings
|
|
330
|
+
/// @include mq-show-breakpoints;
|
|
331
|
+
///
|
|
332
|
+
/// // Show breakpoints using custom settings
|
|
333
|
+
/// @include mq-show-breakpoints((L, XL), (S: 300px, L: 800px, XL: 1200px));
|
|
334
|
+
@mixin mq-show-breakpoints($show-breakpoints: $mq-show-breakpoints, $breakpoints: $mq-breakpoints) {
|
|
335
|
+
body:before {
|
|
336
|
+
background-color: #fcf8e3;
|
|
337
|
+
border-bottom: 1px solid #fbeed5;
|
|
338
|
+
border-left: 1px solid #fbeed5;
|
|
339
|
+
color: #c09853;
|
|
340
|
+
font: small-caption;
|
|
341
|
+
padding: 3px 6px;
|
|
342
|
+
pointer-events: none;
|
|
343
|
+
position: fixed;
|
|
344
|
+
right: 0;
|
|
345
|
+
top: 0;
|
|
346
|
+
z-index: 100;
|
|
347
|
+
|
|
348
|
+
// Loop through the breakpoints that should be shown
|
|
349
|
+
@each $show-breakpoint in $show-breakpoints {
|
|
350
|
+
$width: mq-get-breakpoint-width($show-breakpoint, $breakpoints);
|
|
351
|
+
@include mq($show-breakpoint, $breakpoints: $breakpoints) {
|
|
352
|
+
content: '#{$show-breakpoint} ≥ #{$width} (#{mq-px2em($width)})';
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
@if length($mq-show-breakpoints) > 0 {
|
|
359
|
+
@include mq-show-breakpoints;
|
|
360
|
+
}
|
package/tasks/css.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const gulp = require('gulp');
|
|
2
|
+
const sass = require('gulp-sass');
|
|
3
|
+
|
|
4
|
+
function css() {
|
|
5
|
+
return gulp
|
|
6
|
+
.src(['./src/core/index.scss'])
|
|
7
|
+
.pipe(
|
|
8
|
+
sass.sync({
|
|
9
|
+
outputStyle: 'expanded',
|
|
10
|
+
precision: 10,
|
|
11
|
+
includePaths: ['./node_modules'],
|
|
12
|
+
})
|
|
13
|
+
)
|
|
14
|
+
.on('error', sass.logError)
|
|
15
|
+
.pipe(gulp.dest('dist/css'));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.css = css;
|
package/tasks/fractal.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const fractal = require('../fractal.js');
|
|
2
|
+
// import the Fractal instance configured in the fractal.js file
|
|
3
|
+
const logger = fractal.cli.console; // make use of Fractal's console object for logging
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* An example of a Gulp task that starts a Fractal development server.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function fractalStart() {
|
|
10
|
+
const server = fractal.web.server({
|
|
11
|
+
sync: true,
|
|
12
|
+
});
|
|
13
|
+
server.on('error', (err) => logger.error(err.message));
|
|
14
|
+
return server.start().then(() => {
|
|
15
|
+
return logger.success(`Fractal server is now running at ${server.urls.sync.local}`);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function fractalBuild() {
|
|
20
|
+
const builder = fractal.web.builder();
|
|
21
|
+
builder.on('progress', (completed, total) => logger.update(`Exported ${completed} of ${total} items`, 'info'));
|
|
22
|
+
builder.on('error', (err) => logger.error(err.message));
|
|
23
|
+
return builder.build().then(() => {
|
|
24
|
+
return logger.success('Fractal build completed!');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.fractalStart = fractalStart;
|
|
29
|
+
exports.fractalBuild = fractalBuild;
|
package/tasks/tokens.js
ADDED