@ulu/frontend 0.0.23 → 0.1.0-beta.0

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 (211) hide show
  1. package/deprecated/js/drupal-programmatic-modal.js +91 -0
  2. package/{js/ui/modals.js → deprecated/js/micromodal-modals.js} +41 -67
  3. package/dist/ulu-frontend.min.css +1 -1
  4. package/dist/ulu-frontend.min.js +70 -1
  5. package/index.js +6 -1
  6. package/js/events/index.js +58 -7
  7. package/js/index.js +3 -7
  8. package/js/{helpers/css-breakpoint.js → ui/breakpoints.js} +9 -11
  9. package/js/ui/collapsible.js +195 -0
  10. package/js/ui/dialog.js +157 -0
  11. package/js/ui/dialog.todo +37 -0
  12. package/js/ui/flipcard.js +55 -11
  13. package/js/ui/grid.js +2 -47
  14. package/js/ui/index.js +21 -0
  15. package/js/ui/modal-builder.js +197 -0
  16. package/js/ui/overflow-scroller-pager.js +1 -1
  17. package/js/ui/overflow-scroller.js +8 -5
  18. package/js/ui/page.js +14 -0
  19. package/js/ui/popover.js +135 -0
  20. package/js/ui/print-details.js +44 -0
  21. package/js/ui/print.js +67 -0
  22. package/js/ui/programmatic-modal.js +79 -81
  23. package/js/ui/proxy-click.js +80 -0
  24. package/js/ui/resizer.js +3 -3
  25. package/js/ui/scroll-slider.js +56 -0
  26. package/js/ui/scrollpoint.js +300 -0
  27. package/js/ui/slider.js +72 -10
  28. package/js/ui/tabs.js +85 -58
  29. package/js/ui/theme-toggle.js +129 -0
  30. package/js/ui/tooltip.js +268 -67
  31. package/js/utils/{logger.js → class-logger.js} +6 -5
  32. package/js/utils/dom.js +122 -0
  33. package/js/utils/file-save.js +67 -0
  34. package/js/utils/floating-ui.js +83 -0
  35. package/js/utils/id.js +22 -0
  36. package/js/utils/index.js +7 -0
  37. package/js/{helpers → utils}/pause-youtube-video.js +1 -1
  38. package/package.json +32 -11
  39. package/resources/drupal/twig-macros/accordion.twig +99 -0
  40. package/resources/drupal/twig-macros/dropdown.twig +44 -0
  41. package/resources/drupal/twig-macros/flipcard.twig +69 -0
  42. package/resources/drupal/twig-macros/image.twig +30 -0
  43. package/resources/drupal/twig-macros/layout.twig +338 -0
  44. package/resources/drupal/twig-macros/slider.twig +214 -0
  45. package/resources/drupal/twig-macros/tabs.twig +84 -0
  46. package/scss/README.md +13 -1
  47. package/scss/_breakpoint.scss +69 -26
  48. package/scss/_button.scss +148 -57
  49. package/scss/_color.scss +46 -28
  50. package/scss/_cssvar.scss +103 -12
  51. package/scss/_element.scss +84 -67
  52. package/scss/_index.scss +0 -3
  53. package/scss/_layout.scss +57 -26
  54. package/scss/_path.scss +2 -2
  55. package/scss/_selector.scss +20 -11
  56. package/scss/_typography.scss +115 -82
  57. package/scss/_units.scss +14 -13
  58. package/scss/_utils.scss +280 -18
  59. package/scss/base/_color.scss +2 -1
  60. package/scss/base/_elements.scss +61 -35
  61. package/scss/base/_index.scss +60 -23
  62. package/scss/base/_keyframes.scss +115 -16
  63. package/scss/base/_layout.scss +10 -6
  64. package/scss/base/_normalize.scss +6 -122
  65. package/scss/base/_print.scss +49 -0
  66. package/scss/base/_root.scss +28 -0
  67. package/scss/base/_typography.scss +4 -1
  68. package/scss/components/_accordion.scss +217 -0
  69. package/scss/components/_adaptive-spacing.scss +148 -0
  70. package/scss/components/_badge.scss +17 -14
  71. package/scss/components/_button-verbose.scss +138 -0
  72. package/scss/components/_button.scss +9 -4
  73. package/scss/components/_callout.scss +175 -0
  74. package/scss/components/_captioned-figure.scss +173 -0
  75. package/scss/components/_card-grid.scss +75 -0
  76. package/scss/components/_card.scss +420 -0
  77. package/scss/components/_css-icon.scss +433 -0
  78. package/scss/{_grid.scss → components/_data-grid.scss} +100 -68
  79. package/scss/components/_data-table.scss +180 -0
  80. package/scss/components/_fill-context.scss +20 -22
  81. package/scss/components/_flipcard-grid.scss +66 -0
  82. package/scss/components/_flipcard.scss +304 -0
  83. package/scss/components/_form-theme.scss +633 -0
  84. package/scss/components/_hero.scss +183 -0
  85. package/scss/components/_horizontal-rule.scss +51 -0
  86. package/scss/components/_image-grid.scss +71 -0
  87. package/scss/components/_index.scss +276 -38
  88. package/scss/components/_links.scss +1 -1
  89. package/scss/components/_list-lines.scss +14 -3
  90. package/scss/components/_list-ordered.scss +3 -1
  91. package/scss/components/_list-unordered.scss +3 -1
  92. package/scss/components/_menu-stack.scss +245 -0
  93. package/scss/components/_modal.scss +495 -0
  94. package/scss/components/_nav-strip.scss +148 -0
  95. package/scss/components/_overlay-section.scss +122 -0
  96. package/scss/components/_pager.scss +168 -0
  97. package/scss/components/_placeholder-block.scss +121 -0
  98. package/scss/components/_popover.scss +263 -0
  99. package/scss/components/_pull-quote.scss +111 -0
  100. package/scss/components/_ratio-box.scss +64 -0
  101. package/scss/components/_rule.scss +12 -9
  102. package/scss/components/_scroll-slider.scss +204 -0
  103. package/scss/components/_skip-link.scss +92 -0
  104. package/scss/components/_slider.scss +241 -0
  105. package/scss/components/_spoke-spinner.scss +193 -0
  106. package/scss/components/_tabs.scss +179 -0
  107. package/scss/components/_tag.scss +142 -0
  108. package/scss/components/_tile-button.scss +131 -0
  109. package/scss/components/_tile-grid-overlay.scss +132 -0
  110. package/scss/components/_tile-grid.scss +172 -0
  111. package/scss/components/_vignette.scss +65 -0
  112. package/scss/components/_wysiwyg.scss +94 -0
  113. package/scss/helpers/_color.scss +1 -0
  114. package/scss/helpers/_display.scss +2 -1
  115. package/scss/helpers/_index.scss +45 -22
  116. package/scss/helpers/_print.scss +20 -43
  117. package/scss/helpers/_typography.scss +3 -0
  118. package/scss/helpers/_units.scss +10 -13
  119. package/scss/helpers/_utilities.scss +5 -1
  120. package/scss/stylesheets/base-styles.scss +7 -0
  121. package/scss/stylesheets/component-styles.scss +7 -0
  122. package/scss/stylesheets/helper-styles.scss +7 -0
  123. package/types/events/index.d.ts +1 -1
  124. package/types/events/index.d.ts.map +1 -1
  125. package/types/index.d.ts +2 -2
  126. package/types/{helpers/css-breakpoint.d.ts → ui/breakpoints.d.ts} +3 -3
  127. package/types/ui/breakpoints.d.ts.map +1 -0
  128. package/types/ui/collapsible.d.ts +67 -0
  129. package/types/ui/collapsible.d.ts.map +1 -0
  130. package/types/ui/dialog.d.ts +42 -0
  131. package/types/ui/dialog.d.ts.map +1 -0
  132. package/types/ui/flipcard.d.ts +8 -1
  133. package/types/ui/flipcard.d.ts.map +1 -1
  134. package/types/ui/grid.d.ts +0 -11
  135. package/types/ui/grid.d.ts.map +1 -1
  136. package/types/ui/index.d.ts +23 -0
  137. package/types/ui/index.d.ts.map +1 -0
  138. package/types/ui/modal-builder.d.ts +54 -0
  139. package/types/ui/modal-builder.d.ts.map +1 -0
  140. package/types/ui/overflow-scroller-pager.d.ts +1 -1
  141. package/types/ui/overflow-scroller-pager.d.ts.map +1 -1
  142. package/types/ui/overflow-scroller.d.ts +3 -1
  143. package/types/ui/overflow-scroller.d.ts.map +1 -1
  144. package/types/ui/page.d.ts +5 -0
  145. package/types/ui/page.d.ts.map +1 -0
  146. package/types/ui/popover.d.ts +40 -0
  147. package/types/ui/popover.d.ts.map +1 -0
  148. package/types/ui/print-details.d.ts +10 -0
  149. package/types/ui/print-details.d.ts.map +1 -0
  150. package/types/ui/print.d.ts +10 -0
  151. package/types/ui/print.d.ts.map +1 -0
  152. package/types/ui/programmatic-modal.d.ts +19 -1
  153. package/types/ui/programmatic-modal.d.ts.map +1 -1
  154. package/types/ui/proxy-click.d.ts +18 -0
  155. package/types/ui/proxy-click.d.ts.map +1 -0
  156. package/types/ui/resizer.d.ts +1 -1
  157. package/types/ui/resizer.d.ts.map +1 -1
  158. package/types/ui/scroll-slider.d.ts +13 -0
  159. package/types/ui/scroll-slider.d.ts.map +1 -0
  160. package/types/ui/scrollpoint.d.ts +133 -0
  161. package/types/ui/scrollpoint.d.ts.map +1 -0
  162. package/types/ui/slider.d.ts +14 -2
  163. package/types/ui/slider.d.ts.map +1 -1
  164. package/types/ui/tabs.d.ts +22 -0
  165. package/types/ui/tabs.d.ts.map +1 -1
  166. package/types/ui/theme-toggle.d.ts +14 -0
  167. package/types/ui/theme-toggle.d.ts.map +1 -0
  168. package/types/ui/tooltip.d.ts +92 -10
  169. package/types/ui/tooltip.d.ts.map +1 -1
  170. package/types/utils/{logger.d.ts → class-logger.d.ts} +1 -1
  171. package/types/utils/class-logger.d.ts.map +1 -0
  172. package/types/utils/dom.d.ts +48 -0
  173. package/types/utils/dom.d.ts.map +1 -0
  174. package/types/utils/file-save.d.ts +64 -0
  175. package/types/utils/file-save.d.ts.map +1 -0
  176. package/types/utils/floating-ui.d.ts +19 -0
  177. package/types/utils/floating-ui.d.ts.map +1 -0
  178. package/types/utils/id.d.ts +10 -0
  179. package/types/utils/id.d.ts.map +1 -0
  180. package/types/utils/index.d.ts +9 -0
  181. package/types/utils/index.d.ts.map +1 -0
  182. package/types/utils/pause-youtube-video.d.ts.map +1 -0
  183. package/js/helpers/file-save.js +0 -52
  184. package/js/helpers/scrollbar-width-property.js +0 -14
  185. package/project.todo +0 -22
  186. package/scss/_calculate.scss +0 -64
  187. package/scss/_utility.scss +0 -12
  188. package/types/helpers/css-breakpoint.d.ts.map +0 -1
  189. package/types/helpers/file-save.d.ts +0 -17
  190. package/types/helpers/file-save.d.ts.map +0 -1
  191. package/types/helpers/node-data-manager.d.ts +0 -45
  192. package/types/helpers/node-data-manager.d.ts.map +0 -1
  193. package/types/helpers/pause-youtube-video.d.ts.map +0 -1
  194. package/types/helpers/scrollbar-width-property.d.ts +0 -11
  195. package/types/helpers/scrollbar-width-property.d.ts.map +0 -1
  196. package/types/ui/modals.d.ts +0 -27
  197. package/types/ui/modals.d.ts.map +0 -1
  198. package/types/utils/logger.d.ts.map +0 -1
  199. package/vite.config.js +0 -36
  200. /package/{js/deprecated → deprecated/js}/doc-ready.js +0 -0
  201. /package/{js/deprecated → deprecated/js}/jquery-prototypes.js +0 -0
  202. /package/{js/deprecated → deprecated/js}/mini-collapsible-popper-positioning.js +0 -0
  203. /package/{js/deprecated → deprecated/js}/mini-collapsible.js +0 -0
  204. /package/{js/helpers → deprecated/js}/node-data-manager.js +0 -0
  205. /package/{js/deprecated → deprecated/js}/script-loader.js +0 -0
  206. /package/{js/deprecated → deprecated/js}/waypoints/README.md +0 -0
  207. /package/{js/deprecated → deprecated/js}/waypoints/anchor-menu.js +0 -0
  208. /package/{js/deprecated → deprecated/js}/waypoints/element-waypoint.js +0 -0
  209. /package/{js/deprecated → deprecated/js}/waypoints/examples/page-link-menu.md +0 -0
  210. /package/{js/deprecated → deprecated/js}/waypoints/state-in-attribute.js +0 -0
  211. /package/types/{helpers → utils}/pause-youtube-video.d.ts +0 -0
@@ -9,66 +9,69 @@
9
9
 
10
10
  /// Module Settings
11
11
  /// @type Map
12
- /// @prop {Number} $config.backdrop-blur Backdrop blur amount used on elements/components
13
- /// @prop {Color} $config.backdrop-color Backdrop color (modal overlays, etc)
14
- /// @prop {List} $config.box-shadow Box-shadow definition for elements that are on top of page
15
- /// @prop {List} $config.box-shadow-raised Box-shadow definition for elements that are raised off of the page (dropdowns, etc)
16
- /// @prop {List} $config.box-shadow-above Box-shadow definition for elements that are above the page (fixed items, etc)
17
- /// @prop {Number} $config.border-radius Common element border radius
18
- /// @prop {Number} $config.border-radius-small Common element border radius (small)
19
- /// @prop {Number} $config.border-radius-large Common element border radius (large)
20
- /// @prop {List} $config.text-shadow Common text shadow
21
- /// @prop {Number} $config.margin-small Common element margin (small) (default for lists)
22
- /// @prop {Number} $config.margin Common element margin
23
- /// @prop {Number} $config.margin-large Common element margin (large)
24
- /// @prop {String} $config.ol-list-style-type Ordered list type (level 1)
25
- /// @prop {String} $config.ol-list-style-type-2 Ordered list type (level 2)
26
- /// @prop {String} $config.ol-list-style-type-3 Ordered list type (level 3)
27
- /// @prop {String} $config.ul-list-style-type
28
- /// @prop {String} $config.ul-list-style-type-2
29
- /// @prop {String} $config.ul-list-style-type-3
30
- /// @prop {String} $config.link-text-decoration-default Whether links use underline, remember that removing underline will create an accessiblity issue (not relying on color)
31
- /// @prop {String} $config.link-text-decoration
32
- /// @prop {String} $config.link-text-decoration-style
33
- /// @prop {Color} $config.link-text-decoration-color
34
- /// @prop {String} $config.link-text-decoration-style-hover
35
- /// @prop {Color} $config.link-text-decoration-color-hover
36
- /// @prop {Number} $config.link-text-decoration-thickness
37
- /// @prop {Number} $config.link-text-underline-offset
12
+ /// @prop {Number} backdrop-blur Backdrop blur amount used on elements/components
13
+ /// @prop {Color} backdrop-color Backdrop color (modal overlays, etc)
14
+ /// @prop {Dimension} list-item-indent [1.5em]
15
+ /// @prop {List} text-shadow Common text shadow
16
+ /// @prop {Number} border-radius Common element border radius
17
+ /// @prop {Number} border-radius-large Common element border radius (large)
18
+ /// @prop {Number} border-radius-small Common element border radius (small)
19
+ /// @prop {List} box-shadow Box-shadow definition for elements that are on top of page
20
+ /// @prop {List} box-shadow-above Box-shadow definition for elements that are above the page (fixed items, etc)
21
+ /// @prop {CssValue} box-shadow-hover [0 1px 5px color.get('box-shadow-hover')]
22
+ /// @prop {CssValue} box-shadow-inset [0 1px 5px color.get('box-shadow')]
23
+ /// @prop {List} box-shadow-raised Box-shadow definition for elements that are raised off of the page (dropdowns, etc)
24
+ /// @prop {String} link-text-decoration
25
+ /// @prop {Color} link-text-decoration-color
26
+ /// @prop {String} link-text-decoration-default Whether links use underline, remember that removing underline will create an accessibility issue (not relying on color)
27
+ /// @prop {Color} link-text-decoration-color-hover
28
+ /// @prop {Number} link-text-underline-offset
29
+ /// @prop {String} link-text-decoration-style
30
+ /// @prop {String} link-text-decoration-style-hover
31
+ /// @prop {Number} link-text-decoration-thickness
32
+ /// @prop {Number} margin Common element margin
33
+ /// @prop {Number} margin-large Common element margin (large)
34
+ /// @prop {Number} margin-small Common element margin (small) (default for lists)
35
+ /// @prop {String} ol-list-style-type Ordered list type (level 1)
36
+ /// @prop {String} ol-list-style-type-2 Ordered list type (level 2)
37
+ /// @prop {String} ol-list-style-type-3 Ordered list type (level 3)
38
+ /// @prop {String} ul-list-style-type
39
+ /// @prop {String} ul-list-style-type-2
40
+ /// @prop {String} ul-list-style-type-3
38
41
 
39
42
  $config: (
40
43
  "backdrop-blur": 4px,
41
44
  "backdrop-color": rgba(73, 73, 73, 0.459),
42
- "box-shadow": 0 1px 5px color.get('box-shadow'),
43
- "box-shadow:hover": 0 1px 5px color.get('box-shadow:hover'),
44
- "box-shadow-raised": 0 1px 12px color.get('box-shadow'),
45
- "box-shadow-above": 0 1px 20px color.get('box-shadow'),
46
- "box-shadow-inset": 0 1px 5px color.get('box-shadow'),
45
+ "list-item-indent" : 1.5em,
46
+ "text-shadow": 0 1px 4px rgba(0,0,0,0.3),
47
47
  "border-radius": 6px,
48
48
  "border-radius-small": 3px,
49
49
  "border-radius-large": 12px,
50
- "text-shadow": 0 1px 4px rgba(0,0,0,0.3),
51
- "margin-small": 0.65em,
50
+ "box-shadow": 0 1px 5px color.get('box-shadow'),
51
+ "box-shadow-above": 0 1px 20px color.get('box-shadow'),
52
+ "box-shadow-hover": 0 1px 5px color.get('box-shadow-hover'),
53
+ "box-shadow-inset": 0 1px 5px color.get('box-shadow'),
54
+ "box-shadow-raised": 0 1px 12px color.get('box-shadow'),
55
+ "link-text-decoration": underline,
56
+ "link-text-decoration-color": initial,
57
+ "link-text-decoration-color-hover": false,
58
+ "link-text-decoration-default": none,
59
+ "link-text-underline-offset" : auto,
60
+ "link-text-decoration-style": dotted,
61
+ "link-text-decoration-style-hover": solid,
62
+ "link-text-decoration-thickness": 0.1em,
52
63
  "margin": 1em,
64
+ "margin-small": 0.65em,
53
65
  "margin-large": 2em,
54
- "list-item-indent" : 1.5em,
55
66
  "ol-list-style-type": decimal,
56
67
  "ol-list-style-type-2": lower-alpha,
57
68
  "ol-list-style-type-3": lower-roman,
58
69
  "ul-list-style-type": disc,
59
70
  "ul-list-style-type-2": circle,
60
71
  "ul-list-style-type-3": square,
61
- "link-text-decoration-default": none,
62
- "link-text-decoration": underline,
63
- "link-text-decoration-style": dotted,
64
- "link-text-decoration-color": initial,
65
- "link-text-decoration-style-hover": solid,
66
- "link-text-decoration-color-hover": false,
67
- "link-text-decoration-thickness": 0.1em,
68
- "link-text-underline-offset" : auto
69
72
  ) !default;
70
73
 
71
- /// Rule style map, redifine defaults or add to
74
+ /// Rule style map, redefine defaults or add to
72
75
  /// @type Map
73
76
 
74
77
  $rule-styles: (
@@ -88,14 +91,15 @@ $rule-margins: (
88
91
 
89
92
  /// Change modules $config
90
93
  /// @param {Map} $changes Map of changes
91
- /// @include module-name.set(( "property" : value ));
94
+ /// @include ulu.element-set(( "property" : value ));
95
+
92
96
  @mixin set($changes) {
93
97
  $config: map.merge($config, $changes) !global;
94
98
  }
95
99
 
96
100
  /// Get a config option
97
101
  /// @param {Map} $name Name of property
98
- /// @include module-name.get("property");
102
+ /// @include ulu.element-get("property");
99
103
 
100
104
  @function get($name) {
101
105
  @return utils.require-map-get($config, $name, "element [config]");
@@ -139,16 +143,47 @@ $rule-margins: (
139
143
  @include rule-style($style-name);
140
144
  @include rule-margin($margin-name);
141
145
  }
146
+
147
+ /// Output CSS for a rule's style (not margins
148
+ /// @param {String} $name ["default"] name of rule style
149
+
142
150
  @mixin rule-style($name: "default") {
143
151
  border-bottom: get-rule-style($name);
144
152
  }
153
+
154
+ /// Output CSS for a rule's margin
155
+ /// @param {String} $name ["default"] name of rule style
156
+
145
157
  @mixin rule-margin($name: null) {
146
158
  $margin: if($name, get-rule-margin($name), get("margin"));
147
159
  margin-top: $margin;
148
160
  margin-bottom: $margin;
149
161
  }
150
162
 
151
- /// Print link styles
163
+ /// Print the default link styling (no hover and focus styles)
164
+ /// - Default link styling just sets the color and the link-text-decoration-default
165
+ /// - This is usually output at the top of the stylesheet to style the general <a> element
166
+ /// - Use link() mixin to print the full link styling (when used in content/text) which includes the full
167
+ /// styling (text-decoration, etc)
168
+ /// @param {Boolean} $visited Include visited style
169
+ /// @param {Boolean} $active Include active style
170
+
171
+ @mixin link-defaults($hover: true, $visited: false) {
172
+ color: color.get("link");
173
+ text-decoration: get("link-text-decoration-default");
174
+ @if ($hover) {
175
+ &:hover {
176
+ color: color.get("link-hover");
177
+ }
178
+ }
179
+ @if ($visited) {
180
+ &:visited {
181
+ color: color.get("link-visited");
182
+ }
183
+ }
184
+ }
185
+
186
+ /// Output link CSS styles (this is the full link styling when used in content/text)
152
187
  /// @param {Boolean} $visited Include visited style
153
188
  /// @param {Boolean} $active Include active style
154
189
 
@@ -160,35 +195,18 @@ $rule-margins: (
160
195
  text-decoration-thickness: get("link-text-decoration-thickness");
161
196
  text-underline-offset: get("link-text-underline-offset");
162
197
  &:hover {
163
- color: color.get("link:hover");
198
+ color: color.get("link-hover");
164
199
  text-decoration-style: get("link-text-decoration-style-hover");
165
200
  text-decoration-color: get("link-text-decoration-color-hover");
166
201
  }
167
202
  @if ($visited) {
168
203
  &:visited {
169
- color: color.get("link:visited");
204
+ color: color.get("link-visited");
170
205
  }
171
206
  }
172
207
  @if ($active) {
173
208
  &:active {
174
- color: color.get("link:active");
175
- }
176
- }
177
- }
178
-
179
- /// Print the defautl link styling (no hover and focus styles)
180
-
181
- @mixin link-defaults($hover: true, $visited: false) {
182
- color: color.get("link");
183
- text-decoration: get("link-text-decoration-default");
184
- @if ($hover) {
185
- &:hover {
186
- color: color.get("link:hover");
187
- }
188
- }
189
- @if ($visited) {
190
- &:visited {
191
- color: color.get("link:visited");
209
+ color: color.get("link-active");
192
210
  }
193
211
  }
194
212
  }
@@ -235,7 +253,6 @@ $rule-margins: (
235
253
  }
236
254
  }
237
255
  ul {
238
- // margin: get("margin-small") 0;
239
256
  list-style-type: get("ul-list-style-type-2") ;
240
257
  }
241
258
  ul ul {
package/scss/_index.scss CHANGED
@@ -14,15 +14,12 @@
14
14
  @forward "cssvar" as cssvar-*;
15
15
  @forward "color" as color-*;
16
16
  @forward "units" as units-*;
17
- @forward "calculate" as calculate-*;
18
17
  @forward "breakpoint" as breakpoint-*;
19
18
  @forward "selector" as selector-*;
20
19
  @forward "element" as element-*;
21
20
  @forward "typography" as typography-*;
22
21
  @forward "button" as button-*;
23
- @forward "utility" as utility-*;
24
22
  @forward "layout" as layout-*;
25
- @forward "grid" as grid-*;
26
23
  @forward "base" as base-*;
27
24
  @forward "components" as component-*;
28
25
  @forward "helpers" as helper-*;
package/scss/_layout.scss CHANGED
@@ -6,30 +6,27 @@
6
6
  @use "sass:list";
7
7
  @use "sass:meta";
8
8
  @use "utils";
9
- @use "calculate";
10
9
  @use "breakpoint";
11
10
 
12
11
  /// Module Settings
13
12
  /// @type Map
14
- /// @prop {Number} $config.max-width Common max-width for site
15
- /// @prop {Number} $config.margin Common margin for site
16
- /// @prop {Number} $config.z-index-fixed Common z-index, above everything
17
- /// @prop {Number} $config.z-index-sticky Common z-index for sticky or stuck items
18
- /// @prop {Number} $config.z-index-above Common z-index, below sticky
13
+ /// @prop {Number} margin [2rem] Common margin for site
14
+ /// @prop {Number} max-width [90rem] Common max-width for site
15
+ /// @prop {Number} z-index-above [1000] Common z-index, below sticky
16
+ /// @prop {Number} z-index-fixed [100] Common z-index, above everything
17
+ /// @prop {Number} z-index-sticky [450] Common z-index for sticky or stuck items
19
18
 
20
19
  $config: (
21
- "max-width": 90rem,
22
20
  "margin": 2rem,
23
- "z-index-sticky": 100,
21
+ "max-width": 90rem,
24
22
  "z-index-above": 450,
25
- "z-index-fixed": 1000
23
+ "z-index-fixed": 1000,
24
+ "z-index-sticky": 100,
26
25
  ) !default;
27
26
 
28
-
29
-
30
27
  /// Change modules $config
31
28
  /// @param {Map} $changes Map of changes
32
- /// @include module-name.set(( "property" : value ));
29
+ /// @include ulu.layout-set(( "property" : value ));
33
30
 
34
31
  @mixin set($changes) {
35
32
  $config: map.merge($config, $changes) !global;
@@ -37,7 +34,7 @@ $config: (
37
34
 
38
35
  /// Get a config option
39
36
  /// @param {Map} $name Name of property
40
- /// @include module-name.get("property");
37
+ /// @include ulu.layout-get("property");
41
38
  @function get($name) {
42
39
  @return utils.require-map-get($config, $name, "layout [config]");
43
40
  }
@@ -70,14 +67,32 @@ $containers: (
70
67
  /// @param {Map} $name Container name
71
68
  /// @param {String} $breakpoint Return only the properties for a specific breakpoint for the container
72
69
 
73
- @function get-container($name, $breakpoint: false) {
74
- $container: utils.require-map-get($containers, $name, "Layout [get-container]");
75
- $breakpoints: map.get($container, "breakpoints");
76
- @if ($breakpoint) {
77
- @return utils.require-map-get($breakpoints, $breakpoint, "[container breakpoint]");
70
+ @function get-container($name, $breakpoint: false, $required: true) {
71
+ $container: null;
72
+ @if ($required) {
73
+ $container: utils.require-map-get($containers, $name, "Layout [get-container]");
78
74
  } @else {
79
- @return $container;
75
+ $container: map.get($containers, $name);
80
76
  }
77
+
78
+ @if ($container and $breakpoint) {
79
+ $breakpoints: map.get($container, "breakpoints");
80
+ @if ($required) {
81
+ @if ($breakpoints) {
82
+ @return utils.require-map-get($breakpoints, $breakpoint, "[container breakpoint]");
83
+ } @else {
84
+ @error 'ULU: No container breakpoints for container "#{ $name }", requested breakpoint #{ $breakpoint }';
85
+ }
86
+ } @else {
87
+ @if ($breakpoints) {
88
+ @return map.get($breakpoints, $breakpoint);
89
+ } @else {
90
+ @return null;
91
+ }
92
+ }
93
+ }
94
+
95
+ @return $container;
81
96
  }
82
97
 
83
98
  /// Returns padding to another property including breakpoints
@@ -103,8 +118,8 @@ $containers: (
103
118
  /// For a given property for every breakpoint in a given container
104
119
  /// creates a css calc value that will match the containers side margin
105
120
  /// The margin is created via empty space when the container hits the max-width
106
- /// If passing inlude padding it would be the containers
107
- /// side (x) + the padding. This accounts for the containers max-width to give an absoute value
121
+ /// If passing include padding it would be the containers
122
+ /// side (x) + the padding. This accounts for the containers max-width to give an absolute value
108
123
  /// @param {String} $property Property name to apply the margin value to
109
124
  /// @param {String} $name The container name
110
125
  /// @param {Boolean} $include-padding [true] Include the containers padding in the margin calculation
@@ -152,16 +167,16 @@ $containers: (
152
167
  $responsive: map.get($container, "responsive");
153
168
  $x: get-container-padding-x($name, $specific-breakpoint);
154
169
  $y: get-container-padding-y($name, $specific-breakpoint);
155
- $resp-amount: if(meta.type-of($responsive) == number, $responsive, calculate.get("responsive-change"));
170
+ $resp-amount: if(meta.type-of($responsive) == number, $responsive, utils.get("responsive-change"));
156
171
 
157
172
  @if $responsive {
158
173
  @if $sides {
159
- @include calculate.responsive-property("padding-left", $x, $resp-amount);
160
- @include calculate.responsive-property("padding-right", $x, $resp-amount);
174
+ @include utils.responsive-property("padding-left", $x, $resp-amount);
175
+ @include utils.responsive-property("padding-right", $x, $resp-amount);
161
176
  }
162
177
  @if $ends {
163
- @include calculate.responsive-property("padding-top", $y, $resp-amount);
164
- @include calculate.responsive-property("padding-bottom", $y, $resp-amount);
178
+ @include utils.responsive-property("padding-top", $y, $resp-amount);
179
+ @include utils.responsive-property("padding-bottom", $y, $resp-amount);
165
180
  }
166
181
  } @else {
167
182
  @if $sides {
@@ -247,4 +262,20 @@ $containers: (
247
262
  &::-webkit-scrollbar {
248
263
  display: none; /* for Chrome, Safari, and Opera */
249
264
  }
265
+ }
266
+
267
+ /// Layout utility for absolute (zero on all sides)
268
+ /// - Probably helpful for gzip if we use this when these exact styles are needed
269
+ /// so they are identical for compression
270
+ @mixin absolute-fill($set-size: false) {
271
+ position: absolute;
272
+ top: 0;
273
+ left: 0;
274
+ @if not $set-size {
275
+ right: 0;
276
+ bottom: 0;
277
+ } @else {
278
+ width: 100%;
279
+ height: 100%;
280
+ }
250
281
  }
package/scss/_path.scss CHANGED
@@ -22,7 +22,7 @@ $aliases: (
22
22
  $aliases: map.merge($aliases, $changes) !global;
23
23
  }
24
24
 
25
- /// Get an aliase's path
25
+ /// Get an aliases path
26
26
  /// @param {String} Name Name of alias
27
27
 
28
28
  @function get-alias($name) {
@@ -35,7 +35,7 @@ $aliases: (
35
35
  /// - Aliases work by starting with "#", Since it's an illegal uri character, needs to be escaped if used as literal, we felt that it was the safest way to mix aliases in with real URLs (so that a dev of a module using path.resolve can always pass paths through (user input unknown if alias)
36
36
  /// @example scss
37
37
  /// .img {
38
- /// background-image: url(path.resolve("#Images/branding/logo"));
38
+ /// background-image: url(ulu.path-resolve("#Images/branding/logo"));
39
39
  /// }
40
40
  ///
41
41
 
@@ -1,5 +1,6 @@
1
1
  ////
2
2
  /// @group selector
3
+ /// This module is used to alter selectors for components
3
4
  ////
4
5
 
5
6
  @use "sass:string";
@@ -7,10 +8,8 @@
7
8
  @use "utils";
8
9
 
9
10
  /// Module Settings
10
- /// - This module can be used for dynamic classnames (used in base and some components). Some components selectors are too complex or coupled for dynamic classnames.
11
- /// @todo See about documenting when a component doesn't run through the selecotr module to get it's base classname
12
11
  /// @type Map
13
- /// @prop {String} $config.prefix Global prefix for selectors (would be used for classname prefix for example)
12
+ /// @prop {String} prefix [""] Global prefix for selectors (would be used for classname prefix for example)
14
13
 
15
14
  $config: (
16
15
  "prefix" : ""
@@ -18,27 +17,35 @@ $config: (
18
17
 
19
18
  // Map to store class overrides ("button" : "site-button") for example
20
19
  $-class-overrides: ();
20
+
21
+ // Map that stores wildcard entries
21
22
  $-class-wildcards: ();
22
23
 
23
24
  /// Change modules $config
24
25
  /// @param {Map} $changes Map of changes
25
- /// @example scss - General example, replace module-name with module's name
26
- /// @include module-name.set(( "property" : value ));
26
+ /// @example scss - General example
27
+ /// @include ulu.selector-set(( "property" : value ));
27
28
  @mixin set($changes) {
28
29
  $config: map.merge($config, $changes) !global;
29
30
  }
30
31
 
31
32
  /// Get a config option
32
33
  /// @param {Map} $name Name of property
33
- /// @example scss - General example, replace module-name with module's name
34
- /// @include module-name.get("property");
34
+ /// @example scss - General example
35
+ /// @include ulu.selector-get("property");
35
36
 
36
37
  @function get($name) {
37
38
  @return utils.require-map-get($config, $name, "selector [config]");
38
39
  }
39
40
 
40
41
  /// Set the class selector overrides
41
- /// @param {Map} $changes Changes to merge
42
+ /// - When a component or user module that is using selector module requests a classname any changes passed here will override the default selector
43
+ /// @param {Map} $changes Changes to merge map of classnames to classname change
44
+ /// @example scss - Changing the color-context classname to background and all typography base/utility classes to 'text' using wildcard
45
+ /// @include ulu.selector-set-class-overrides((
46
+ /// "color-context" : "background",
47
+ /// "type*" : "text"
48
+ /// ));
42
49
 
43
50
  @mixin set-class-overrides($changes) {
44
51
  @each $key, $prop in $changes {
@@ -54,11 +61,11 @@ $-class-wildcards: ();
54
61
 
55
62
  /// Used to allow global prefixing of classes, and also the ability to
56
63
  /// Change a class used in the system (ie. like a component for example)
57
- /// @param {String} $class The classname to set
64
+ /// @param {String} $class The base classname to get (which is then returned modified if the user has adjusted that specific classname
58
65
 
59
66
  @function class($class, $name-only: false) {
60
67
  // Check if it's a wildcard
61
- $wildcard: get-class-wildcard($class);
68
+ $wildcard: -get-class-wildcard($class);
62
69
  $override: map.get($-class-overrides, $class);
63
70
  $updated: if($override, $override, if($wildcard, $wildcard, $class));
64
71
  $name: "#{ get("prefix") }#{ $updated }";
@@ -69,7 +76,9 @@ $-class-wildcards: ();
69
76
  }
70
77
  }
71
78
 
72
- @function get-class-wildcard($class) {
79
+ // Internal function to check all wildcards entries for passed class
80
+
81
+ @function -get-class-wildcard($class) {
73
82
  $change: $class;
74
83
  @each $key, $prop in $-class-wildcards {
75
84
  $index: string.index($class, $key);