@ulu/frontend 0.0.3 → 0.0.5

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 (246) hide show
  1. package/package.json +11 -10
  2. package/scss/_grid.scss +0 -1
  3. package/scss/_typography.scss +0 -1
  4. package/scss/helpers/_units.scss +1 -6
  5. package/scss/stylesheets/full.scss +1 -4
  6. package/trash/js-old/deprecated/doc-ready.js +0 -28
  7. package/trash/js-old/deprecated/jquery-prototypes.js +0 -309
  8. package/trash/js-old/deprecated/mini-collapsible-popper-positioning.js +0 -126
  9. package/trash/js-old/deprecated/mini-collapsible.js +0 -607
  10. package/trash/js-old/deprecated/script-loader.js +0 -60
  11. package/trash/js-old/events/index.js +0 -42
  12. package/trash/js-old/helpers/css-breakpoint.js +0 -247
  13. package/trash/js-old/helpers/file-save.js +0 -48
  14. package/trash/js-old/helpers/node-data-manager.js +0 -74
  15. package/trash/js-old/helpers/pause-youtube-video.js +0 -42
  16. package/trash/js-old/index.js +0 -15
  17. package/trash/js-old/polyfills/element-closest.js +0 -17
  18. package/trash/js-old/ui/flipcard.js +0 -202
  19. package/trash/js-old/ui/grid.js +0 -67
  20. package/trash/js-old/ui/modals.js +0 -219
  21. package/trash/js-old/ui/programmatic-modal.js +0 -91
  22. package/trash/js-old/ui/resizer.js +0 -60
  23. package/trash/js-old/ui/slider.js +0 -469
  24. package/trash/js-old/ui/tabs.js +0 -109
  25. package/trash/js-old/ui/tooltip.js +0 -82
  26. package/trash/js-old/utils/array.js +0 -28
  27. package/trash/js-old/utils/dom.js +0 -122
  28. package/trash/js-old/utils/logger.js +0 -69
  29. package/trash/js-old/utils/object.js +0 -22
  30. package/trash/js-old/utils/performance.js +0 -43
  31. package/trash/js-old/utils/regex.js +0 -10
  32. package/trash/js-old/utils/string.js +0 -107
  33. package/trash/js-old/waypoints/README.md +0 -3
  34. package/trash/js-old/waypoints/anchor-menu.js +0 -76
  35. package/trash/js-old/waypoints/element-waypoint.js +0 -75
  36. package/trash/js-old/waypoints/examples/page-link-menu.md +0 -106
  37. package/trash/js-old/waypoints/state-in-attribute.js +0 -32
  38. package/trash/js-old-230729/deprecated/doc-ready.js +0 -28
  39. package/trash/js-old-230729/deprecated/jquery-prototypes.js +0 -309
  40. package/trash/js-old-230729/deprecated/mini-collapsible-popper-positioning.js +0 -126
  41. package/trash/js-old-230729/deprecated/mini-collapsible.js +0 -607
  42. package/trash/js-old-230729/deprecated/script-loader.js +0 -60
  43. package/trash/js-old-230729/events/index.js +0 -42
  44. package/trash/js-old-230729/helpers/css-breakpoint.js +0 -247
  45. package/trash/js-old-230729/helpers/file-save.js +0 -48
  46. package/trash/js-old-230729/helpers/node-data-manager.js +0 -74
  47. package/trash/js-old-230729/helpers/pause-youtube-video.js +0 -42
  48. package/trash/js-old-230729/helpers/scrollbar-width-property.js +0 -10
  49. package/trash/js-old-230729/index.js +0 -15
  50. package/trash/js-old-230729/polyfills/element-closest.js +0 -17
  51. package/trash/js-old-230729/ui/flipcard.js +0 -202
  52. package/trash/js-old-230729/ui/grid.js +0 -67
  53. package/trash/js-old-230729/ui/modals.js +0 -219
  54. package/trash/js-old-230729/ui/overflow-scroller-pager.js +0 -58
  55. package/trash/js-old-230729/ui/overflow-scroller.js +0 -160
  56. package/trash/js-old-230729/ui/programmatic-modal.js +0 -91
  57. package/trash/js-old-230729/ui/resizer.js +0 -60
  58. package/trash/js-old-230729/ui/slider.js +0 -468
  59. package/trash/js-old-230729/ui/tabs.js +0 -109
  60. package/trash/js-old-230729/ui/tooltip.js +0 -82
  61. package/trash/js-old-230729/utils/array.js +0 -28
  62. package/trash/js-old-230729/utils/dom.js +0 -122
  63. package/trash/js-old-230729/utils/logger.js +0 -69
  64. package/trash/js-old-230729/utils/object.js +0 -22
  65. package/trash/js-old-230729/utils/performance.js +0 -43
  66. package/trash/js-old-230729/utils/regex.js +0 -10
  67. package/trash/js-old-230729/utils/string.js +0 -107
  68. package/trash/js-old-230729/waypoints/README.md +0 -3
  69. package/trash/js-old-230729/waypoints/anchor-menu.js +0 -76
  70. package/trash/js-old-230729/waypoints/element-waypoint.js +0 -75
  71. package/trash/js-old-230729/waypoints/examples/page-link-menu.md +0 -106
  72. package/trash/js-old-230729/waypoints/state-in-attribute.js +0 -32
  73. package/trash/logo-1.svg +0 -13
  74. package/trash/logo.svg +0 -16
  75. package/trash/scss-before-cqc-update/README.md +0 -58
  76. package/trash/scss-before-cqc-update/_breakpoint.scss +0 -190
  77. package/trash/scss-before-cqc-update/_button.scss +0 -229
  78. package/trash/scss-before-cqc-update/_calculate.scss +0 -65
  79. package/trash/scss-before-cqc-update/_color.scss +0 -211
  80. package/trash/scss-before-cqc-update/_cssvar.scss +0 -116
  81. package/trash/scss-before-cqc-update/_element.scss +0 -275
  82. package/trash/scss-before-cqc-update/_index.scss +0 -29
  83. package/trash/scss-before-cqc-update/_layout.scss +0 -247
  84. package/trash/scss-before-cqc-update/_path.scss +0 -59
  85. package/trash/scss-before-cqc-update/_selector.scss +0 -82
  86. package/trash/scss-before-cqc-update/_typography.scss +0 -322
  87. package/trash/scss-before-cqc-update/_units.scss +0 -48
  88. package/trash/scss-before-cqc-update/_utility.scss +0 -13
  89. package/trash/scss-before-cqc-update/_utils.scss +0 -211
  90. package/trash/scss-before-cqc-update/base/_color.scss +0 -14
  91. package/trash/scss-before-cqc-update/base/_elements.scss +0 -189
  92. package/trash/scss-before-cqc-update/base/_index.scss +0 -63
  93. package/trash/scss-before-cqc-update/base/_keyframes.scss +0 -74
  94. package/trash/scss-before-cqc-update/base/_layout.scss +0 -88
  95. package/trash/scss-before-cqc-update/base/_normalize.scss +0 -316
  96. package/trash/scss-before-cqc-update/base/_typography.scss +0 -42
  97. package/trash/scss-before-cqc-update/components/README.md +0 -5
  98. package/trash/scss-before-cqc-update/components/README.todos +0 -15
  99. package/trash/scss-before-cqc-update/components/_button.scss +0 -96
  100. package/trash/scss-before-cqc-update/components/_grid.scss +0 -671
  101. package/trash/scss-before-cqc-update/components/_index.scss +0 -70
  102. package/trash/scss-before-cqc-update/components/_links.scss +0 -35
  103. package/trash/scss-before-cqc-update/components/_list-lines.scss +0 -74
  104. package/trash/scss-before-cqc-update/components/_list-ordered.scss +0 -17
  105. package/trash/scss-before-cqc-update/components/_list-unordered.scss +0 -22
  106. package/trash/scss-before-cqc-update/components/_rule.scss +0 -94
  107. package/trash/scss-before-cqc-update/helpers/_color.scss +0 -15
  108. package/trash/scss-before-cqc-update/helpers/_display.scss +0 -73
  109. package/trash/scss-before-cqc-update/helpers/_index.scss +0 -68
  110. package/trash/scss-before-cqc-update/helpers/_print.scss +0 -59
  111. package/trash/scss-before-cqc-update/helpers/_typography.scss +0 -73
  112. package/trash/scss-before-cqc-update/helpers/_units.scss +0 -79
  113. package/trash/scss-before-cqc-update/helpers/_utilities.scss +0 -88
  114. package/trash/scss-before-cqc-update/stylesheets/README.md +0 -3
  115. package/trash/scss-before-cqc-update/stylesheets/full.scss +0 -17
  116. package/trash/scss-old/README.md +0 -58
  117. package/trash/scss-old/_breakpoint.scss +0 -140
  118. package/trash/scss-old/_button.scss +0 -223
  119. package/trash/scss-old/_calculate.scss +0 -64
  120. package/trash/scss-old/_color.scss +0 -200
  121. package/trash/scss-old/_element.scss +0 -262
  122. package/trash/scss-old/_grid.scss +0 -558
  123. package/trash/scss-old/_index.scss +0 -25
  124. package/trash/scss-old/_layout.scss +0 -170
  125. package/trash/scss-old/_path.scss +0 -58
  126. package/trash/scss-old/_selector.scss +0 -81
  127. package/trash/scss-old/_typography.scss +0 -320
  128. package/trash/scss-old/_units.scss +0 -47
  129. package/trash/scss-old/_utility.scss +0 -12
  130. package/trash/scss-old/_utils.scss +0 -186
  131. package/trash/scss-old/base/_color.scss +0 -13
  132. package/trash/scss-old/base/_elements.scss +0 -183
  133. package/trash/scss-old/base/_index.scss +0 -62
  134. package/trash/scss-old/base/_keyframes.scss +0 -74
  135. package/trash/scss-old/base/_layout.scss +0 -81
  136. package/trash/scss-old/base/_normalize.scss +0 -316
  137. package/trash/scss-old/base/_typography.scss +0 -42
  138. package/trash/scss-old/components/README.md +0 -5
  139. package/trash/scss-old/components/README.todos +0 -15
  140. package/trash/scss-old/components/_button.scss +0 -74
  141. package/trash/scss-old/components/_index.scss +0 -63
  142. package/trash/scss-old/components/_links.scss +0 -34
  143. package/trash/scss-old/components/_list-lines.scss +0 -73
  144. package/trash/scss-old/components/_list-ordered.scss +0 -16
  145. package/trash/scss-old/components/_list-unordered.scss +0 -21
  146. package/trash/scss-old/components/_rule.scss +0 -84
  147. package/trash/scss-old/helpers/_color.scss +0 -14
  148. package/trash/scss-old/helpers/_display.scss +0 -68
  149. package/trash/scss-old/helpers/_index.scss +0 -67
  150. package/trash/scss-old/helpers/_print.scss +0 -59
  151. package/trash/scss-old/helpers/_typography.scss +0 -73
  152. package/trash/scss-old/helpers/_units.scss +0 -68
  153. package/trash/scss-old/helpers/_utilities.scss +0 -82
  154. package/trash/scss-old/packages/README.md +0 -3
  155. package/trash/scss-old/packages/everything.scss +0 -17
  156. package/trash/scss-old-2/README.md +0 -58
  157. package/trash/scss-old-2/_breakpoint.scss +0 -139
  158. package/trash/scss-old-2/_button.scss +0 -223
  159. package/trash/scss-old-2/_calculate.scss +0 -64
  160. package/trash/scss-old-2/_color.scss +0 -202
  161. package/trash/scss-old-2/_element.scss +0 -263
  162. package/trash/scss-old-2/_grid.scss +0 -558
  163. package/trash/scss-old-2/_index.scss +0 -25
  164. package/trash/scss-old-2/_layout.scss +0 -170
  165. package/trash/scss-old-2/_path.scss +0 -58
  166. package/trash/scss-old-2/_selector.scss +0 -81
  167. package/trash/scss-old-2/_typography.scss +0 -320
  168. package/trash/scss-old-2/_units.scss +0 -47
  169. package/trash/scss-old-2/_utility.scss +0 -12
  170. package/trash/scss-old-2/_utils.scss +0 -186
  171. package/trash/scss-old-2/base/_color.scss +0 -13
  172. package/trash/scss-old-2/base/_elements.scss +0 -182
  173. package/trash/scss-old-2/base/_index.scss +0 -62
  174. package/trash/scss-old-2/base/_keyframes.scss +0 -73
  175. package/trash/scss-old-2/base/_layout.scss +0 -83
  176. package/trash/scss-old-2/base/_normalize.scss +0 -315
  177. package/trash/scss-old-2/base/_typography.scss +0 -41
  178. package/trash/scss-old-2/components/README.md +0 -5
  179. package/trash/scss-old-2/components/README.todos +0 -15
  180. package/trash/scss-old-2/components/_button.scss +0 -95
  181. package/trash/scss-old-2/components/_index.scss +0 -63
  182. package/trash/scss-old-2/components/_links.scss +0 -33
  183. package/trash/scss-old-2/components/_list-lines.scss +0 -73
  184. package/trash/scss-old-2/components/_list-ordered.scss +0 -16
  185. package/trash/scss-old-2/components/_list-unordered.scss +0 -21
  186. package/trash/scss-old-2/components/_rule.scss +0 -84
  187. package/trash/scss-old-2/helpers/_color.scss +0 -14
  188. package/trash/scss-old-2/helpers/_display.scss +0 -67
  189. package/trash/scss-old-2/helpers/_index.scss +0 -67
  190. package/trash/scss-old-2/helpers/_print.scss +0 -58
  191. package/trash/scss-old-2/helpers/_typography.scss +0 -72
  192. package/trash/scss-old-2/helpers/_units.scss +0 -68
  193. package/trash/scss-old-2/helpers/_utilities.scss +0 -81
  194. package/trash/scss-old-2/packages/README.md +0 -3
  195. package/trash/scss-old-2/packages/everything.scss +0 -17
  196. package/trash/scss-old-230729/README.md +0 -58
  197. package/trash/scss-old-230729/_breakpoint.scss +0 -139
  198. package/trash/scss-old-230729/_button.scss +0 -223
  199. package/trash/scss-old-230729/_calculate.scss +0 -64
  200. package/trash/scss-old-230729/_color.scss +0 -202
  201. package/trash/scss-old-230729/_element.scss +0 -273
  202. package/trash/scss-old-230729/_grid.scss +0 -694
  203. package/trash/scss-old-230729/_index.scss +0 -25
  204. package/trash/scss-old-230729/_layout.scss +0 -193
  205. package/trash/scss-old-230729/_path.scss +0 -58
  206. package/trash/scss-old-230729/_selector.scss +0 -81
  207. package/trash/scss-old-230729/_typography.scss +0 -320
  208. package/trash/scss-old-230729/_units.scss +0 -47
  209. package/trash/scss-old-230729/_utility.scss +0 -12
  210. package/trash/scss-old-230729/_utils.scss +0 -186
  211. package/trash/scss-old-230729/base/_color.scss +0 -13
  212. package/trash/scss-old-230729/base/_elements.scss +0 -188
  213. package/trash/scss-old-230729/base/_index.scss +0 -62
  214. package/trash/scss-old-230729/base/_keyframes.scss +0 -73
  215. package/trash/scss-old-230729/base/_layout.scss +0 -83
  216. package/trash/scss-old-230729/base/_normalize.scss +0 -315
  217. package/trash/scss-old-230729/base/_typography.scss +0 -41
  218. package/trash/scss-old-230729/components/README.md +0 -5
  219. package/trash/scss-old-230729/components/README.todos +0 -15
  220. package/trash/scss-old-230729/components/_button.scss +0 -95
  221. package/trash/scss-old-230729/components/_index.scss +0 -63
  222. package/trash/scss-old-230729/components/_links.scss +0 -34
  223. package/trash/scss-old-230729/components/_list-lines.scss +0 -73
  224. package/trash/scss-old-230729/components/_list-ordered.scss +0 -16
  225. package/trash/scss-old-230729/components/_list-unordered.scss +0 -21
  226. package/trash/scss-old-230729/components/_rule.scss +0 -93
  227. package/trash/scss-old-230729/helpers/_color.scss +0 -14
  228. package/trash/scss-old-230729/helpers/_display.scss +0 -73
  229. package/trash/scss-old-230729/helpers/_index.scss +0 -67
  230. package/trash/scss-old-230729/helpers/_print.scss +0 -58
  231. package/trash/scss-old-230729/helpers/_typography.scss +0 -72
  232. package/trash/scss-old-230729/helpers/_units.scss +0 -68
  233. package/trash/scss-old-230729/helpers/_utilities.scss +0 -87
  234. package/trash/scss-old-230729/packages/README.md +0 -3
  235. package/trash/scss-old-230729/packages/everything.scss +0 -17
  236. package/trash/vue/directives/background-image-url.js +0 -12
  237. package/trash/vue/helpers/add-required-components.js +0 -14
  238. package/trash/vue/ui/CollapsibleRegion/CollapsibleRegion.vue +0 -277
  239. package/trash/vue/ui/CollapsibleRegion/Demo.vue +0 -101
  240. package/trash/vue/ui/Dropdown/Dropdown.vue +0 -184
  241. package/trash/vue/ui/Modals/components/Modal.vue +0 -49
  242. package/trash/vue/ui/Modals/components/Modals.vue +0 -103
  243. package/trash/vue/ui/Modals/plugin.js +0 -215
  244. package/trash/vue/ui/Modals/readme.note +0 -10
  245. package/trash/vue/ui/Modals/reference/example-usage.vue +0 -27
  246. package/trash/vue/ui/Modals/reference/wcag-example/dialog.js +0 -324
@@ -1,322 +0,0 @@
1
- ////
2
- /// @group typography
3
- ////
4
- /// @todo Finish Documentation
5
- /// @todo Idea: Should the maps value be processes when using the set-sizes, set? Instead of recalculated each time get-size is or get is used.
6
- //// @version 1.0.2
7
- ////
8
-
9
- @use "sass:map";
10
- @use "sass:math";
11
- @use "sass:meta";
12
- @use "sass:string";
13
-
14
- @use "color";
15
- @use "utils";
16
- @use "utility";
17
- @use "calculate";
18
- @use "breakpoint";
19
-
20
- /// Module Settings
21
- /// @type Map
22
- /// @prop {Number} $config.font-size Default font size (use pixels, converted, is used for rem base)
23
- /// @prop {Number} $config.font-family Default font family
24
- /// @prop {Number} $config.font-family-monospace Base font-family for monospace
25
- /// @prop {Number} $config.line-height Default line height
26
- /// @prop {Number} $config.line-height-dense Default dense line height
27
- /// @prop {Number} $config.size-ratio Font size scale when using preset sizes, ratio mixin)
28
- /// @prop {Number} $config.size-line-height-ratio Default line height scaling (when using preset sizes, ratio mixin). Can shrink line-height as size increase if desrireable
29
- /// @prop {Number} $config.responsive-change Amount to scale typography by browser's width (use viewport units)
30
- /// @prop {Number} $config.margin Default margin for typography (like paragraphs)
31
-
32
- $config: (
33
- "font-size" : 16px,
34
- "font-family" : (ui-sans-serif, "Open Sans", Helvetica, Arial, sans-serif),
35
- "font-family-sans" : (ui-sans-serif, "Open Sans", Helvetica, Arial, sans-serif),
36
- "font-family-serif" : (Cambria, Georgia, serif),
37
- "font-family-monospace" : (Menlo, Consolas, Monaco, monospace),
38
- "font-weight" : inherit,
39
- "font-weight-headline" : bold,
40
- "font-weight-light" : 300,
41
- "font-weight-normal" : normal,
42
- "font-weight-semibold" : 600,
43
- "font-weight-bold" : bold,
44
- "line-height" : 1.5,
45
- "line-height-dense": 1.3,
46
- "line-height-spaced": 1.75,
47
- "size-ratio": 2,
48
- "size-line-height-ratio": 0.97,
49
- "scale-steps": 5,
50
- "responsive-change": 0.05vw,
51
- "margin-bottom": 1em,
52
- "margin-top": false,
53
- "letter-spacing-uppercase" : 0.04em,
54
- "max-width" : 60rem,
55
- "max-width-small" : 50rem
56
- ) !default;
57
-
58
- /// Change modules $config
59
- /// @param {Map} $changes Map of changes
60
- /// @include typography.set-options(( "font-size" : 14px ));
61
-
62
- @mixin set($changes) {
63
- $config: map.merge($config, $changes) !global;
64
- }
65
-
66
- /// Get a config option
67
- /// @param {Map} $changes Map of changes
68
- /// @include typography.set-options(( "font-size" : 14px ));
69
-
70
- @function get($name) {
71
- @return utils.require-map-get($config, $name, 'typography [config]');
72
- }
73
-
74
- /// Get scale of the base font-size
75
- /// @param {Number} $step Current size in the scale you want to calculate
76
- /// @return {Number} Scaled value
77
-
78
- @function scale($step) {
79
- @return calculate.ratio-scale-size(get("font-size"), get("size-ratio"), get("scale-steps"), $step);
80
- }
81
-
82
- /// Get scale of the line-height
83
- /// @param {Number} $step Current size in the scale you want to calculate
84
- /// @return {Number} Scaled value
85
- /// @todo Setup breakpoints
86
-
87
- @function scale-line-height($step) {
88
- @return calculate.ratio-scale-size(get("line-height"), get("size-line-height-ratio"), get("scale-steps"), $step);
89
- }
90
-
91
- /// Convert pixel value to rem value based on typography $font-size
92
- /// @param {Number} $pixels Pixel value to convert from
93
- /// @return {Number} Rem value
94
-
95
- @function rem($pixels) {
96
- @if math.unit($pixels) == "px" {
97
- @return math.div($pixels, get("font-size")) * 1rem;
98
- } @else {
99
- @return $pixels + 1rem;
100
- }
101
- }
102
-
103
- /// Changes pixels to em
104
- /// @param {Number} $value Pixel value to convert from
105
- /// @param {Number} $base Conversion base (defaults to font-size)
106
- /// @return {Number} Rem value
107
-
108
- @function em($value, $base: null) {
109
- @if (math.unit($value) == "px") {
110
- $base: if($base, $base, get("font-size"));
111
- @return math.div($base, $value) * 1em;
112
- } @else {
113
- @return $value;
114
- }
115
- }
116
-
117
- /// Break word stradegy
118
- /// @param {Boolean} $force Force words to break (will have unusual breaks)
119
-
120
- @mixin word-break($force: false) {
121
- word-break: if($force, break-all, normal);
122
- word-break: break-word;
123
- hyphens: auto;
124
- }
125
-
126
- /// Creates a size map
127
- /// - This is just an accelerator for creating a size map
128
- /// - You can pass your own size maps using set-sizes()
129
- /// @param {Number} $font-size Font size
130
- /// @param {Number} $line-height Line height
131
- /// @param {Boolean} $is-headline Is a headline
132
-
133
- @function new-size($font-size, $line-height: true, $is-headline: false) {
134
- @return (
135
- "font-size": $font-size,
136
- "font-weight" : if($is-headline, get("font-weight-headline"), null),
137
- "line-height": $line-height,
138
- "responsive" : true,
139
- "helper-class" : if($is-headline, false, true),
140
- "helper-class-prefixed" : true,
141
- "base-class" : if($is-headline, true, false),
142
- "base-class-prefixed" : false
143
- );
144
- }
145
-
146
- /// Default size presets
147
- /// @type Map
148
- /// @prop {Number} $size.name Name of size
149
- /// @prop {Number} $size.name.font-size Font size in rems or pixels
150
- /// @prop {Number} $size.name.line-height Line height (unitless)
151
- /// @prop {Number} $size.name.responsive Apply responsive sizes
152
- /// @prop {Boolean} $size.name.base-class This style should be included in the base (top can be overriden)
153
- /// @prop {Boolean} $size.name.helper-class This style should be included in the helpers (overrides)
154
- /// @todo Add adaptive and use a map of breakpoints and whether it's up or down
155
- /// @todo Add headlines
156
-
157
- $sizes: (
158
- "small-x" : new-size(scale(-2)),
159
- "small" : new-size(scale(-1)),
160
- "base" : new-size(scale(0)),
161
- "large" : new-size(scale(1), scale-line-height(1)),
162
- "large-x" : new-size(scale(2), scale-line-height(2)),
163
- "large-xx" : new-size(scale(3), scale-line-height(3)),
164
- "large-xxx" : new-size(scale(4), scale-line-height(4)),
165
- "h1" : new-size(scale(6), scale-line-height(6), true),
166
- "h2" : new-size(scale(5), scale-line-height(5), true),
167
- "h3" : new-size(scale(4), scale-line-height(4), true),
168
- "h4" : new-size(scale(3), scale-line-height(3), true),
169
- "h5" : new-size(scale(2), scale-line-height(2), true),
170
- "h6" : new-size(scale(1), scale-line-height(1), true)
171
- ) !default;
172
-
173
- /// Update the typography presets map
174
- /// @param {Map} $changes A map to merge into the color palette
175
- /// @param {Map} $deep Use deep merge
176
- /// @param {Map} $overwrite Overwrite the presets completly (cannot be used with deep)
177
- /// @example scss Setting the error and type color
178
- /// @include typography.set((
179
- /// "small" : 0.8rem
180
- /// ));
181
-
182
- @mixin set-sizes($changes, $deep: false, $overwrite: false) {
183
- $sizes: utils.map-merge-or-overwrite($sizes, $changes, $deep, $overwrite) !global;
184
- }
185
-
186
- /// Get a size's map
187
- /// @param {String} $name Name of size
188
- /// @return {Map}
189
-
190
- @function get-size($name) {
191
- @return utils.require-map-get($sizes, $name, 'typography [size]');
192
- }
193
-
194
- /// Print a font-size for a given size
195
- /// @todo Remove doesn't work for breakpoints or responsive
196
- /// @param {String} $value Size name
197
-
198
- @function font-size($name: null) {
199
- $size: get-size($name);
200
- $font-size: map.get($size, "font-size");
201
- @return rem($font-size);
202
- }
203
-
204
- /// Forces conversion to unitless line-height
205
- /// @param {Number} $line-height Line height size in px, em, or rem
206
- /// @param {Number} $font-size Font size in px, em, or rem
207
-
208
- @function unitless-line-height($line-height, $font-size) {
209
- // Font size is rems, line-height is unkown
210
- @if (math.is-unitless($line-height)) {
211
- @return $line-height;
212
- }
213
- $unit: math.unit($line-height);
214
- @if ($unit == "em") {
215
- @return utility.strip-unit($line-height);
216
- } @else if ($unit == "pixels" or $unit == "rem") {
217
- $calc: math.div(rem($line-height), rem($font-size));
218
- @return utility.strip-unit($calc);
219
- } @else {
220
- @error "ULU: Unable to convert to unitless line-height for: #{ $line-height }";
221
- }
222
- }
223
- /// Print a value from the size and convert it (to appropriate unit for framework)
224
- /// @param {Map} $size Size's map
225
- /// @param {String} $props The property to get
226
-
227
- @function get-size-converted-value($size, $prop) {
228
- // Font size is calculated differently
229
- $value: map.get($size, $prop);
230
- $font-size: map.get($size, "font-size");
231
- $type: meta.type-of($value);
232
-
233
- @if ($value == false or $value == null) {
234
- @return null;
235
- // Numbers and true (default) need to be converted
236
- } @else if ($value == true or $type == number) {
237
- // Get default value
238
- @if ($value == true) {
239
- $value: get($prop);
240
- }
241
- // Force line-height to be unitless
242
- @if ($prop == "line-height") {
243
- @return unitless-line-height($value, $font-size);
244
- }
245
- // Convert to REM
246
- @if (math.unit($value) == "px") {
247
- $value: rem($value);
248
- }
249
- @return $value;
250
- } @else {
251
- @return $value;
252
- }
253
- }
254
-
255
-
256
- /// Get a sizes property value that doesn't need conversion
257
- /// - Reason: Will map to default if user set's size prop to true
258
- /// @param {Map} $size Size's map
259
- /// @param {String} $props The property to get
260
-
261
- @function get-size-value($size, $prop) {
262
- $value: map.get($size, $prop);
263
- // Default
264
- @if ($value == true) {
265
- $value: get($prop);
266
- }
267
- @return $value;
268
- }
269
-
270
- /// Print's the responsive type formula
271
- /// @param {String} $font-size Name to retrieve from sizes map or a unique size map that follows the API
272
- /// @param {Map} $changes Modifications to be merged into size before using
273
-
274
- @mixin font-size-responsive($font-size, $amount: get("responsive-change")) {
275
- font-size: calc(#{ $font-size } + #{ $amount });
276
- }
277
-
278
- /// Print a typography size (font-size, line-height)
279
- /// @param {String} $nameOrMap Name to retrieve from sizes map or a unique size map that follows the API
280
- /// @param {Map} $changes Modifications to be merged into size before using
281
-
282
- @mixin size($name, $changes: false, $only-font-size: null) {
283
- $size: $name;
284
- // Allow custom maps
285
- @if (meta.type-of($name) == "string") {
286
- $size: get-size($name);
287
- }
288
- @if ($changes) {
289
- $size: map.merge($size, $changes);
290
- }
291
- $font-size: get-size-converted-value($size, "font-size");
292
- $breakpoints: map.get($size, "breakpoints");
293
- $responsive: map.get($size, "responsive");
294
- $color: map.get($size, "color");
295
-
296
- font-size: $font-size;
297
- @if ($responsive) {
298
- @if (meta.type-of($responsive) == "number") {
299
- @include font-size-responsive($font-size, $responsive);
300
- } @else {
301
- @include font-size-responsive($font-size);
302
- }
303
- }
304
- @if (not $only-font-size) {
305
- font-weight: get-size-value($size, "font-weight");
306
- font-family: get-size-value($size, "font-family");
307
- line-height: get-size-converted-value($size, "line-height");
308
- margin-top: get-size-converted-value($size, "margin-top");
309
- margin-bottom: get-size-converted-value($size, "margin-bottom");
310
- color: if($color, color.get($color), null);
311
- }
312
-
313
- // If they have breakpoints, process them
314
- @if $breakpoints {
315
- @each $name, $breakpoint in $breakpoints {
316
- $direction: map.get($breakpoint, "direction");
317
- @include breakpoint.from($name, $direction) {
318
- @include size($breakpoint, null, $only-font-size);
319
- }
320
- }
321
- }
322
- }
@@ -1,48 +0,0 @@
1
- ////
2
- /// @group units
3
- ////
4
- /// @todo Finish Documentation
5
-
6
- @use "sass:meta";
7
- @use "sass:map";
8
- @use "utils";
9
-
10
- /// Module Settings
11
- /// @type Map
12
- /// @prop {Number} small-x
13
- /// @prop {Number} small
14
- /// @prop {Number} default Base unit of measurent
15
- /// @prop {Number} large
16
- /// @prop {Number} large-x
17
- /// @prop {Number} large-xx
18
-
19
- $config: (
20
- "small-x" : 1rem * 0.5,
21
- "small" : 1rem * 0.75,
22
- "default" : 1rem,
23
- "large" : 1rem * 2,
24
- "large-x" : 1rem * 3,
25
- "large-xx" : 1rem * 4
26
- ) !default;
27
-
28
- /// Update the units config
29
- /// @param {Map} $changes A map to merge into the color palette
30
- /// @example scss Setting the error and type color
31
- /// @include units.set((
32
- /// "default" : 1.5em
33
- /// ));
34
-
35
- @mixin set($changes) {
36
- $config: map.merge($config, $changes) !global;
37
- }
38
-
39
- /// Get a unit by name (preset) or number (multiplier of base)
40
- /// @param {Number|String} $value if a number is passed it is used as a multiplier of the base, if a string is passed it is used to lookup a value from unit presets @see $config
41
- /// @return {Number}
42
-
43
- @function get($value: 1) {
44
- @if (meta.type-of($value) == string) {
45
- @return utils.require-map-get($config, $value, 'unit [config]');
46
- }
47
- @return get("default") * $value;
48
- }
@@ -1,13 +0,0 @@
1
- ////
2
- /// @group utility
3
- ////
4
- /// @todo Finish Documentation
5
-
6
- @use "sass:math";
7
-
8
- /// Strips the unit from the number
9
- /// @link https://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass/12335841#12335841 Orginal source (Miriam Suzanne)
10
-
11
- @function strip-unit($value) {
12
- @return math.div($value, ($value * 0 + 1));
13
- }
@@ -1,211 +0,0 @@
1
- ////
2
- /// @group utils
3
- ////
4
- /// @todo Finish Documentation
5
-
6
- @use "sass:map";
7
- @use "sass:meta";
8
- @use "sass:math";
9
- @use "sass:list";
10
- @use "sass:string";
11
-
12
- /// Module Settings
13
- /// @type Map
14
- /// @prop {Boolean} $config.debug-maps Debugs include map print outs
15
- /// @prop {Boolean} $config.file-header-comments Remove comment headers if you'd like
16
-
17
- $config: (
18
- "debug-maps": true,
19
- "file-header-comments": true
20
- ) !default;
21
-
22
- /// Change modules $config
23
- /// @param {Map} $changes Map of changes
24
- /// @example scss - General example, replace module-name with module's name
25
- /// @include module-name.set(( "property" : value ));
26
- @mixin set($changes) {
27
- $config: map.merge($config, $changes) !global;
28
- }
29
-
30
- /// Get a config option
31
- /// @param {Map} $name Name of property
32
- /// @example scss - General example, replace module-name with module's name
33
- /// @include module-name.get("property");
34
-
35
- @function get($name) {
36
- @return require-map-get($config, $name, 'utils');
37
- }
38
-
39
- /// Get a required value from a map, throw an error if not found
40
- /// - Remeber that that maps cannot intentionally use null (use false instead, if trying to avoid output if unconfigured)
41
- /// @param {Map} $map The map to get the value from
42
- /// @param {String} $key The key in the map to get value from
43
- /// @param {String} $context The context of using this function for debugging help
44
- /// @return {*} The value from the map
45
-
46
- @function require-map-get($map, $key, $context: "unknown") {
47
- // $value: map.get($map, $key);
48
- @if (map.has-key($map, $key)) {
49
- @return map.get($map, $key);
50
- } @else {
51
- @if (get("debug-maps")) {
52
- @debug $map;
53
- }
54
- @error 'ULU: Unable to find "#{ $key }" in #{ $context } map.';
55
- }
56
- }
57
-
58
- /// Utility for providing fallbacks, the first truthy value (non false or null) will be returned
59
- /// @param {*} $args... Any number of arguments
60
- /// @return {*} The first truthy value
61
-
62
- @function fallback($args...) {
63
- @each $arg in $args {
64
- @if ($arg) {
65
- @return $arg;
66
- }
67
- }
68
- @return null;
69
- }
70
-
71
- /// Provides fallback values from the same map
72
- @function map-fallback($map, $properties...) {
73
- @each $prop in $properties {
74
- $value: map.get($map, $prop);
75
- @if ($value) {
76
- @return $value;
77
- }
78
- }
79
- @return null;
80
- }
81
-
82
- /// Ensure a value is present in the list, throw an error if not found
83
- /// @param {List} $list The map to get the value from
84
- /// @param {String} $value The value to search for in the list
85
- /// @param {String} $context The context of using this function for debugging help
86
-
87
- @mixin require-list-has($list, $value, $context: "unknown") {
88
- $index: list.index($list, $value) != null;
89
- @if ($index == null) {
90
- @error 'ULU: Unable to find item "#{ $value }" in #{ $context } list.';
91
- }
92
- }
93
-
94
- /// Require that the list only is only made up of allowed items
95
- /// @param {List} $allowed The list of allowed items
96
- /// @param {String} $list The list to test allowed against
97
-
98
- @mixin require-list-contains($allowed, $list, $context: "unknown") {
99
- @each $item in $list {
100
- @include require-list-has($allowed, $item, $context);
101
- }
102
- }
103
-
104
- /// Returns true if we should include something (map of booleans)
105
- /// @param {String} $name Name of item to see if it's included
106
- /// @param {Map} $includes Map of includes
107
-
108
- @function included($name, $includes) {
109
- $value: map.get($includes, $name);
110
- @return $value == true;
111
- }
112
-
113
- /// Returns true if we should include something (used for output checking)
114
- /// @param {List} $context The root area of the framework this file comes from
115
- /// @param {List} $name The name of the specific area/file (optional)
116
-
117
- @mixin file-header($context, $name: "") {
118
- @if ("file-header-comments") {
119
- /*
120
- =============================================================================
121
- #{ $context }:#{ $name }
122
- =============================================================================
123
- */
124
- }
125
- }
126
-
127
- // Provide a default when value typpe is not correct
128
- /// @param {String} $type type of value it should be
129
- /// @param {String} $value the value to provide if it is that type
130
- /// @param {String} $fallback the fallback value
131
-
132
- @function if-type($type, $value, $fallback) {
133
- @if meta.type-of($value) == $type {
134
- @return $value;
135
- } @else {
136
- @return $fallback;
137
- }
138
- }
139
-
140
- // Returns number unit info, and strips the unit
141
- /// @param {String} $number Number to get meta info for
142
- /// @return {Map} With properties (unit, value)
143
-
144
- @function number-info($number) {
145
- $is-number: meta.type-of($number) != 'number';
146
- $is-unitless: math.is-unitless($number);
147
- @if ($is-unitless or not $is-number) {
148
- @return (
149
- "unit": null,
150
- "value": $number
151
- );
152
- } @else {
153
- @return (
154
- "unit" : math.unit($value),
155
- "value": math.div($number, ($number * 0 + 1))
156
- );
157
- }
158
- }
159
-
160
- /// Repeatable pattern in core
161
-
162
- @function map-merge-or-overwrite($original, $changes, $deep: false, $overwrite: false) {
163
- @if $deep {
164
- @return map.deep-merge($original, $changes);
165
- } @else if $overwrite {
166
- @return $changes;
167
- } @else {
168
- @return map.merge($original, $changes);
169
- }
170
- }
171
-
172
- /// Helps in providing a dynamic fallback for modules whose defaults should come from another
173
- /// @param {String} $prop Property trying to get fallback for
174
- /// @param {*} $value The value that may need the fallback
175
- /// @param {Map} $lookup Map of properties to functions (use sass:meta > meta.get-function to populate)
176
- /// @return {*} The user's original value, or if the value is true get the default value from the provided function
177
-
178
- @function function-fallback($prop, $value, $lookup) {
179
- // If there was already a value return it else resolve through passed function
180
- @if ($value == true) {
181
- $fn: map.get($lookup, $prop);
182
- @if ($fn) {
183
- @return meta.call($fn, $prop);
184
- }
185
- }
186
- @return $value;
187
- }
188
-
189
- /// Replaces all or one occurence of a string within a string
190
- /// @param {String} $string String to operate on
191
- /// @param {String} $find String to find within string
192
- /// @param {String} $replace String to replace found strings
193
- /// @param {Boolean} $all Default true replace all matches, if false replace only first
194
-
195
- @function string-replace($string, $find, $replace, $all: true) {
196
-
197
- $index: string.index($string, $find);
198
-
199
- @if ($index) {
200
- $start: if($index == 1, "", string.slice($string, 1, string.length($find) - 1));
201
- $end: string.slice($string, $index + string.length($find));
202
- $new: $start + $replace;
203
- @if ($all) {
204
- @return $new + string-replace($end, $find, $replace);
205
- } @else {
206
- @return $new + $end;
207
- }
208
- } @else {
209
- @return $string;
210
- }
211
- }
@@ -1,14 +0,0 @@
1
- ////
2
- /// @group color
3
- ////
4
- /// @todo Finish Documentation
5
-
6
- @use "../utils";
7
- @use "../color";
8
-
9
- /// Prints color-context styles as base classes (top of stylesheet)
10
-
11
- @mixin styles {
12
- @include utils.file-header('base', 'color');
13
- @include color.all-context-styles("base-class");
14
- }