@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,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
+ }