@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.
Files changed (212) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/deprecated/js/drupal-programmatic-modal.js +91 -0
  3. package/{js/ui/modals.js → deprecated/js/micromodal-modals.js} +41 -67
  4. package/dist/ulu-frontend.min.css +1 -1
  5. package/dist/ulu-frontend.min.js +70 -1
  6. package/index.js +6 -1
  7. package/js/events/index.js +58 -7
  8. package/js/index.js +3 -7
  9. package/js/{helpers/css-breakpoint.js → ui/breakpoints.js} +9 -11
  10. package/js/ui/collapsible.js +195 -0
  11. package/js/ui/dialog.js +157 -0
  12. package/js/ui/dialog.todo +37 -0
  13. package/js/ui/flipcard.js +55 -11
  14. package/js/ui/grid.js +2 -47
  15. package/js/ui/index.js +21 -0
  16. package/js/ui/modal-builder.js +197 -0
  17. package/js/ui/overflow-scroller-pager.js +1 -1
  18. package/js/ui/overflow-scroller.js +8 -5
  19. package/js/ui/page.js +14 -0
  20. package/js/ui/popover.js +135 -0
  21. package/js/ui/print-details.js +44 -0
  22. package/js/ui/print.js +67 -0
  23. package/js/ui/programmatic-modal.js +79 -81
  24. package/js/ui/proxy-click.js +80 -0
  25. package/js/ui/resizer.js +3 -3
  26. package/js/ui/scroll-slider.js +56 -0
  27. package/js/ui/scrollpoint.js +300 -0
  28. package/js/ui/slider.js +72 -10
  29. package/js/ui/tabs.js +85 -58
  30. package/js/ui/theme-toggle.js +129 -0
  31. package/js/ui/tooltip.js +268 -67
  32. package/js/utils/{logger.js → class-logger.js} +6 -5
  33. package/js/utils/dom.js +122 -0
  34. package/js/utils/file-save.js +67 -0
  35. package/js/utils/floating-ui.js +83 -0
  36. package/js/utils/id.js +22 -0
  37. package/js/utils/index.js +7 -0
  38. package/js/{helpers → utils}/pause-youtube-video.js +1 -1
  39. package/package.json +33 -13
  40. package/resources/drupal/twig-macros/accordion.twig +99 -0
  41. package/resources/drupal/twig-macros/dropdown.twig +44 -0
  42. package/resources/drupal/twig-macros/flipcard.twig +69 -0
  43. package/resources/drupal/twig-macros/image.twig +30 -0
  44. package/resources/drupal/twig-macros/layout.twig +338 -0
  45. package/resources/drupal/twig-macros/slider.twig +214 -0
  46. package/resources/drupal/twig-macros/tabs.twig +84 -0
  47. package/scss/README.md +13 -1
  48. package/scss/_breakpoint.scss +69 -26
  49. package/scss/_button.scss +148 -57
  50. package/scss/_color.scss +46 -28
  51. package/scss/_cssvar.scss +103 -12
  52. package/scss/_element.scss +84 -67
  53. package/scss/_index.scss +0 -3
  54. package/scss/_layout.scss +57 -26
  55. package/scss/_path.scss +2 -2
  56. package/scss/_selector.scss +20 -11
  57. package/scss/_typography.scss +115 -82
  58. package/scss/_units.scss +14 -13
  59. package/scss/_utils.scss +280 -18
  60. package/scss/base/_color.scss +2 -1
  61. package/scss/base/_elements.scss +61 -35
  62. package/scss/base/_index.scss +60 -23
  63. package/scss/base/_keyframes.scss +115 -16
  64. package/scss/base/_layout.scss +10 -6
  65. package/scss/base/_normalize.scss +6 -122
  66. package/scss/base/_print.scss +49 -0
  67. package/scss/base/_root.scss +28 -0
  68. package/scss/base/_typography.scss +4 -1
  69. package/scss/components/_accordion.scss +217 -0
  70. package/scss/components/_adaptive-spacing.scss +148 -0
  71. package/scss/components/_badge.scss +17 -14
  72. package/scss/components/_button-verbose.scss +138 -0
  73. package/scss/components/_button.scss +9 -4
  74. package/scss/components/_callout.scss +175 -0
  75. package/scss/components/_captioned-figure.scss +173 -0
  76. package/scss/components/_card-grid.scss +75 -0
  77. package/scss/components/_card.scss +420 -0
  78. package/scss/components/_css-icon.scss +433 -0
  79. package/scss/{_grid.scss → components/_data-grid.scss} +100 -68
  80. package/scss/components/_data-table.scss +180 -0
  81. package/scss/components/_fill-context.scss +20 -22
  82. package/scss/components/_flipcard-grid.scss +66 -0
  83. package/scss/components/_flipcard.scss +304 -0
  84. package/scss/components/_form-theme.scss +633 -0
  85. package/scss/components/_hero.scss +183 -0
  86. package/scss/components/_horizontal-rule.scss +51 -0
  87. package/scss/components/_image-grid.scss +71 -0
  88. package/scss/components/_index.scss +276 -38
  89. package/scss/components/_links.scss +1 -1
  90. package/scss/components/_list-lines.scss +14 -3
  91. package/scss/components/_list-ordered.scss +3 -1
  92. package/scss/components/_list-unordered.scss +3 -1
  93. package/scss/components/_menu-stack.scss +245 -0
  94. package/scss/components/_modal.scss +495 -0
  95. package/scss/components/_nav-strip.scss +148 -0
  96. package/scss/components/_overlay-section.scss +122 -0
  97. package/scss/components/_pager.scss +168 -0
  98. package/scss/components/_placeholder-block.scss +121 -0
  99. package/scss/components/_popover.scss +263 -0
  100. package/scss/components/_pull-quote.scss +111 -0
  101. package/scss/components/_ratio-box.scss +64 -0
  102. package/scss/components/_rule.scss +12 -9
  103. package/scss/components/_scroll-slider.scss +204 -0
  104. package/scss/components/_skip-link.scss +92 -0
  105. package/scss/components/_slider.scss +241 -0
  106. package/scss/components/_spoke-spinner.scss +193 -0
  107. package/scss/components/_tabs.scss +179 -0
  108. package/scss/components/_tag.scss +156 -0
  109. package/scss/components/_tile-button.scss +131 -0
  110. package/scss/components/_tile-grid-overlay.scss +132 -0
  111. package/scss/components/_tile-grid.scss +172 -0
  112. package/scss/components/_vignette.scss +65 -0
  113. package/scss/components/_wysiwyg.scss +94 -0
  114. package/scss/helpers/_color.scss +1 -0
  115. package/scss/helpers/_display.scss +2 -1
  116. package/scss/helpers/_index.scss +45 -22
  117. package/scss/helpers/_print.scss +20 -43
  118. package/scss/helpers/_typography.scss +3 -0
  119. package/scss/helpers/_units.scss +10 -13
  120. package/scss/helpers/_utilities.scss +5 -1
  121. package/scss/stylesheets/base-styles.scss +7 -0
  122. package/scss/stylesheets/component-styles.scss +7 -0
  123. package/scss/stylesheets/helper-styles.scss +7 -0
  124. package/types/events/index.d.ts +1 -1
  125. package/types/events/index.d.ts.map +1 -1
  126. package/types/index.d.ts +2 -2
  127. package/types/{helpers/css-breakpoint.d.ts → ui/breakpoints.d.ts} +3 -3
  128. package/types/ui/breakpoints.d.ts.map +1 -0
  129. package/types/ui/collapsible.d.ts +67 -0
  130. package/types/ui/collapsible.d.ts.map +1 -0
  131. package/types/ui/dialog.d.ts +42 -0
  132. package/types/ui/dialog.d.ts.map +1 -0
  133. package/types/ui/flipcard.d.ts +8 -1
  134. package/types/ui/flipcard.d.ts.map +1 -1
  135. package/types/ui/grid.d.ts +0 -11
  136. package/types/ui/grid.d.ts.map +1 -1
  137. package/types/ui/index.d.ts +23 -0
  138. package/types/ui/index.d.ts.map +1 -0
  139. package/types/ui/modal-builder.d.ts +54 -0
  140. package/types/ui/modal-builder.d.ts.map +1 -0
  141. package/types/ui/overflow-scroller-pager.d.ts +1 -1
  142. package/types/ui/overflow-scroller-pager.d.ts.map +1 -1
  143. package/types/ui/overflow-scroller.d.ts +3 -1
  144. package/types/ui/overflow-scroller.d.ts.map +1 -1
  145. package/types/ui/page.d.ts +5 -0
  146. package/types/ui/page.d.ts.map +1 -0
  147. package/types/ui/popover.d.ts +40 -0
  148. package/types/ui/popover.d.ts.map +1 -0
  149. package/types/ui/print-details.d.ts +10 -0
  150. package/types/ui/print-details.d.ts.map +1 -0
  151. package/types/ui/print.d.ts +10 -0
  152. package/types/ui/print.d.ts.map +1 -0
  153. package/types/ui/programmatic-modal.d.ts +19 -1
  154. package/types/ui/programmatic-modal.d.ts.map +1 -1
  155. package/types/ui/proxy-click.d.ts +18 -0
  156. package/types/ui/proxy-click.d.ts.map +1 -0
  157. package/types/ui/resizer.d.ts +1 -1
  158. package/types/ui/resizer.d.ts.map +1 -1
  159. package/types/ui/scroll-slider.d.ts +13 -0
  160. package/types/ui/scroll-slider.d.ts.map +1 -0
  161. package/types/ui/scrollpoint.d.ts +133 -0
  162. package/types/ui/scrollpoint.d.ts.map +1 -0
  163. package/types/ui/slider.d.ts +14 -2
  164. package/types/ui/slider.d.ts.map +1 -1
  165. package/types/ui/tabs.d.ts +22 -0
  166. package/types/ui/tabs.d.ts.map +1 -1
  167. package/types/ui/theme-toggle.d.ts +14 -0
  168. package/types/ui/theme-toggle.d.ts.map +1 -0
  169. package/types/ui/tooltip.d.ts +92 -10
  170. package/types/ui/tooltip.d.ts.map +1 -1
  171. package/types/utils/{logger.d.ts → class-logger.d.ts} +1 -1
  172. package/types/utils/class-logger.d.ts.map +1 -0
  173. package/types/utils/dom.d.ts +48 -0
  174. package/types/utils/dom.d.ts.map +1 -0
  175. package/types/utils/file-save.d.ts +64 -0
  176. package/types/utils/file-save.d.ts.map +1 -0
  177. package/types/utils/floating-ui.d.ts +19 -0
  178. package/types/utils/floating-ui.d.ts.map +1 -0
  179. package/types/utils/id.d.ts +10 -0
  180. package/types/utils/id.d.ts.map +1 -0
  181. package/types/utils/index.d.ts +9 -0
  182. package/types/utils/index.d.ts.map +1 -0
  183. package/types/utils/pause-youtube-video.d.ts.map +1 -0
  184. package/js/helpers/file-save.js +0 -52
  185. package/js/helpers/scrollbar-width-property.js +0 -14
  186. package/project.todo +0 -22
  187. package/scss/_calculate.scss +0 -64
  188. package/scss/_utility.scss +0 -12
  189. package/types/helpers/css-breakpoint.d.ts.map +0 -1
  190. package/types/helpers/file-save.d.ts +0 -17
  191. package/types/helpers/file-save.d.ts.map +0 -1
  192. package/types/helpers/node-data-manager.d.ts +0 -45
  193. package/types/helpers/node-data-manager.d.ts.map +0 -1
  194. package/types/helpers/pause-youtube-video.d.ts.map +0 -1
  195. package/types/helpers/scrollbar-width-property.d.ts +0 -11
  196. package/types/helpers/scrollbar-width-property.d.ts.map +0 -1
  197. package/types/ui/modals.d.ts +0 -27
  198. package/types/ui/modals.d.ts.map +0 -1
  199. package/types/utils/logger.d.ts.map +0 -1
  200. package/vite.config.js +0 -36
  201. /package/{js/deprecated → deprecated/js}/doc-ready.js +0 -0
  202. /package/{js/deprecated → deprecated/js}/jquery-prototypes.js +0 -0
  203. /package/{js/deprecated → deprecated/js}/mini-collapsible-popper-positioning.js +0 -0
  204. /package/{js/deprecated → deprecated/js}/mini-collapsible.js +0 -0
  205. /package/{js/helpers → deprecated/js}/node-data-manager.js +0 -0
  206. /package/{js/deprecated → deprecated/js}/script-loader.js +0 -0
  207. /package/{js/deprecated → deprecated/js}/waypoints/README.md +0 -0
  208. /package/{js/deprecated → deprecated/js}/waypoints/anchor-menu.js +0 -0
  209. /package/{js/deprecated → deprecated/js}/waypoints/element-waypoint.js +0 -0
  210. /package/{js/deprecated → deprecated/js}/waypoints/examples/page-link-menu.md +0 -0
  211. /package/{js/deprecated → deprecated/js}/waypoints/state-in-attribute.js +0 -0
  212. /package/types/{helpers → utils}/pause-youtube-video.d.ts +0 -0
@@ -0,0 +1,420 @@
1
+ ////
2
+ /// @group card
3
+ /// A versatile container for displaying and summarizing individual items, entities, or resources in a visually appealing and concise format
4
+ ////
5
+
6
+ @use "sass:map";
7
+ @use 'sass:list';
8
+
9
+ @use "../breakpoint";
10
+ @use "../utils";
11
+ @use "../selector";
12
+
13
+ // todo
14
+ // sass color adjust for smooth transition. Add a comment for this if we can’t get to this
15
+
16
+ /// Module Settings
17
+ /// @type Map
18
+ /// @prop {Dimension} padding [2rem] The padding for the image icon
19
+ /// @prop {Dimension} margin-y [3rem] Top and bottom margin for the card.
20
+ /// @prop {Dimension} border-radius [5rem] The border radius of the card.
21
+ /// @prop {String} horizontal-breakpoint [small] The breakpoint used to change the card to vertical if using the card--horizontal styling. Uses ulu's breakpoint module.
22
+ /// @prop {CssValue} box-shadow [null] The box-shadow for the card.
23
+ /// @prop {CssValue} box-shadow-hover [null] The box-shadow for the card when hovered or focused.
24
+ /// @prop {Color} color [null] The type color of the card.
25
+ /// @prop {Color} color-hover [null] The type color of the card when hovered or focused.
26
+ /// @prop {Color} color-overlay [white] The type color of the card when using card--overlay.
27
+ /// @prop {Color} color-overlay-hover [null] The type color of the card when hovered or focused and when using card--overlay.
28
+ /// @prop {Color} overlay-background-color [rgba(0, 0, 0, 0.6)] The background color for the text box when using card--overlay.
29
+ /// @prop {Color} background-color [white] The background color of the card.
30
+ /// @prop {Color} background-color-hover [rgb(242, 244, 246)] The background color of the card when hovered or focused.
31
+ /// @prop {Dimension} max-width [28rem] The max-width of the card.
32
+ /// @prop {Dimension} body-min-height [10rem] the min-height of the card body.
33
+ /// @prop {CssValue} border [1px solid #ccc] The card border.
34
+ /// @prop {CssValue} border-hover [2px solid #278cca] The card border when hovered or focused.
35
+ /// @prop {Dimension} header-margin [0.75em] The margin for the card header.
36
+ /// @prop {Color} title-color [null] The type color of the title.
37
+ /// @prop {Color} title-color-hover [null] The type color of the title (if link/button) when hovered or focused
38
+ /// @prop {Dimension} title-margin [0] The margin for the title.
39
+ /// @prop {CssValue} title-font-weight [bold] The font weight for the title.
40
+ /// @prop {Number} image-ratio [56.25%] The image ratio for the card image.
41
+ /// @prop {Color} image-background-color [rgb(197, 197, 197)] The background color behind the image.
42
+ /// @prop {Dimension} image-margin [null] The margin for the image.
43
+ /// @prop {Dimension} image-border [null] // For when you have a margin, the border for the image.
44
+ /// @prop {CssValue} image-transform-hover [null] Animation for the image when hovered or focused.
45
+ /// @prop {CssValue} image-filter-hover [null] Filter for the image when hovered or focused.
46
+ /// @prop {Color} overlay-background-color-hover [null] The color of the pseudo-element when using proxy click.
47
+ /// @prop {Boolean} clickable-card-enabled [true] Enable or disable proxy click.
48
+ /// @prop {String} clickable-card-selector [data-ulu-proxy-click-init] The selector for proxy-click.js to find the card and implement the clickable card script.
49
+ /// @prop {String} clickable-card-interact-selector [&:hover, &:focus-within] The selectors for the cards being interacted with.
50
+ /// @prop {Dimension} footer-padding-y [0.25rem] The top and bottom padding for the footer.
51
+ /// @prop {Dimension} footer-min-height [2.5rem] The min height for the footer
52
+ /// @prop {String} prefix [card] The class name used to add card styling.
53
+ /// @prop {Boolean} transition-enabled [true] Enable or disable transition for card.
54
+ /// @prop {CssValue} transition-timing-function [ease-in-out] The timing function for the card animation.
55
+ /// @prop {Time} transition-duration [200ms] The animation duration for the card animation.
56
+ /// @prop {List} transition-properties [(border-color, background-color, color, box-shadow, transform)] The properties for the card animation.
57
+ /// @prop {Boolean} image-transition-enabled [true] Enable or disable the image transition.
58
+ /// @prop {Time} image-transition-duration [350ms] The duration of the image transition.
59
+ /// @prop {CssValue} image-transition-timing-function [ease-in-out] The timing function for the image transition.
60
+ /// @prop {List} image-transition-properties [(transform, filter)] The properties for the image transitions.
61
+
62
+
63
+
64
+ $config: (
65
+ "background-color" : white,
66
+ "background-color-hover" : rgb(242, 244, 246),
67
+ "body-min-height" : 10rem,
68
+ "border" : 1px solid #ccc,
69
+ "border-hover" : 2px solid #278cca,
70
+ "border-radius" : 5px,
71
+ "box-shadow" : null,
72
+ "box-shadow-hover" : null,
73
+ "clickable-card-enabled" : true,
74
+ "clickable-card-selector" : "[data-ulu-proxy-click-init]",
75
+ "clickable-card-interact-selector" : "&:hover, &:focus-within",
76
+ "color" : null,
77
+ "color-hover" : null,
78
+ "footer-padding-y" : 0.25rem,
79
+ "footer-min-height" : 2.5rem,
80
+ "horizontal-breakpoint" : "small",
81
+ "header-margin" : 0.75em,
82
+ "image-ratio" : 56.25%,
83
+ "image-aspect-ratio": list.slash(5, 3),
84
+ "image-background-color" : rgb(197, 197, 197),
85
+ "image-border" : null, // For when you have a margin
86
+ "image-filter-hover" : null,
87
+ "image-margin" : null,
88
+ "image-transform-hover" : null,
89
+ "image-transition-duration" : 350ms,
90
+ "image-transition-enabled" : true,
91
+ "image-transition-properties" : (transform, filter),
92
+ "image-transition-timing-function" : ease-in-out,
93
+ "margin-y" : 3rem,
94
+ "max-width" : 28rem,
95
+ "padding" : 2rem,
96
+ "title-color" : null,
97
+ "title-color-hover" : null,
98
+ "title-color-card-hover" : null,
99
+ "title-margin" : 1rem,
100
+ "title-font-weight" : bold,
101
+ "transition-enabled": true,
102
+ "transition-timing-function" : ease-in-out,
103
+ "transition-duration" : 200ms,
104
+ "transition-properties" : (border-color, background-color, color, box-shadow, transform),
105
+ "overlay-aspect-ratio": list.slash(4, 3),
106
+ "overlay-background-color-hover" : null,
107
+ "color-overlay" : white,
108
+ "color-overlay-hover" : null,
109
+ "overlay-background-color": rgba(0, 0, 0, 0.6),
110
+ "overlay-shading": true,
111
+ "overlay-body-padding-y": 1rem,
112
+ ) !default;
113
+
114
+ /// Change modules $config
115
+ /// @param {Map} $changes Map of changes
116
+ /// @example
117
+ /// @include ulu.component-card-set(( "property" : value ));
118
+
119
+ @mixin set($changes) {
120
+ $config: map.merge($config, $changes) !global;
121
+ }
122
+
123
+ /// Get a config option
124
+ /// @param {Map} $name Name of property
125
+ /// @example
126
+ /// @include ulu.component-card-get(( "property" : value ));
127
+
128
+ @function get($name) {
129
+ @return utils.require-map-get($config, $name, "card [config]");
130
+ }
131
+
132
+ /// Mixin styles for card when it has proxy click enabled and is being interacted with (hover/focus)
133
+ /// @param {Boolean} $hover [false] Apply styles when the card is being hover/focused within, else applies styles to rest state of a clickable card (one who has a proxy click setup)
134
+
135
+ @mixin when-clickable($hover: false) {
136
+ $prefix: selector.class("card");
137
+ @if (get("clickable-card-enabled") and get("clickable-card-selector")) {
138
+ #{ $prefix } {
139
+ &#{ get("clickable-card-selector") } {
140
+ @if ($hover) {
141
+ #{ get("clickable-card-interact-selector") } {
142
+ @content;
143
+ }
144
+ } @else {
145
+ @content;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+
153
+ @mixin shared-transition-styles() {
154
+ transition-duration: get("transition-duration");
155
+ transition-timing-function: get("transition-timing-function");
156
+ }
157
+ /// Prints component styles
158
+ /// @demo card
159
+ /// @example scss
160
+ /// @example
161
+ /// @include ulu.component-card-styles();
162
+
163
+ @mixin styles {
164
+ $prefix: selector.class("card");
165
+
166
+ #{ $prefix } {
167
+ color: get("color");
168
+ background-color: get("background-color");
169
+ border-radius: get("border-radius");
170
+ box-shadow: get("box-shadow");
171
+ margin-top: get("margin-y");
172
+ margin-bottom: get("margin-y");
173
+ position: relative;
174
+ display: flex; // Reorder image
175
+ flex-direction: column;
176
+ justify-content: flex-end;
177
+ max-width: get("max-width");
178
+ }
179
+ @if (get("border") or get("border-hover") or get("overlay-background-color-hover")) {
180
+ @include when-clickable($hover: false) {
181
+ &:after {
182
+ position: absolute;
183
+ content: if(get("border"), "", false);
184
+ top: 0;
185
+ bottom: 0;
186
+ right: 0;
187
+ left: 0;
188
+ border: get("border");
189
+ border-radius: get("border-radius");
190
+ z-index: 4;
191
+ pointer-events: none;
192
+ }
193
+ }
194
+ }
195
+
196
+ @include when-clickable($hover: true) {
197
+ background-color: get("background-color-hover");
198
+ color: get("color-hover");
199
+ box-shadow: get("box-shadow-hover");
200
+
201
+ @if (get("border-hover") or get("overlay-background-color-hover")) {
202
+ &:after {
203
+ content: "";
204
+ border: get("border-hover");
205
+ background-color: get("overlay-background-color-hover");
206
+ }
207
+ }
208
+ }
209
+
210
+ // Setting transitions regardless of clickable card selector
211
+ // This shouldn't interfere since styles aren't changed if not clickable (ie. .card [border-color, etc])
212
+ @if get("transition-enabled") {
213
+ #{ $prefix },
214
+ #{ $prefix }::after,
215
+ #{ $prefix }__title {
216
+ @include shared-transition-styles();
217
+ transition-property: get("transition-properties");
218
+ }
219
+ }
220
+
221
+ #{ $prefix }__title {
222
+ color: get("title-color");
223
+ margin-bottom: get("title-margin");
224
+ display: block;
225
+ font-weight: get("title-font-weight");
226
+ @if get("title-color-hover") {
227
+ &:hover,
228
+ &:focus {
229
+ color: get("title-color-hover");
230
+ }
231
+ }
232
+ #{ $prefix }__title-link {
233
+ all: unset;
234
+ }
235
+ }
236
+ @if get("title-color-hover") {
237
+ @include when-clickable($hover: true) {
238
+ #{ $prefix }__title {
239
+ color: get("title-color-hover");
240
+ }
241
+ }
242
+ }
243
+
244
+ #{ $prefix }__header + #{ $prefix }__content {
245
+ margin-top: get("header-margin");
246
+ }
247
+
248
+ // Fix since sometimes these have nested markup sometimes just raw text
249
+ #{ $prefix }__image {
250
+ order: -1;
251
+ position: relative;
252
+ z-index: 1;
253
+ overflow: hidden;
254
+ // padding-top: get("image-ratio"); // 9:16
255
+ margin: get("image-margin");
256
+ border: get("image-border");
257
+ background-color: get("image-background-color");
258
+ border-top-right-radius: get("border-radius");
259
+ border-top-left-radius: get("border-radius");
260
+ aspect-ratio: get("image-aspect-ratio");
261
+ width: 100%;
262
+ }
263
+ #{ $prefix }__image img,
264
+ #{ $prefix}__image-media {
265
+ position: absolute;
266
+ top: 0;
267
+ left: 0;
268
+ width: 100%;
269
+ height: 100%;
270
+ border: 0;
271
+ object-fit: cover;
272
+ transform-origin: center center;
273
+ @if (get("image-transition-enabled")) {
274
+ transition-duration: get("image-transition-duration");
275
+ transition-timing-function: get("image-transition-timing-function");
276
+ transition-property: get("image-transition-properties");
277
+ }
278
+ }
279
+ @if (get("image-transform-hover") or get("image-filter-hover")) {
280
+ @include when-clickable($hover: true) {
281
+ #{ $prefix }__image img,
282
+ #{ $prefix}__image-media {
283
+ transform: get("image-transform-hover");
284
+ filter: get("image-filter-hover");
285
+ }
286
+ }
287
+ }
288
+ #{ $prefix }__body,
289
+ #{ $prefix }__footer,
290
+ #{ $prefix }__image--icon {
291
+ padding: get("padding");
292
+ }
293
+
294
+ #{ $prefix }__image--icon {
295
+ background-color: transparent;
296
+ display: flex;
297
+ align-items: center;
298
+ justify-content: center;
299
+ img {
300
+ position: static;
301
+ display: block;
302
+ max-width: 30rem;
303
+ height: auto;
304
+ top: auto;
305
+ left: auto;
306
+ }
307
+ }
308
+ #{ $prefix }__body,
309
+ #{ $prefix }__footer {
310
+ position: relative;
311
+ z-index: 2; // Above image
312
+ }
313
+ #{ $prefix }__body {
314
+ flex-grow: 1;
315
+ min-height: get("body-min-height");
316
+ }
317
+ // For actions/messages
318
+ // - Layout as flex with min height to support buttons
319
+ // and text without relying so much on padding
320
+ #{ $prefix }__footer {
321
+ flex: 0;
322
+ z-index: 4;
323
+ padding-top: get("footer-padding-y");
324
+ padding-bottom: get("footer-padding-y");
325
+ min-height: get("footer-min-height");
326
+ display: flex;
327
+ align-items: center;
328
+ justify-content: flex-end;
329
+ }
330
+ // body + footer {
331
+ // means body keeps before pseudo element while footer loses it
332
+ #{ $prefix }--overlay {
333
+ // overflow: hidden;
334
+ aspect-ratio: get("overlay-aspect-ratio");
335
+ height: min-content;
336
+ #{ $prefix }__body {
337
+ position: relative;
338
+ flex-grow: 0;
339
+ z-index: 2;
340
+ color: get("color-overlay");
341
+ background-color: get("overlay-background-color");
342
+ min-height: 0;
343
+ padding-top: get("overlay-body-padding-y");
344
+ padding-bottom: get("overlay-body-padding-y");
345
+ @if (get("overlay-shading")) {
346
+ margin-top: 4rem;
347
+ &::before {
348
+ content: "";
349
+ position: absolute;
350
+ bottom: 100%;
351
+ left: 0;
352
+ right: 0;
353
+ height: 4rem;
354
+ background: linear-gradient(to top, get("overlay-background-color") 0%, rgba(0, 0, 0, 0));
355
+ }
356
+ }
357
+ }
358
+ #{ $prefix }__footer {
359
+ background-color: get("overlay-background-color");
360
+ color: get("color-overlay");
361
+ }
362
+ #{ $prefix }__title {
363
+ color: get("color-overlay");
364
+ }
365
+ #{ $prefix }__image {
366
+ position: absolute;
367
+ top: 0;
368
+ left: 0;
369
+ bottom: 0;
370
+ right: 0;
371
+ overflow: hidden;
372
+ padding-top: 0;
373
+ background-color: rgb(255, 255, 255);
374
+ border-radius: get("border-radius");
375
+ aspect-ratio: auto;
376
+ img {
377
+ z-index: 1;
378
+ position: relative;
379
+ width: 100%;
380
+ height: 100%;
381
+ border: 0;
382
+ object-fit: cover;
383
+ &::before {
384
+ position: absolute;
385
+ display: block;
386
+ top: 0;
387
+ bottom: 0;
388
+ left: 0;
389
+ right: 0;
390
+ background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.9));
391
+ }
392
+ }
393
+ }
394
+ }
395
+
396
+ @if (get("horizontal-breakpoint")) {
397
+ @include breakpoint.min(get("horizontal-breakpoint")) {
398
+ #{ $prefix }--horizontal {
399
+ display: flex;
400
+ justify-content: center;
401
+ align-items: center;
402
+ #{ $prefix }__image {
403
+ width: 33%;
404
+ flex: 0 1 33%;
405
+ // max-width: 30rem;
406
+ min-height: 28rem;
407
+ // padding-top: 0;
408
+ }
409
+ #{ $prefix }__body {
410
+ display: flex;
411
+ flex: 1;
412
+ flex-direction: column;
413
+ justify-content: center;
414
+ max-width: 80rem;
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+