@ulu/frontend 0.0.23 → 0.1.0-beta.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/CHANGELOG.md +20 -0
- package/deprecated/js/drupal-programmatic-modal.js +91 -0
- package/{js/ui/modals.js → deprecated/js/micromodal-modals.js} +41 -67
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +70 -1
- package/index.js +6 -1
- package/js/events/index.js +58 -7
- package/js/index.js +3 -7
- package/js/{helpers/css-breakpoint.js → ui/breakpoints.js} +9 -11
- package/js/ui/collapsible.js +195 -0
- package/js/ui/dialog.js +157 -0
- package/js/ui/dialog.todo +37 -0
- package/js/ui/flipcard.js +55 -11
- package/js/ui/grid.js +2 -47
- package/js/ui/index.js +21 -0
- package/js/ui/modal-builder.js +197 -0
- package/js/ui/overflow-scroller-pager.js +1 -1
- package/js/ui/overflow-scroller.js +8 -5
- package/js/ui/page.js +14 -0
- package/js/ui/popover.js +135 -0
- package/js/ui/print-details.js +44 -0
- package/js/ui/print.js +67 -0
- package/js/ui/programmatic-modal.js +79 -81
- package/js/ui/proxy-click.js +80 -0
- package/js/ui/resizer.js +3 -3
- package/js/ui/scroll-slider.js +56 -0
- package/js/ui/scrollpoint.js +300 -0
- package/js/ui/slider.js +72 -10
- package/js/ui/tabs.js +85 -58
- package/js/ui/theme-toggle.js +129 -0
- package/js/ui/tooltip.js +268 -67
- package/js/utils/{logger.js → class-logger.js} +6 -5
- package/js/utils/dom.js +122 -0
- package/js/utils/file-save.js +67 -0
- package/js/utils/floating-ui.js +83 -0
- package/js/utils/id.js +22 -0
- package/js/utils/index.js +7 -0
- package/js/{helpers → utils}/pause-youtube-video.js +1 -1
- package/package.json +33 -13
- package/resources/drupal/twig-macros/accordion.twig +99 -0
- package/resources/drupal/twig-macros/dropdown.twig +44 -0
- package/resources/drupal/twig-macros/flipcard.twig +69 -0
- package/resources/drupal/twig-macros/image.twig +30 -0
- package/resources/drupal/twig-macros/layout.twig +338 -0
- package/resources/drupal/twig-macros/slider.twig +214 -0
- package/resources/drupal/twig-macros/tabs.twig +84 -0
- package/scss/README.md +13 -1
- package/scss/_breakpoint.scss +69 -26
- package/scss/_button.scss +148 -57
- package/scss/_color.scss +46 -28
- package/scss/_cssvar.scss +103 -12
- package/scss/_element.scss +84 -67
- package/scss/_index.scss +0 -3
- package/scss/_layout.scss +57 -26
- package/scss/_path.scss +2 -2
- package/scss/_selector.scss +20 -11
- package/scss/_typography.scss +115 -82
- package/scss/_units.scss +14 -13
- package/scss/_utils.scss +280 -18
- package/scss/base/_color.scss +2 -1
- package/scss/base/_elements.scss +61 -35
- package/scss/base/_index.scss +60 -23
- package/scss/base/_keyframes.scss +115 -16
- package/scss/base/_layout.scss +10 -6
- package/scss/base/_normalize.scss +6 -122
- package/scss/base/_print.scss +49 -0
- package/scss/base/_root.scss +28 -0
- package/scss/base/_typography.scss +4 -1
- package/scss/components/_accordion.scss +217 -0
- package/scss/components/_adaptive-spacing.scss +148 -0
- package/scss/components/_badge.scss +17 -14
- package/scss/components/_button-verbose.scss +138 -0
- package/scss/components/_button.scss +9 -4
- package/scss/components/_callout.scss +175 -0
- package/scss/components/_captioned-figure.scss +173 -0
- package/scss/components/_card-grid.scss +75 -0
- package/scss/components/_card.scss +420 -0
- package/scss/components/_css-icon.scss +433 -0
- package/scss/{_grid.scss → components/_data-grid.scss} +100 -68
- package/scss/components/_data-table.scss +180 -0
- package/scss/components/_fill-context.scss +20 -22
- package/scss/components/_flipcard-grid.scss +66 -0
- package/scss/components/_flipcard.scss +304 -0
- package/scss/components/_form-theme.scss +633 -0
- package/scss/components/_hero.scss +183 -0
- package/scss/components/_horizontal-rule.scss +51 -0
- package/scss/components/_image-grid.scss +71 -0
- package/scss/components/_index.scss +276 -38
- package/scss/components/_links.scss +1 -1
- package/scss/components/_list-lines.scss +14 -3
- package/scss/components/_list-ordered.scss +3 -1
- package/scss/components/_list-unordered.scss +3 -1
- package/scss/components/_menu-stack.scss +245 -0
- package/scss/components/_modal.scss +495 -0
- package/scss/components/_nav-strip.scss +148 -0
- package/scss/components/_overlay-section.scss +122 -0
- package/scss/components/_pager.scss +168 -0
- package/scss/components/_placeholder-block.scss +121 -0
- package/scss/components/_popover.scss +263 -0
- package/scss/components/_pull-quote.scss +111 -0
- package/scss/components/_ratio-box.scss +64 -0
- package/scss/components/_rule.scss +12 -9
- package/scss/components/_scroll-slider.scss +204 -0
- package/scss/components/_skip-link.scss +92 -0
- package/scss/components/_slider.scss +241 -0
- package/scss/components/_spoke-spinner.scss +193 -0
- package/scss/components/_tabs.scss +179 -0
- package/scss/components/_tag.scss +156 -0
- package/scss/components/_tile-button.scss +131 -0
- package/scss/components/_tile-grid-overlay.scss +132 -0
- package/scss/components/_tile-grid.scss +172 -0
- package/scss/components/_vignette.scss +65 -0
- package/scss/components/_wysiwyg.scss +94 -0
- package/scss/helpers/_color.scss +1 -0
- package/scss/helpers/_display.scss +2 -1
- package/scss/helpers/_index.scss +45 -22
- package/scss/helpers/_print.scss +20 -43
- package/scss/helpers/_typography.scss +3 -0
- package/scss/helpers/_units.scss +10 -13
- package/scss/helpers/_utilities.scss +5 -1
- package/scss/stylesheets/base-styles.scss +7 -0
- package/scss/stylesheets/component-styles.scss +7 -0
- package/scss/stylesheets/helper-styles.scss +7 -0
- package/types/events/index.d.ts +1 -1
- package/types/events/index.d.ts.map +1 -1
- package/types/index.d.ts +2 -2
- package/types/{helpers/css-breakpoint.d.ts → ui/breakpoints.d.ts} +3 -3
- package/types/ui/breakpoints.d.ts.map +1 -0
- package/types/ui/collapsible.d.ts +67 -0
- package/types/ui/collapsible.d.ts.map +1 -0
- package/types/ui/dialog.d.ts +42 -0
- package/types/ui/dialog.d.ts.map +1 -0
- package/types/ui/flipcard.d.ts +8 -1
- package/types/ui/flipcard.d.ts.map +1 -1
- package/types/ui/grid.d.ts +0 -11
- package/types/ui/grid.d.ts.map +1 -1
- package/types/ui/index.d.ts +23 -0
- package/types/ui/index.d.ts.map +1 -0
- package/types/ui/modal-builder.d.ts +54 -0
- package/types/ui/modal-builder.d.ts.map +1 -0
- package/types/ui/overflow-scroller-pager.d.ts +1 -1
- package/types/ui/overflow-scroller-pager.d.ts.map +1 -1
- package/types/ui/overflow-scroller.d.ts +3 -1
- package/types/ui/overflow-scroller.d.ts.map +1 -1
- package/types/ui/page.d.ts +5 -0
- package/types/ui/page.d.ts.map +1 -0
- package/types/ui/popover.d.ts +40 -0
- package/types/ui/popover.d.ts.map +1 -0
- package/types/ui/print-details.d.ts +10 -0
- package/types/ui/print-details.d.ts.map +1 -0
- package/types/ui/print.d.ts +10 -0
- package/types/ui/print.d.ts.map +1 -0
- package/types/ui/programmatic-modal.d.ts +19 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/proxy-click.d.ts +18 -0
- package/types/ui/proxy-click.d.ts.map +1 -0
- package/types/ui/resizer.d.ts +1 -1
- package/types/ui/resizer.d.ts.map +1 -1
- package/types/ui/scroll-slider.d.ts +13 -0
- package/types/ui/scroll-slider.d.ts.map +1 -0
- package/types/ui/scrollpoint.d.ts +133 -0
- package/types/ui/scrollpoint.d.ts.map +1 -0
- package/types/ui/slider.d.ts +14 -2
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts +22 -0
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +14 -0
- package/types/ui/theme-toggle.d.ts.map +1 -0
- package/types/ui/tooltip.d.ts +92 -10
- package/types/ui/tooltip.d.ts.map +1 -1
- package/types/utils/{logger.d.ts → class-logger.d.ts} +1 -1
- package/types/utils/class-logger.d.ts.map +1 -0
- package/types/utils/dom.d.ts +48 -0
- package/types/utils/dom.d.ts.map +1 -0
- package/types/utils/file-save.d.ts +64 -0
- package/types/utils/file-save.d.ts.map +1 -0
- package/types/utils/floating-ui.d.ts +19 -0
- package/types/utils/floating-ui.d.ts.map +1 -0
- package/types/utils/id.d.ts +10 -0
- package/types/utils/id.d.ts.map +1 -0
- package/types/utils/index.d.ts +9 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/pause-youtube-video.d.ts.map +1 -0
- package/js/helpers/file-save.js +0 -52
- package/js/helpers/scrollbar-width-property.js +0 -14
- package/project.todo +0 -22
- package/scss/_calculate.scss +0 -64
- package/scss/_utility.scss +0 -12
- package/types/helpers/css-breakpoint.d.ts.map +0 -1
- package/types/helpers/file-save.d.ts +0 -17
- package/types/helpers/file-save.d.ts.map +0 -1
- package/types/helpers/node-data-manager.d.ts +0 -45
- package/types/helpers/node-data-manager.d.ts.map +0 -1
- package/types/helpers/pause-youtube-video.d.ts.map +0 -1
- package/types/helpers/scrollbar-width-property.d.ts +0 -11
- package/types/helpers/scrollbar-width-property.d.ts.map +0 -1
- package/types/ui/modals.d.ts +0 -27
- package/types/ui/modals.d.ts.map +0 -1
- package/types/utils/logger.d.ts.map +0 -1
- package/vite.config.js +0 -36
- /package/{js/deprecated → deprecated/js}/doc-ready.js +0 -0
- /package/{js/deprecated → deprecated/js}/jquery-prototypes.js +0 -0
- /package/{js/deprecated → deprecated/js}/mini-collapsible-popper-positioning.js +0 -0
- /package/{js/deprecated → deprecated/js}/mini-collapsible.js +0 -0
- /package/{js/helpers → deprecated/js}/node-data-manager.js +0 -0
- /package/{js/deprecated → deprecated/js}/script-loader.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/README.md +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/anchor-menu.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/element-waypoint.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/examples/page-link-menu.md +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/state-in-attribute.js +0 -0
- /package/types/{helpers → utils}/pause-youtube-video.d.ts +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group callout
|
|
3
|
+
/// A container for content that highlights important information, provides context, or guides user attention within an interface
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:meta";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@use "../utils";
|
|
11
|
+
@use "../selector";
|
|
12
|
+
@use "../element";
|
|
13
|
+
|
|
14
|
+
// Used for function fallback
|
|
15
|
+
$-fallbacks: (
|
|
16
|
+
"border" : (
|
|
17
|
+
"function" : meta.get-function("get-rule-style", false, "element"),
|
|
18
|
+
"property" : "light"
|
|
19
|
+
),
|
|
20
|
+
"border-radius" : (
|
|
21
|
+
"function" : meta.get-function("get", false, "element"),
|
|
22
|
+
"property" : "border-radius"
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/// Module Settings
|
|
27
|
+
/// @type Map
|
|
28
|
+
/// @prop {Color} background-color [rgb(240, 240, 240)] The background color of the Callout.
|
|
29
|
+
/// @prop {Boolean} border [true] The border of the Callout.
|
|
30
|
+
/// @prop {Boolean} border-radius [true] The border radius of the Callout.
|
|
31
|
+
/// @prop {CssValue} box-shadow [none] The box-shadow of the Callout.
|
|
32
|
+
/// @prop {Boolean} left-cap [false] Toggles the use of left caps in styled callouts.
|
|
33
|
+
/// @prop {Color} left-cap-color [green] Color of the left cap.
|
|
34
|
+
/// @prop {Dimension} left-cap-width [0.5rem] Width of the left cap.
|
|
35
|
+
/// @prop {Dimension} margin [2rem] Bottom margin of the Callout.
|
|
36
|
+
/// @prop {Dimension} padding [1.5rem] Padding of the Callout.
|
|
37
|
+
|
|
38
|
+
$config: (
|
|
39
|
+
"background-color" : rgb(240, 240, 240),
|
|
40
|
+
"border" : true,
|
|
41
|
+
"border-radius" : true,
|
|
42
|
+
"box-shadow" : none,
|
|
43
|
+
"left-cap" : false,
|
|
44
|
+
"left-cap-color" : green,
|
|
45
|
+
"left-cap-width" : 0.5rem,
|
|
46
|
+
"margin" : 2rem,
|
|
47
|
+
"padding" : 1.5rem,
|
|
48
|
+
) !default;
|
|
49
|
+
|
|
50
|
+
$styles: (
|
|
51
|
+
"background-dark" : (
|
|
52
|
+
"background-color" : rgb(240, 240, 240)
|
|
53
|
+
),
|
|
54
|
+
"outline" : (
|
|
55
|
+
"background-color": transparent
|
|
56
|
+
),
|
|
57
|
+
"light" : (
|
|
58
|
+
"background-color" : white,
|
|
59
|
+
"border-color" : gray
|
|
60
|
+
),
|
|
61
|
+
"informative" : (
|
|
62
|
+
"background-color" : #e7f6f8,
|
|
63
|
+
"left-cap-color" : #00bde3,
|
|
64
|
+
"left-cap" : true,
|
|
65
|
+
"left-cap-width": 0.5rem
|
|
66
|
+
),
|
|
67
|
+
"warning" : (
|
|
68
|
+
"background-color" : #faf3d1,
|
|
69
|
+
"left-cap-color" : #ffbe2e,
|
|
70
|
+
"left-cap" : true,
|
|
71
|
+
"left-cap-width": 0.5rem
|
|
72
|
+
),
|
|
73
|
+
"success" : (
|
|
74
|
+
"background-color" : #ecf3ec,
|
|
75
|
+
"left-cap-color" : #00a91c,
|
|
76
|
+
"left-cap" : true,
|
|
77
|
+
"left-cap-width": 0.5rem
|
|
78
|
+
),
|
|
79
|
+
"danger" : (
|
|
80
|
+
"background-color" : #f4e3db,
|
|
81
|
+
"left-cap-color" : #d54309,
|
|
82
|
+
"left-cap" : true,
|
|
83
|
+
"left-cap-width": 0.5rem
|
|
84
|
+
),
|
|
85
|
+
"emergency" : (
|
|
86
|
+
"background-color" : #9c3d10,
|
|
87
|
+
"left-cap-color" : #9c3d10,
|
|
88
|
+
"left-cap" : true,
|
|
89
|
+
"color" : white,
|
|
90
|
+
"left-cap-width": 0.5rem
|
|
91
|
+
)
|
|
92
|
+
) !default;
|
|
93
|
+
|
|
94
|
+
/// Change modules $config
|
|
95
|
+
/// @param {Map} $changes Map of changes
|
|
96
|
+
/// @example
|
|
97
|
+
/// @include ulu.component-callout-set(( "property" : value ));
|
|
98
|
+
|
|
99
|
+
@mixin set($changes) {
|
|
100
|
+
$config: map.merge($config, $changes) !global;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Get a config option
|
|
104
|
+
/// @param {Map} $name Name of property
|
|
105
|
+
/// @example
|
|
106
|
+
/// @include ulu.component-callout-get("property");
|
|
107
|
+
|
|
108
|
+
@function get($name) {
|
|
109
|
+
$value: utils.require-map-get($config, $name, "callout [config]");
|
|
110
|
+
@return utils.function-fallback($name, $value, $-fallbacks);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/// Set callout style variations
|
|
114
|
+
/// @param {Map} $changes Map of changes (options for style include [background-color, color, border, border-radius, border-color, box-shadow, padding, left-cap, left-cap-width, left-cap-color]
|
|
115
|
+
/// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
|
|
116
|
+
|
|
117
|
+
@mixin set-styles($changes, $merge-mode: null) {
|
|
118
|
+
$styles: utils.map-merge($styles, $changes, $merge-mode) !global;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/// Output styling for a callout that adds a left cap
|
|
122
|
+
/// @param {Dimension} $width The width of the left cap
|
|
123
|
+
/// @param {Color} $color The left cap color
|
|
124
|
+
|
|
125
|
+
@mixin left-cap($width: get("left-cap-width"), $color: get("left-cap-color")) {
|
|
126
|
+
position: relative;
|
|
127
|
+
border-top-left-radius: 0;
|
|
128
|
+
border-bottom-left-radius: 0;
|
|
129
|
+
&::before {
|
|
130
|
+
position: absolute;
|
|
131
|
+
content: "";
|
|
132
|
+
left: 0;
|
|
133
|
+
top: 0;
|
|
134
|
+
bottom: 0;
|
|
135
|
+
width: $width;
|
|
136
|
+
background-color: $color;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// Output component stylesheet
|
|
141
|
+
/// @example scss
|
|
142
|
+
/// @include ulu.component-callout-styles();
|
|
143
|
+
|
|
144
|
+
@mixin styles {
|
|
145
|
+
$prefix: selector.class("callout");
|
|
146
|
+
|
|
147
|
+
#{ $prefix } {
|
|
148
|
+
background-color: get("background-color");
|
|
149
|
+
padding: get("padding");
|
|
150
|
+
border: get("border");
|
|
151
|
+
margin-bottom: get("margin");
|
|
152
|
+
box-shadow: get("box-shadow");
|
|
153
|
+
border-radius: get("border-radius");
|
|
154
|
+
& >:first-child {
|
|
155
|
+
margin-top: 0;
|
|
156
|
+
}
|
|
157
|
+
@if get("left-cap") {
|
|
158
|
+
@include left-cap();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
@each $name, $style in $styles {
|
|
162
|
+
#{ $prefix }--#{ $name } {
|
|
163
|
+
background-color: map.get($style, "background-color");
|
|
164
|
+
color: map.get($style, "color");
|
|
165
|
+
border: map.get($style, "border");
|
|
166
|
+
border-radius: map.get($style, "border-radius");
|
|
167
|
+
border-color: map.get($style, "border-color");
|
|
168
|
+
box-shadow: map.get($style, "box-shadow");
|
|
169
|
+
padding: map.get($style, "padding");
|
|
170
|
+
@if map.get($style, "left-cap") {
|
|
171
|
+
@include left-cap( map.get($style, "left-cap-width"), map.get($style, "left-cap-color"));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group captioned-figure
|
|
3
|
+
////
|
|
4
|
+
/// Figure with caption layout (to position caption)
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:meta";
|
|
8
|
+
|
|
9
|
+
@use "../selector";
|
|
10
|
+
@use "../utils";
|
|
11
|
+
@use "../element";
|
|
12
|
+
@use "../typography";
|
|
13
|
+
|
|
14
|
+
// Used for function fallback
|
|
15
|
+
$-fallbacks: (
|
|
16
|
+
"box-shadow" : (
|
|
17
|
+
"function" : meta.get-function("get", false, "element"),
|
|
18
|
+
"property" : "box-shadow-raised"
|
|
19
|
+
),
|
|
20
|
+
"margin-bottom" : (
|
|
21
|
+
"function" : meta.get-function("get", false, "element"),
|
|
22
|
+
"property" : "margin"
|
|
23
|
+
),
|
|
24
|
+
"line-height" : (
|
|
25
|
+
"function" : meta.get-function("get", false, "typography"),
|
|
26
|
+
"property" : "line-height-dense"
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
/// Module Settings
|
|
31
|
+
/// @type Map
|
|
32
|
+
|
|
33
|
+
$config: (
|
|
34
|
+
"text-alignment-matches" : false,
|
|
35
|
+
"text-alignment-matches-center-only" : true,
|
|
36
|
+
"background-color" : white,
|
|
37
|
+
"box-shadow" : true,
|
|
38
|
+
"margin-bottom" : true,
|
|
39
|
+
"line-height" : true,
|
|
40
|
+
"caption-padding" : 0.5em,
|
|
41
|
+
"color" : null,
|
|
42
|
+
"type-size" : "small",
|
|
43
|
+
"caption-max-width" : min(100%, 15em),
|
|
44
|
+
"caption-background-color" : rgba(255,255,255,0.7),
|
|
45
|
+
"caption-backdrop-filter" : blur(2px),
|
|
46
|
+
"traditional-caption-color" : null,
|
|
47
|
+
"traditional-caption-background-color" : transparent,
|
|
48
|
+
"traditional-caption-padding" : 0.5em,
|
|
49
|
+
"traditional-caption-max-width" : 35em,
|
|
50
|
+
"traditional-caption-text-align" : right,
|
|
51
|
+
) !default;
|
|
52
|
+
|
|
53
|
+
/// Change modules $config
|
|
54
|
+
/// @param {Map} $changes Map of changes
|
|
55
|
+
/// @example
|
|
56
|
+
/// @include ulu.component-captioned-figure-set(( "property" : value ));
|
|
57
|
+
|
|
58
|
+
@mixin set($changes) {
|
|
59
|
+
$config: map.merge($config, $changes) !global;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// Get a config option
|
|
63
|
+
/// @param {Map} $name Name of property
|
|
64
|
+
/// @example
|
|
65
|
+
/// @include ulu.component-captioned-figure-get("property");
|
|
66
|
+
|
|
67
|
+
@function get($name) {
|
|
68
|
+
$value: utils.require-map-get($config, $name, "captioned-figure [config]");
|
|
69
|
+
@return utils.function-fallback($name, $value, $-fallbacks);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// Prints component styles
|
|
73
|
+
/// @example scss
|
|
74
|
+
/// @example
|
|
75
|
+
/// @include ulu.component-captioned-figure-styles();
|
|
76
|
+
|
|
77
|
+
@mixin styles {
|
|
78
|
+
$prefix: selector.class("captioned-figure");
|
|
79
|
+
$set-aligns: get("text-alignment-matches");
|
|
80
|
+
$aligns-center-only: get("text-alignment-matches-center-only");
|
|
81
|
+
|
|
82
|
+
#{ $prefix } {
|
|
83
|
+
display: block;
|
|
84
|
+
position: relative;
|
|
85
|
+
margin-bottom: get("margin-bottom");
|
|
86
|
+
background-color: get("background-color");
|
|
87
|
+
> img {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: auto;
|
|
90
|
+
margin: 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
a#{ $prefix },
|
|
94
|
+
button#{ $prefix } {
|
|
95
|
+
display: block;
|
|
96
|
+
@if (get("box-shadow")) {
|
|
97
|
+
&:hover,
|
|
98
|
+
&:focus {
|
|
99
|
+
box-shadow: get("box-shadow");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
#{ $prefix }__caption {
|
|
104
|
+
position: absolute;
|
|
105
|
+
color: get("color");
|
|
106
|
+
@include typography.size(get("type-size"), $only-font-size: true);
|
|
107
|
+
line-height: get("line-height");
|
|
108
|
+
max-width: get("caption-max-width");
|
|
109
|
+
background-color: get("caption-background-color");
|
|
110
|
+
padding: get("caption-padding");
|
|
111
|
+
backdrop-filter: get("caption-backdrop-filter");
|
|
112
|
+
}
|
|
113
|
+
#{ $prefix }--traditional {
|
|
114
|
+
#{ $prefix }__caption {
|
|
115
|
+
position: static;
|
|
116
|
+
color: get("traditional-caption-color");
|
|
117
|
+
max-width: get("traditional-caption-max-width");
|
|
118
|
+
background-color: get("traditional-caption-background-color");
|
|
119
|
+
padding: get("traditional-caption-padding");
|
|
120
|
+
text-align: get("traditional-caption-text-align");
|
|
121
|
+
@if (get("traditional-caption-text-align") == right) {
|
|
122
|
+
margin-left: auto;
|
|
123
|
+
}
|
|
124
|
+
@if (get("traditional-caption-text-align") == center) {
|
|
125
|
+
margin-left: auto;
|
|
126
|
+
margin-right: auto;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
#{ $prefix }--left {
|
|
131
|
+
#{ $prefix }__caption {
|
|
132
|
+
left: 0;
|
|
133
|
+
@if ($set-aligns and not $aligns-center-only) {
|
|
134
|
+
text-align: left;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
#{ $prefix }--right {
|
|
139
|
+
#{ $prefix }__caption {
|
|
140
|
+
right: 0;
|
|
141
|
+
@if ($set-aligns and not $aligns-center-only) {
|
|
142
|
+
text-align: right;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
#{ $prefix }--bottom {
|
|
147
|
+
#{ $prefix }__caption {
|
|
148
|
+
bottom: 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
#{ $prefix }--top {
|
|
152
|
+
#{ $prefix }__caption {
|
|
153
|
+
top: 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
#{ $prefix }--bottom#{ $prefix }--center,
|
|
157
|
+
#{ $prefix }--top#{ $prefix }--center {
|
|
158
|
+
#{ $prefix }__caption {
|
|
159
|
+
left: 50%;
|
|
160
|
+
transform: translateX(-50%);
|
|
161
|
+
@if ($set-aligns or $aligns-center-only) {
|
|
162
|
+
text-align: center;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
#{ $prefix }--left#{ $prefix }--center,
|
|
167
|
+
#{ $prefix }--right#{ $prefix }--center {
|
|
168
|
+
#{ $prefix }__caption {
|
|
169
|
+
top: 50%;
|
|
170
|
+
transform: translateY(-50%);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group card-grid
|
|
3
|
+
/// Lightweight CSS Grid setup for card components
|
|
4
|
+
////
|
|
5
|
+
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
|
|
8
|
+
@use "../breakpoint";
|
|
9
|
+
@use "../utils";
|
|
10
|
+
@use "../selector";
|
|
11
|
+
|
|
12
|
+
/// Module Settings
|
|
13
|
+
/// @type Map
|
|
14
|
+
/// @prop {CssValue} compact-template-columns [1fr 1fr 1fr] The template-columns of the card-grid--compact.
|
|
15
|
+
/// @prop {Dimension} compact-gap [1rem] The grid gap of the card-grid--compact.
|
|
16
|
+
/// @prop {Dimension} gap [2rem] The grid gap of the card-grid.
|
|
17
|
+
/// @prop {CssValue} template-columns [1fr 1fr] The template-columns of the card-grid.
|
|
18
|
+
|
|
19
|
+
$config: (
|
|
20
|
+
"gap" : 2rem,
|
|
21
|
+
"template-columns" : 1fr 1fr,
|
|
22
|
+
"compact-gap" : 1rem,
|
|
23
|
+
"compact-template-columns" : 1fr 1fr 1fr,
|
|
24
|
+
) !default;
|
|
25
|
+
|
|
26
|
+
/// Change modules $config
|
|
27
|
+
/// @param {Map} $changes Map of changes
|
|
28
|
+
/// @example
|
|
29
|
+
/// @include ulu.component-card-grid-set(( "property" : value ));
|
|
30
|
+
|
|
31
|
+
@mixin set($changes) {
|
|
32
|
+
$config: map.merge($config, $changes) !global;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// Get a config option
|
|
36
|
+
/// @param {Map} $name Name of property
|
|
37
|
+
/// @example
|
|
38
|
+
/// @include ulu.component-card-grid-get("property");
|
|
39
|
+
|
|
40
|
+
@function get($name) {
|
|
41
|
+
@return utils.require-map-get($config, $name, "card-grid [config]");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// Prints component styles
|
|
45
|
+
/// @example scss
|
|
46
|
+
/// @include ulu.component-card-grid-styles();
|
|
47
|
+
|
|
48
|
+
@mixin styles {
|
|
49
|
+
$prefix: selector.class("card-grid");
|
|
50
|
+
$prefix-card: selector.class("card");
|
|
51
|
+
|
|
52
|
+
#{ $prefix } {
|
|
53
|
+
display: grid;
|
|
54
|
+
grid-template-columns: get("template-columns");
|
|
55
|
+
grid-auto-rows: 1fr;
|
|
56
|
+
gap: get("gap");
|
|
57
|
+
margin: get("gap") 0;
|
|
58
|
+
#{ $prefix-card } {
|
|
59
|
+
max-width: none;
|
|
60
|
+
margin: 0;
|
|
61
|
+
&:not(#{ $prefix-card }--overlay) {
|
|
62
|
+
height: 100%;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
#{ $prefix }--compact {
|
|
67
|
+
grid-template-columns: get("compact-template-columns");
|
|
68
|
+
gap: get("compact-gap");
|
|
69
|
+
}
|
|
70
|
+
@include breakpoint.max("small") {
|
|
71
|
+
#{ $prefix } {
|
|
72
|
+
grid-template-columns: 1fr;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|