@ulu/frontend 0.1.0-beta.5 → 0.1.0-beta.50
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/CHANGELOG.md +382 -0
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +28 -27
- package/docs-dev/assets/main.js +832 -421
- package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
- package/docs-dev/assets/placeholder/icon-check.svg +1 -0
- package/docs-dev/assets/style.css +629 -233
- package/docs-dev/changelog/index.html +0 -0
- package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
- package/docs-dev/demos/accordion/index.html +0 -4809
- package/docs-dev/demos/basic-hero/index.html +0 -0
- package/docs-dev/demos/breakpoints-manager/index.html +0 -0
- package/docs-dev/demos/button/index.html +0 -4621
- package/docs-dev/demos/button-verbose/index.html +0 -0
- package/docs-dev/demos/callout/index.html +0 -4661
- package/docs-dev/demos/captioned-figure/index.html +0 -4683
- package/docs-dev/demos/card/index.html +0 -5040
- package/docs-dev/demos/card-grid/index.html +0 -0
- package/docs-dev/demos/card-new/index.html +5088 -0
- package/docs-dev/demos/card-old/index.html +5223 -0
- package/docs-dev/demos/card.1/index.html +5223 -0
- package/docs-dev/demos/card.TRASH/index.html +5541 -0
- package/docs-dev/demos/counter-list/index.html +0 -0
- package/docs-dev/demos/css-icons/index.html +0 -5272
- package/docs-dev/demos/data-grid/index.html +0 -5606
- package/docs-dev/demos/data-table/index.html +0 -4697
- package/docs-dev/demos/details-group/index.html +0 -0
- package/docs-dev/demos/file-save/index.html +0 -4672
- package/docs-dev/demos/flipcard/index.html +0 -5221
- package/docs-dev/demos/form-theme/index.html +0 -4852
- package/docs-dev/demos/hero/index.html +0 -301
- package/docs-dev/demos/image-grid/index.html +0 -157
- package/docs-dev/demos/index.html +0 -4610
- package/docs-dev/demos/list-inline/index.html +0 -0
- package/docs-dev/demos/list-inline.1/index.html +4727 -0
- package/docs-dev/demos/list-lines/index.html +0 -0
- package/docs-dev/demos/menu-stack/index.html +0 -4751
- package/docs-dev/demos/modals/index.html +0 -4718
- package/docs-dev/demos/nav-strip/index.html +0 -4722
- package/docs-dev/demos/overlay-section/index.html +0 -4628
- package/docs-dev/demos/popovers/index.html +0 -4628
- package/docs-dev/demos/print/index.html +0 -4630
- package/docs-dev/demos/pull-quote/index.html +0 -4629
- package/docs-dev/demos/rule/index.html +0 -4679
- package/docs-dev/demos/scroll-slider/index.html +0 -204
- package/docs-dev/demos/scrollpoints/index.html +0 -4648
- package/docs-dev/demos/slider/index.html +0 -164
- package/docs-dev/demos/spoke-spinner/index.html +0 -4625
- package/docs-dev/demos/sticky-list/index.html +0 -0
- package/docs-dev/demos/tabs/index.html +0 -4714
- package/docs-dev/demos/tag/index.html +0 -4630
- package/docs-dev/demos/theme-toggle/index.html +0 -0
- package/docs-dev/demos/tile-grid-overlay/index.html +0 -382
- package/docs-dev/demos/tiles/index.html +0 -4879
- package/docs-dev/demos/tooltip/index.html +0 -4658
- package/docs-dev/guide/building-stylesheet/index.html +0 -4679
- package/docs-dev/guide/developing-ulu-scss-module/index.html +0 -4731
- package/docs-dev/guide/index.html +0 -4612
- package/docs-dev/guide/updates-and-changes/index.html +5033 -0
- package/docs-dev/index.html +0 -4659
- package/docs-dev/javascript/events/index.html +0 -4770
- package/docs-dev/javascript/index.html +0 -4625
- package/docs-dev/javascript/settings/index.html +0 -0
- package/docs-dev/javascript/ui-breakpoints/index.html +0 -5070
- package/docs-dev/javascript/ui-collapsible/index.html +0 -4737
- package/docs-dev/javascript/ui-details-group/index.html +0 -0
- package/docs-dev/javascript/ui-dialog/index.html +0 -4771
- package/docs-dev/javascript/ui-flipcard/index.html +0 -4621
- package/docs-dev/javascript/ui-grid/index.html +0 -4678
- package/docs-dev/javascript/ui-modal-builder/index.html +0 -4760
- package/docs-dev/javascript/ui-overflow-scroller/index.html +0 -4610
- package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +0 -4628
- package/docs-dev/javascript/ui-page/index.html +0 -4625
- package/docs-dev/javascript/ui-popover/index.html +0 -4664
- package/docs-dev/javascript/ui-print/index.html +0 -4677
- package/docs-dev/javascript/ui-print-details/index.html +0 -4640
- package/docs-dev/javascript/ui-programmatic-modal/index.html +0 -4610
- package/docs-dev/javascript/ui-proxy-click/index.html +990 -324
- package/docs-dev/javascript/ui-resizer/index.html +901 -320
- package/docs-dev/javascript/ui-scroll-slider/index.html +0 -4639
- package/docs-dev/javascript/ui-scrollpoint/index.html +0 -4857
- package/docs-dev/javascript/ui-slider/index.html +1099 -327
- package/docs-dev/javascript/ui-tabs/index.html +914 -370
- package/docs-dev/javascript/ui-theme-toggle/index.html +5410 -0
- package/docs-dev/javascript/ui-tooltip/index.html +940 -363
- package/docs-dev/javascript/utils-class-logger/index.html +901 -320
- package/docs-dev/javascript/utils-css/index.html +5224 -0
- package/docs-dev/javascript/utils-dom/index.html +1054 -339
- package/docs-dev/javascript/utils-file-save/index.html +901 -320
- package/docs-dev/javascript/utils-floating-ui/index.html +901 -320
- package/docs-dev/javascript/utils-id/index.html +901 -320
- package/docs-dev/javascript/utils-pause-youtube-video/index.html +901 -320
- package/docs-dev/javascript/utils-system/index.html +5527 -0
- package/docs-dev/sass/base/color/index.html +0 -4643
- package/docs-dev/sass/base/elements/index.html +0 -4814
- package/docs-dev/sass/base/index/index.html +0 -4813
- package/docs-dev/sass/base/index.html +0 -4619
- package/docs-dev/sass/base/keyframes/index.html +0 -4645
- package/docs-dev/sass/base/layout/index.html +0 -4805
- package/docs-dev/sass/base/normalize/index.html +0 -4653
- package/docs-dev/sass/base/print/index.html +0 -4649
- package/docs-dev/sass/base/root/index.html +0 -4669
- package/docs-dev/sass/base/typography/index.html +0 -4669
- package/docs-dev/sass/components/accordion/index.html +0 -4971
- package/docs-dev/sass/components/adaptive-spacing/index.html +0 -4914
- package/docs-dev/sass/components/badge/index.html +0 -4862
- package/docs-dev/sass/components/basic-hero/index.html +0 -0
- package/docs-dev/sass/components/button/index.html +0 -4798
- package/docs-dev/sass/components/button-verbose/index.html +0 -4910
- package/docs-dev/sass/components/callout/index.html +0 -4937
- package/docs-dev/sass/components/captioned-figure/index.html +0 -4788
- package/docs-dev/sass/components/card/index.html +0 -5146
- package/docs-dev/sass/components/card-grid/index.html +0 -4812
- package/docs-dev/sass/components/counter-list/index.html +0 -0
- package/docs-dev/sass/components/css-icon/index.html +0 -4909
- package/docs-dev/sass/components/data-grid/index.html +0 -5044
- package/docs-dev/sass/components/data-table/index.html +0 -4795
- package/docs-dev/sass/components/fill-context/index.html +0 -4678
- package/docs-dev/sass/components/flipcard/index.html +0 -4948
- package/docs-dev/sass/components/flipcard-grid/index.html +0 -4799
- package/docs-dev/sass/components/form-theme/index.html +0 -5428
- package/docs-dev/sass/components/hero/index.html +0 -4800
- package/docs-dev/sass/components/horizontal-rule/index.html +0 -4797
- package/docs-dev/sass/components/image-grid/index.html +0 -4804
- package/docs-dev/sass/components/index/index.html +0 -4848
- package/docs-dev/sass/components/index.html +0 -4619
- package/docs-dev/sass/components/links/index.html +0 -4648
- package/docs-dev/sass/components/list-inline/index.html +0 -0
- package/docs-dev/sass/components/list-lines/index.html +0 -4843
- package/docs-dev/sass/components/list-ordered/index.html +0 -4644
- package/docs-dev/sass/components/list-unordered/index.html +0 -4648
- package/docs-dev/sass/components/menu-stack/index.html +0 -4978
- package/docs-dev/sass/components/modal/index.html +0 -5025
- package/docs-dev/sass/components/nav-strip/index.html +0 -4898
- package/docs-dev/sass/components/overlay-section/index.html +0 -4842
- package/docs-dev/sass/components/pager/index.html +0 -4960
- package/docs-dev/sass/components/placeholder-block/index.html +0 -4882
- package/docs-dev/sass/components/popover/index.html +0 -4957
- package/docs-dev/sass/components/pull-quote/index.html +0 -4856
- package/docs-dev/sass/components/ratio-box/index.html +0 -4802
- package/docs-dev/sass/components/rule/index.html +0 -4804
- package/docs-dev/sass/components/scroll-slider/index.html +0 -4915
- package/docs-dev/sass/components/skip-link/index.html +0 -4788
- package/docs-dev/sass/components/slider/index.html +0 -4924
- package/docs-dev/sass/components/spoke-spinner/index.html +0 -4862
- package/docs-dev/sass/components/sticky-list/index.html +0 -0
- package/docs-dev/sass/components/tabs/index.html +0 -4938
- package/docs-dev/sass/components/tag/index.html +0 -4963
- package/docs-dev/sass/components/tile-button/index.html +0 -4843
- package/docs-dev/sass/components/tile-grid/index.html +0 -4978
- package/docs-dev/sass/components/tile-grid-overlay/index.html +0 -4779
- package/docs-dev/sass/components/vignette/index.html +0 -4792
- package/docs-dev/sass/components/wysiwyg/index.html +0 -4808
- package/docs-dev/sass/core/breakpoint/index.html +0 -5401
- package/docs-dev/sass/core/button/index.html +0 -5535
- package/docs-dev/sass/core/color/index.html +0 -5385
- package/docs-dev/sass/core/cssvar/index.html +0 -5410
- package/docs-dev/sass/core/element/index.html +0 -5533
- package/docs-dev/sass/core/index.html +0 -4608
- package/docs-dev/sass/core/layout/index.html +0 -5368
- package/docs-dev/sass/core/path/index.html +0 -4777
- package/docs-dev/sass/core/selector/index.html +0 -4856
- package/docs-dev/sass/core/typography/index.html +0 -5782
- package/docs-dev/sass/core/units/index.html +0 -4815
- package/docs-dev/sass/core/utils/index.html +0 -6256
- package/docs-dev/sass/helpers/color/index.html +0 -4643
- package/docs-dev/sass/helpers/display/index.html +0 -4648
- package/docs-dev/sass/helpers/index/index.html +0 -4810
- package/docs-dev/sass/helpers/index.html +0 -4619
- package/docs-dev/sass/helpers/print/index.html +843 -292
- package/docs-dev/sass/helpers/typography/index.html +0 -4671
- package/docs-dev/sass/helpers/units/index.html +0 -4817
- package/docs-dev/sass/helpers/utilities/index.html +0 -4648
- package/docs-dev/sass/index.html +0 -4670
- package/js/index.js +1 -0
- package/js/settings.js +95 -0
- package/js/ui/breakpoints.js +19 -16
- package/js/ui/collapsible.js +8 -1
- package/js/ui/details-group.js +112 -0
- package/js/ui/dialog.js +90 -42
- package/js/ui/dialog.todo +2 -36
- package/js/ui/flipcard.js +37 -57
- package/js/ui/grid.js +15 -13
- package/js/ui/index.js +1 -0
- package/js/ui/modal-builder.js +45 -54
- package/js/ui/overflow-scroller.js +6 -4
- package/js/ui/popover.js +38 -38
- package/js/ui/print.js +16 -25
- package/js/ui/programmatic-modal.js +9 -3
- package/js/ui/proxy-click.js +50 -36
- package/js/ui/scroll-slider.js +24 -30
- package/js/ui/scrollpoint.js +28 -64
- package/js/ui/slider.js +61 -62
- package/js/ui/tabs.js +23 -36
- package/js/ui/theme-toggle.js +331 -94
- package/js/ui/tooltip.js +27 -32
- package/js/utils/css.js +13 -0
- package/js/utils/dom.js +85 -8
- package/js/utils/font-awesome.js +18 -0
- package/js/utils/index.js +2 -1
- package/js/utils/system.js +154 -0
- package/package.json +14 -8
- package/scss/_breakpoint.scss +16 -3
- package/scss/_color.scss +37 -5
- package/scss/_element.scss +94 -2
- package/scss/_layout.scss +7 -8
- package/scss/_units.scss +3 -2
- package/scss/_utils.scss +248 -13
- package/scss/components/README.todos +14 -0
- package/scss/components/_accordion.scss +18 -20
- package/scss/components/_badge.scss +3 -2
- package/scss/components/_basic-hero.scss +112 -0
- package/scss/components/_button-verbose.scss +102 -20
- package/scss/components/_callout.scss +127 -79
- package/scss/components/_captioned-figure.scss +23 -5
- package/scss/components/_card-grid.scss +1 -1
- package/scss/components/_card.scss +261 -88
- package/scss/components/_counter-list.scss +133 -0
- package/scss/components/_css-icon.scss +33 -28
- package/scss/components/_data-grid.scss +38 -9
- package/scss/components/_data-table.scss +44 -4
- package/scss/components/_flipcard.scss +21 -15
- package/scss/components/_form-theme.scss +146 -135
- package/scss/components/_hero.scss +12 -10
- package/scss/components/_index.scss +24 -0
- package/scss/components/_list-inline.scss +80 -0
- package/scss/components/_list-lines.scss +44 -33
- package/scss/components/_list-ordered.scss +0 -1
- package/scss/components/_menu-stack.scss +42 -26
- package/scss/components/_modal.scss +29 -19
- package/scss/components/_nav-strip.scss +5 -1
- package/scss/components/_overlay-section.scss +4 -6
- package/scss/components/_pager.scss +6 -6
- package/scss/components/_placeholder-block.scss +4 -4
- package/scss/components/_popover.scss +174 -73
- package/scss/components/_pull-quote.scss +13 -13
- package/scss/components/_ratio-box.scss +2 -5
- package/scss/components/_rule.scss +1 -1
- package/scss/components/_scroll-slider.scss +2 -6
- package/scss/components/_skip-link.scss +2 -1
- package/scss/components/_slider.scss +18 -38
- package/scss/components/_spoke-spinner.scss +2 -2
- package/scss/components/_sticky-list.scss +206 -0
- package/scss/components/_tabs.scss +4 -2
- package/scss/components/_tag.scss +1 -1
- package/scss/components/_vignette.scss +3 -5
- package/scss/helpers/_display.scss +15 -18
- package/scss/helpers/_print.scss +12 -7
- package/scss/helpers/_utilities.scss +42 -32
- package/types/index.d.ts +1 -0
- package/types/settings.d.ts +66 -0
- package/types/settings.d.ts.map +1 -0
- package/types/ui/breakpoints.d.ts +14 -14
- package/types/ui/breakpoints.d.ts.map +1 -1
- package/types/ui/collapsible.d.ts.map +1 -1
- package/types/ui/details-group.d.ts +38 -0
- package/types/ui/details-group.d.ts.map +1 -0
- package/types/ui/dialog.d.ts +20 -14
- package/types/ui/dialog.d.ts.map +1 -1
- package/types/ui/flipcard.d.ts +16 -10
- package/types/ui/flipcard.d.ts.map +1 -1
- package/types/ui/grid.d.ts +4 -6
- package/types/ui/grid.d.ts.map +1 -1
- package/types/ui/index.d.ts +1 -0
- package/types/ui/modal-builder.d.ts +8 -11
- package/types/ui/modal-builder.d.ts.map +1 -1
- package/types/ui/overflow-scroller.d.ts +2 -2
- package/types/ui/overflow-scroller.d.ts.map +1 -1
- package/types/ui/popover.d.ts +6 -7
- package/types/ui/popover.d.ts.map +1 -1
- package/types/ui/print.d.ts +0 -4
- package/types/ui/print.d.ts.map +1 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/proxy-click.d.ts +19 -3
- package/types/ui/proxy-click.d.ts.map +1 -1
- package/types/ui/scroll-slider.d.ts +5 -7
- package/types/ui/scroll-slider.d.ts.map +1 -1
- package/types/ui/scrollpoint.d.ts +3 -8
- package/types/ui/scrollpoint.d.ts.map +1 -1
- package/types/ui/slider.d.ts +24 -14
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts +6 -8
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +51 -7
- package/types/ui/theme-toggle.d.ts.map +1 -1
- package/types/ui/tooltip.d.ts +3 -5
- package/types/ui/tooltip.d.ts.map +1 -1
- package/types/utils/css.d.ts +11 -0
- package/types/utils/css.d.ts.map +1 -0
- package/types/utils/dom.d.ts +45 -6
- package/types/utils/dom.d.ts.map +1 -1
- package/types/utils/font-awesome.d.ts +5 -0
- package/types/utils/font-awesome.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/system.d.ts +113 -0
- package/types/utils/system.d.ts.map +1 -0
package/scss/_utils.scss
CHANGED
|
@@ -20,7 +20,7 @@ $config: (
|
|
|
20
20
|
"debug-maps": true,
|
|
21
21
|
"file-header-comments": true,
|
|
22
22
|
"responsive-change": 0.5vw,
|
|
23
|
-
"pixel-em-base" : 16px
|
|
23
|
+
"pixel-em-base" : 16px,
|
|
24
24
|
) !default;
|
|
25
25
|
|
|
26
26
|
/// Change modules $config
|
|
@@ -34,8 +34,12 @@ $config: (
|
|
|
34
34
|
|
|
35
35
|
/// Get a config option
|
|
36
36
|
/// @param {Map} $name Name of property
|
|
37
|
-
/// @
|
|
38
|
-
/// @
|
|
37
|
+
/// @compiler
|
|
38
|
+
/// @use "index" as ulu;
|
|
39
|
+
/// @example scss {compile} Example usage
|
|
40
|
+
/// .test-em-to-pixel {
|
|
41
|
+
/// width: ulu.utils-get("pixel-em-base");
|
|
42
|
+
/// }
|
|
39
43
|
|
|
40
44
|
@function get($name) {
|
|
41
45
|
@return require-map-get($config, $name, 'utils');
|
|
@@ -47,6 +51,13 @@ $config: (
|
|
|
47
51
|
/// @param {String} $key The key in the map to get value from
|
|
48
52
|
/// @param {String} $context The context of using this function for debugging help
|
|
49
53
|
/// @return {*} The value from the map
|
|
54
|
+
/// @compiler
|
|
55
|
+
/// @use "index" as ulu;
|
|
56
|
+
/// @example scss {compile} Example usage
|
|
57
|
+
/// .test-require-map {
|
|
58
|
+
/// $test-map: ("test-font-size": 12px);
|
|
59
|
+
/// font-size: ulu.utils-require-map-get($test-map, "test-font-size");
|
|
60
|
+
/// }
|
|
50
61
|
|
|
51
62
|
@function require-map-get($map, $key, $context: "unknown") {
|
|
52
63
|
// $value: map.get($map, $key);
|
|
@@ -128,24 +139,49 @@ $config: (
|
|
|
128
139
|
|
|
129
140
|
// Returns number unit info, and strips the unit
|
|
130
141
|
/// @param {String} $number Number to get meta info for
|
|
131
|
-
/// @return {Map} With properties (unit, value)
|
|
142
|
+
/// @return {Map} With properties (unit, value, invalid [true/false if not number])
|
|
132
143
|
|
|
133
|
-
@function number-info($number) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
@function number-info($number, $errors: false) {
|
|
145
|
+
|
|
146
|
+
@if (meta.type-of($number) == 'number') {
|
|
147
|
+
$is-unitless: math.is-unitless($number);
|
|
137
148
|
@return (
|
|
138
|
-
"unit": null,
|
|
139
|
-
"value": $number
|
|
149
|
+
"unit": if($is-unitless, null, math.unit($number)),
|
|
150
|
+
"value": if($is-unitless, $number, strip-unit($number)),
|
|
151
|
+
"invalid" : false
|
|
140
152
|
);
|
|
153
|
+
|
|
141
154
|
} @else {
|
|
155
|
+
@if ($errors) {
|
|
156
|
+
@error "Expected Number, got #{ meta.type-of($number) } for #{ $number }";
|
|
157
|
+
}
|
|
142
158
|
@return (
|
|
143
|
-
"unit"
|
|
144
|
-
"value":
|
|
159
|
+
"unit": null,
|
|
160
|
+
"value": $number,
|
|
161
|
+
"invalid" : true
|
|
145
162
|
);
|
|
146
163
|
}
|
|
147
164
|
}
|
|
148
165
|
|
|
166
|
+
/// Adds unit to unitless number
|
|
167
|
+
/// @param {Number} $number The unitless number to add unit to
|
|
168
|
+
/// @param {String} $unit The unit to add to number
|
|
169
|
+
/// @return {String} Number with unit attached (can't be used in maths)
|
|
170
|
+
|
|
171
|
+
@function add-unit($number, $unit) {
|
|
172
|
+
@return $number + string.unquote($unit);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/// Checks if two numbers are the same unit
|
|
176
|
+
/// @param {Number} $number
|
|
177
|
+
/// @param {String} $other-number
|
|
178
|
+
/// @return {Boolean} Whether they have the same unit type
|
|
179
|
+
// Could be made into multiple arguments in future if needed
|
|
180
|
+
|
|
181
|
+
@function units-match($number, $other-number) {
|
|
182
|
+
@return math.unit($number) == math.unit($other-number);
|
|
183
|
+
}
|
|
184
|
+
|
|
149
185
|
/// Reusable merge method
|
|
150
186
|
/// @param {Map} $original Source map
|
|
151
187
|
/// @param {Map} $changes Changes to merge into source map
|
|
@@ -448,9 +484,23 @@ $config: (
|
|
|
448
484
|
/// Strips the unit from the number
|
|
449
485
|
/// - Normally this shouldn't be needed
|
|
450
486
|
/// @link https://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass/12335841#12335841 Original source (Miriam Suzanne)
|
|
487
|
+
/// @compiler
|
|
488
|
+
/// @use "index" as ulu;
|
|
489
|
+
/// @example scss {compile} Example usage
|
|
490
|
+
/// .test {
|
|
491
|
+
/// line-height: ulu.utils-strip-unit(4rem);
|
|
492
|
+
/// }
|
|
451
493
|
|
|
452
494
|
@function strip-unit($value) {
|
|
453
|
-
@
|
|
495
|
+
@if (is-number($value)) {
|
|
496
|
+
@if (math.is-unitless($value)) {
|
|
497
|
+
@return $value;
|
|
498
|
+
} @else {
|
|
499
|
+
@return math.div($value, ($value * 0 + 1));
|
|
500
|
+
}
|
|
501
|
+
} @else {
|
|
502
|
+
@error "Expected number, got #{ $value }";
|
|
503
|
+
}
|
|
454
504
|
}
|
|
455
505
|
|
|
456
506
|
/// Calculate the size of something at a given scale (percentage/exponential)
|
|
@@ -485,4 +535,189 @@ $config: (
|
|
|
485
535
|
) {
|
|
486
536
|
#{ $property } : $value;
|
|
487
537
|
#{ $property } : calc(#{ $value } + #{ $responsive-change });
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/// Calculates the hypotenuse of a triangle
|
|
541
|
+
/// - Can be used to get length between two corners of a rectangle
|
|
542
|
+
/// @param {Number} $width The width of the triangle
|
|
543
|
+
/// @param {Number} $height The height of the triangle
|
|
544
|
+
/// @return {Number} Hypotenuse of a triangle
|
|
545
|
+
|
|
546
|
+
@function hypotenuse($width, $height) {
|
|
547
|
+
@return math.sqrt(math.pow($width, 2) + math.pow($height, 2));
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/// Get's the info about a box shadow
|
|
551
|
+
/// @param {List} $shadow The box shadow property (ie. 0 0 4px red)
|
|
552
|
+
/// @return {Map} Map with info about the shadow with the following keys (inset, offset-x, offset-y, blur, spread, color)
|
|
553
|
+
/// @throw When shadow is not type list
|
|
554
|
+
|
|
555
|
+
@function box-shadow-info($shadow) {
|
|
556
|
+
@if (meta.type-of($shadow) != "list") {
|
|
557
|
+
@error "Box shadow passed is not correct type (list)";
|
|
558
|
+
}
|
|
559
|
+
$result: (
|
|
560
|
+
"inset": false,
|
|
561
|
+
"offset-x": 0,
|
|
562
|
+
"offset-y": 0,
|
|
563
|
+
"blur": 0,
|
|
564
|
+
"spread": 0,
|
|
565
|
+
"color": null,
|
|
566
|
+
);
|
|
567
|
+
|
|
568
|
+
$number-keys: ("offset-x", "offset-y", "blur", "spread");
|
|
569
|
+
$number-index: 1;
|
|
570
|
+
|
|
571
|
+
@each $value in $shadow {
|
|
572
|
+
$type: meta.type-of($value);
|
|
573
|
+
@if $type == "color" {
|
|
574
|
+
$result: map.merge($result, ("color": $value));
|
|
575
|
+
} @else if $type == "string" and $value == inset {
|
|
576
|
+
$result: map.merge($result, ("inset": true));
|
|
577
|
+
} @else if $type == "number" and $number-index <= 4 {
|
|
578
|
+
// Add each back in by key in the order they appear
|
|
579
|
+
// if not found it's the default
|
|
580
|
+
$result: map.merge($result, (list.nth($number-keys, $number-index): $value));
|
|
581
|
+
$number-index: $number-index + 1;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
@return $result;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/// Get's the extent (how far the shadow extends past the box's edge)
|
|
589
|
+
/// - This will only work on box-shadows that have matching units for the numbers
|
|
590
|
+
/// @param {List} $shadow The box shadow property (ie. 0 0 4px red)
|
|
591
|
+
/// @param {String} $side Optionally pass the side of box to get extend for, if not specified offsets are ignored and just the extent of the shadow is passed
|
|
592
|
+
/// @return {Number} The size the shadow extends past it's box
|
|
593
|
+
|
|
594
|
+
@function box-shadow-extent($shadow, $side: null) {
|
|
595
|
+
$info: box-shadow-info($shadow);
|
|
596
|
+
$extent: map.get($info, "spread") + map.get($info, "blur");
|
|
597
|
+
$offset-x: map.get($info, "offset-x");
|
|
598
|
+
$offset-y: map.get($info, "offset-y");
|
|
599
|
+
@if (not $side) {
|
|
600
|
+
@return $extent;
|
|
601
|
+
} @else {
|
|
602
|
+
@if ($side == "top") {
|
|
603
|
+
@return $extent - $offset-y;
|
|
604
|
+
} @else if ($side == "bottom") {
|
|
605
|
+
@return $extent + $offset-y;
|
|
606
|
+
} @else if ($side == "left") {
|
|
607
|
+
@return $extent - $offset-x;
|
|
608
|
+
} @else if ($side == "right") {
|
|
609
|
+
@return $extent + $offset-x;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/// Determines if value passed is a list
|
|
615
|
+
/// @param {*} $value Value to check
|
|
616
|
+
/// @return {Boolean} Whether the item was type list
|
|
617
|
+
|
|
618
|
+
@function is-list($value) {
|
|
619
|
+
@return meta.type-of($value) == "list";
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/// Determines if value passed is a map
|
|
623
|
+
/// @param {*} $value Value to check
|
|
624
|
+
/// @return {Boolean} Whether the item was type map
|
|
625
|
+
|
|
626
|
+
@function is-map($value) {
|
|
627
|
+
@return meta.type-of($value) == "map";
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/// Determines if value passed is a number
|
|
631
|
+
/// @param {*} $value Value to check
|
|
632
|
+
/// @return {Boolean} Whether the item was type number
|
|
633
|
+
|
|
634
|
+
@function is-number($value) {
|
|
635
|
+
@return meta.type-of($value) == "number";
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/// Determines if value passed is a string
|
|
639
|
+
/// @param {*} $value Value to check
|
|
640
|
+
/// @return {Boolean} Whether the item was type string
|
|
641
|
+
|
|
642
|
+
@function is-string($value) {
|
|
643
|
+
@return meta.type-of($value) == "string";
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/// Determines if value passed is a color
|
|
647
|
+
/// @param {*} $value Value to check
|
|
648
|
+
/// @return {Boolean} Whether the item was type color
|
|
649
|
+
|
|
650
|
+
@function is-color($value) {
|
|
651
|
+
@return meta.type-of($value) == "color";
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
// /// Determines if value passed is a bool
|
|
657
|
+
// /// @param {*} $value Value to check
|
|
658
|
+
// /// @return {Boolean} Whether the item was type bool
|
|
659
|
+
|
|
660
|
+
// @function is-bool($value) {
|
|
661
|
+
// @return meta.type-of($value) == "bool";
|
|
662
|
+
// }
|
|
663
|
+
|
|
664
|
+
// /// Determines if value passed is a null
|
|
665
|
+
// /// @param {*} $value Value to check
|
|
666
|
+
// /// @return {Boolean} Whether the item was type null
|
|
667
|
+
|
|
668
|
+
// @function is-null($value) {
|
|
669
|
+
// @return meta.type-of($value) == "null";
|
|
670
|
+
// }
|
|
671
|
+
|
|
672
|
+
/// Returns true if number passed is even
|
|
673
|
+
/// - Allows unit and unitless numbers
|
|
674
|
+
/// @param {Number} $number The number to check
|
|
675
|
+
/// @return {Boolean} Whether or not it is an even number
|
|
676
|
+
|
|
677
|
+
@function is-even($number) {
|
|
678
|
+
@if (is-number($number)) {
|
|
679
|
+
@return strip-unit($number) % 2 == 0;
|
|
680
|
+
} @else {
|
|
681
|
+
@error "Expected Number, got #{ $number }";
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/// Returns true if number passed is odd
|
|
686
|
+
/// @param {Number} $number The number to check
|
|
687
|
+
/// @return {Boolean} Whether or not it is an odd number
|
|
688
|
+
|
|
689
|
+
@function is-odd($number) {
|
|
690
|
+
@return not is-even($number);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/// Always returns a map
|
|
694
|
+
/// @param {*} $value The value to check if is map
|
|
695
|
+
/// @return {Map} The $value if it was a map, else empty map
|
|
696
|
+
|
|
697
|
+
@function ensure-map($value) {
|
|
698
|
+
@return if(is-map($value), $value, ());
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/// Returns true if edge passed is an end (top/bottom)
|
|
702
|
+
/// @param {String} $edge The edge string to test
|
|
703
|
+
/// @return {Boolean} Whether the edge was an end (versus side/x-axis)
|
|
704
|
+
/// @throw If $edge is not a valid value (not top/bottom/left/right)
|
|
705
|
+
|
|
706
|
+
@function is-end($edge) {
|
|
707
|
+
@if ($edge == "top" or $edge == "bottom") {
|
|
708
|
+
@return true;
|
|
709
|
+
} @else if ($edge == "left" or $edge == "right") {
|
|
710
|
+
@return false;
|
|
711
|
+
} @else {
|
|
712
|
+
@error "Expected side to be top/bottom/left/right, got #{ $edge }";
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/// Returns true if edge passed is an side (left/right)
|
|
717
|
+
/// @param {String} $edge The edge string to test
|
|
718
|
+
/// @return {Boolean} Whether the edge was an side (versus end/y-axis)
|
|
719
|
+
/// @throw If $edge is not a valid value (not top/bottom/left/right)
|
|
720
|
+
|
|
721
|
+
@function is-side($edge) {
|
|
722
|
+
@return not is-end($edge);
|
|
488
723
|
}
|
|
@@ -13,3 +13,17 @@ Todos:
|
|
|
13
13
|
* May override base styles
|
|
14
14
|
* May contain layouts
|
|
15
15
|
* May wrap or contain base (button vs button-group)
|
|
16
|
+
|
|
17
|
+
Daniel Todos:
|
|
18
|
+
☐ Remove uswds stylings for informative and emergency callouts and move it into soar's site
|
|
19
|
+
☐ get rid of extra styles in frontend to clean up the left cap
|
|
20
|
+
✔ add a dash to left-cap mixin (to make private) and remove documentation for that mixin @done
|
|
21
|
+
✔ setup cap colors (define colors) @done
|
|
22
|
+
remove the width of the individual callout styles
|
|
23
|
+
remove background-dark, light, emergency styles
|
|
24
|
+
☐ Reach out to Rachel about the bug with the theme toggle not working
|
|
25
|
+
☐ ask her to recreate it
|
|
26
|
+
☐ Setup search results page
|
|
27
|
+
☐ General Node/Page Setup
|
|
28
|
+
☐ Setup View
|
|
29
|
+
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
/// Module Settings
|
|
15
15
|
/// @type Map
|
|
16
|
-
/// @prop {Color} background-color [
|
|
17
|
-
/// @prop {Color} background-color-open [
|
|
16
|
+
/// @prop {Color} background-color [accordion-background] This is the background color of the accordion before it is expanded.
|
|
17
|
+
/// @prop {Color} background-color-open [accordion-background-open] This is the background color of the accordion before it is expanded. This will change the background color of the accordion's summary as well as the details.
|
|
18
18
|
/// @prop {String} border-color ["rule"]
|
|
19
19
|
/// @prop {Number} border-radius [0] This applies a rounding of edges for the accordion. If there are multiple accordions in a stack, this will only apply to the top of the first accordion and the bottom of the last accordion.
|
|
20
20
|
/// @prop {Dimension} border-width [1px] The width of the borders of the accordions
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
/// @prop {Dimension} transparent-padding-x [0] The upper and lower padding of the transparent summary.
|
|
42
42
|
|
|
43
43
|
$config: (
|
|
44
|
-
"background-color":
|
|
45
|
-
"background-color-open":
|
|
44
|
+
"background-color": "background",
|
|
45
|
+
"background-color-open": "background-gray",
|
|
46
46
|
"border-color": "rule",
|
|
47
47
|
"border-radius": 0,
|
|
48
48
|
"border-width": 1px,
|
|
@@ -59,7 +59,7 @@ $config: (
|
|
|
59
59
|
"icon-font-size": 1.5rem,
|
|
60
60
|
"icon-size": auto,
|
|
61
61
|
"icon-stroke-width": 0.15em,
|
|
62
|
-
"summary-background-color": white,
|
|
62
|
+
"summary-background-color": "white",
|
|
63
63
|
"summary-color": null,
|
|
64
64
|
"summary-background-color-hover": null,
|
|
65
65
|
"summary-color-hover": null,
|
|
@@ -107,7 +107,7 @@ $config: (
|
|
|
107
107
|
margin-top: get("margin");
|
|
108
108
|
margin-bottom: get("margin");
|
|
109
109
|
border: $border;
|
|
110
|
-
background-color: get("background-color");
|
|
110
|
+
background-color: color.get(get("background-color"));
|
|
111
111
|
box-shadow: get("box-shadow");
|
|
112
112
|
&:first-of-type {
|
|
113
113
|
border-top-left-radius: get("border-radius");
|
|
@@ -120,11 +120,11 @@ $config: (
|
|
|
120
120
|
& + & {
|
|
121
121
|
$gap: -(get("margin") - get("margin-between"));
|
|
122
122
|
margin-top: $gap;
|
|
123
|
-
margin-top: calc($gap -
|
|
123
|
+
margin-top: calc($gap - get("border-width"));
|
|
124
124
|
}
|
|
125
125
|
&[open],
|
|
126
126
|
&.is-active {
|
|
127
|
-
background-color: get("background-color-open");
|
|
127
|
+
background-color: color.get(get("background-color-open"));
|
|
128
128
|
padding-bottom: get("padding-y");
|
|
129
129
|
z-index: 2; // Above child details
|
|
130
130
|
> #{ $prefix }__summary {
|
|
@@ -136,8 +136,8 @@ $config: (
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
#{ $prefix }__summary {
|
|
139
|
-
background-color: get("summary-background-color");
|
|
140
|
-
color: get("summary-color");
|
|
139
|
+
background-color: color.get(get("summary-background-color"));
|
|
140
|
+
color: color.get(get("summary-color"));
|
|
141
141
|
margin-left: -(get("padding-x"));
|
|
142
142
|
margin-right: -(get("padding-x"));
|
|
143
143
|
line-height: get("summary-line-height");
|
|
@@ -145,10 +145,9 @@ $config: (
|
|
|
145
145
|
vertical-align: top;
|
|
146
146
|
font-weight: bold;
|
|
147
147
|
cursor: pointer;
|
|
148
|
+
display: flex; // For icon
|
|
149
|
+
align-items: center;
|
|
148
150
|
&:has(#{ $prefix }__icon) {
|
|
149
|
-
display: flex; // For icon
|
|
150
|
-
align-items: center;
|
|
151
|
-
justify-content: space-between;
|
|
152
151
|
list-style: none; // Remove the default arrow (old safari?)
|
|
153
152
|
&::-webkit-details-marker,
|
|
154
153
|
&::marker {
|
|
@@ -161,10 +160,10 @@ $config: (
|
|
|
161
160
|
@include typography.size(get("summary-type-size"));
|
|
162
161
|
}
|
|
163
162
|
&:hover {
|
|
164
|
-
background-color: get("summary-background-color-hover");
|
|
165
|
-
color: get("summary-color-hover");
|
|
163
|
+
background-color: color.get(get("summary-background-color-hover"));
|
|
164
|
+
color: color.get(get("summary-color-hover"));
|
|
166
165
|
#{ $prefix }__icon {
|
|
167
|
-
background-color: get("icon-background-color-hover");
|
|
166
|
+
background-color: color.get(get("icon-background-color-hover"));
|
|
168
167
|
color: color.get(get("icon-color-hover"));
|
|
169
168
|
}
|
|
170
169
|
}
|
|
@@ -172,9 +171,9 @@ $config: (
|
|
|
172
171
|
#{ $prefix }__icon {
|
|
173
172
|
flex: 0 0 get("icon-size");
|
|
174
173
|
color: color.get(get("icon-color"));
|
|
175
|
-
margin-left:
|
|
176
|
-
|
|
177
|
-
background-color: get("icon-background-color");
|
|
174
|
+
margin-left: auto;
|
|
175
|
+
padding-left: 0.5em;
|
|
176
|
+
background-color: color.get(get("icon-background-color"));
|
|
178
177
|
border-radius: get("icon-border-radius");
|
|
179
178
|
width: get("icon-size");
|
|
180
179
|
height: get("icon-size");
|
|
@@ -209,7 +208,6 @@ $config: (
|
|
|
209
208
|
}
|
|
210
209
|
#{ $prefix }--no-borders {
|
|
211
210
|
border: none;
|
|
212
|
-
margin-bottom: 4rem;
|
|
213
211
|
&[open] > .accordion__summary {
|
|
214
212
|
border-bottom: none;
|
|
215
213
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@use "sass:map";
|
|
7
7
|
@use "../utils";
|
|
8
8
|
@use "../selector";
|
|
9
|
+
@use "../color";
|
|
9
10
|
|
|
10
11
|
/// Module Settings
|
|
11
12
|
/// @type Map
|
|
@@ -94,8 +95,8 @@ $config: (
|
|
|
94
95
|
&:hover,
|
|
95
96
|
&:focus,
|
|
96
97
|
&:visited {
|
|
97
|
-
background-color: get("background-color");
|
|
98
|
-
color: get("color");
|
|
98
|
+
background-color: color.get(get("background-color"));
|
|
99
|
+
color: color.get(get("color"));
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
#{ $prefix }--clickable {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group basic-hero
|
|
3
|
+
/// Basic styling for a hero
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:math";
|
|
8
|
+
@use "sass:meta";
|
|
9
|
+
@use "sass:list";
|
|
10
|
+
|
|
11
|
+
@use "../breakpoint";
|
|
12
|
+
@use "../selector";
|
|
13
|
+
@use "../utils";
|
|
14
|
+
@use "../typography";
|
|
15
|
+
@use "../color";
|
|
16
|
+
|
|
17
|
+
// Used for function fallback
|
|
18
|
+
$-fallbacks: (
|
|
19
|
+
"main-max-width" : (
|
|
20
|
+
"function" : meta.get-function("get", false, "typography"),
|
|
21
|
+
"property" : "max-width"
|
|
22
|
+
),
|
|
23
|
+
"main-min-width" : (
|
|
24
|
+
"function" : meta.get-function("get", false, "typography"),
|
|
25
|
+
"property" : "max-width-small"
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/// Module Settings
|
|
30
|
+
/// @type Map
|
|
31
|
+
/// @prop {CssValue} text-align [center] Alignment of text within hero.
|
|
32
|
+
/// @prop {Color} background-color ["color-hero-background"] Background color of the hero
|
|
33
|
+
|
|
34
|
+
$config: (
|
|
35
|
+
"background-color" : "background-gray",
|
|
36
|
+
"padding-top": 3rem,
|
|
37
|
+
"padding-bottom" : 2rem,
|
|
38
|
+
"gap" : (4rem 2rem),
|
|
39
|
+
"main-max-width" : true,
|
|
40
|
+
"main-min-width" : true,
|
|
41
|
+
"media-max-width" : 20rem,
|
|
42
|
+
"media-vertical-align" : center
|
|
43
|
+
) !default;
|
|
44
|
+
|
|
45
|
+
/// Change modules $config
|
|
46
|
+
/// @param {Map} $changes Map of changes
|
|
47
|
+
/// @example scss
|
|
48
|
+
/// @include ulu.component-basic-hero-set(( "property" : value ));
|
|
49
|
+
|
|
50
|
+
@mixin set($changes) {
|
|
51
|
+
$config: map.merge($config, $changes) !global;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// Get a config option
|
|
55
|
+
/// @param {Map} $name Name of property
|
|
56
|
+
/// @example scss
|
|
57
|
+
/// @include ulu.component-basic-hero-get("property");
|
|
58
|
+
|
|
59
|
+
@function get($name) {
|
|
60
|
+
$value: utils.require-map-get($config, $name, "basic-hero [config]");
|
|
61
|
+
@return utils.function-fallback($name, $value, $-fallbacks);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Prints component styles
|
|
65
|
+
/// @example scss
|
|
66
|
+
/// @include ulu.component-basic-hero-styles();
|
|
67
|
+
|
|
68
|
+
@mixin styles {
|
|
69
|
+
$prefix: selector.class("basic-hero");
|
|
70
|
+
|
|
71
|
+
#{ $prefix } {
|
|
72
|
+
background-color: color.get(get("background-color"));
|
|
73
|
+
}
|
|
74
|
+
#{ $prefix }__content {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: stretch;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
justify-content: space-between;
|
|
79
|
+
gap: get("gap");
|
|
80
|
+
padding-top: get("padding-top");
|
|
81
|
+
padding-bottom: get("padding-bottom");
|
|
82
|
+
}
|
|
83
|
+
#{ $prefix }__content-main {
|
|
84
|
+
$min-width: if(get("main-min-width"), get("main-min-width"), get("main-max-width"));
|
|
85
|
+
// Using max/min-width so that we don't need to add selectors to change flex-basis
|
|
86
|
+
// when centered. Using flex-basis: 0 to allow flexbox to decide the items width
|
|
87
|
+
// allows it to expand/shrink within. min(100%... Never larger than parent
|
|
88
|
+
min-width: min(100%, $min-width);
|
|
89
|
+
max-width: get("main-max-width");
|
|
90
|
+
flex-shrink: 1;
|
|
91
|
+
flex-grow: 1;
|
|
92
|
+
flex-basis: 0;
|
|
93
|
+
}
|
|
94
|
+
#{ $prefix }__content-media {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
align-self: get("media-vertical-align");
|
|
98
|
+
justify-content: center;
|
|
99
|
+
flex: 0 0 auto;
|
|
100
|
+
width: min(100%, get("media-max-width"));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Modifiers
|
|
104
|
+
#{ $prefix }--center {
|
|
105
|
+
#{ $prefix }__content {
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
flex-wrap: nowrap;
|
|
108
|
+
text-align: center;
|
|
109
|
+
align-items: center;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|