@ulu/frontend 0.5.3 → 0.5.4

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.
@@ -23,18 +23,21 @@ $config: (
23
23
 
24
24
  /// Change modules $config
25
25
  /// @param {Map} $changes Map of changes
26
+
26
27
  @mixin set($changes) {
27
28
  $config: map.merge($config, $changes) !global;
28
29
  }
29
30
 
30
31
  /// Get a config option
31
32
  /// @param {String} $name Name of property
33
+
32
34
  @function get($name) {
33
35
  @return utils.require-map-get($config, $name, "base root [config]");
34
36
  }
35
37
 
36
38
  /// Global root variables (CSS Custom Properties)
37
39
  /// @type Map
40
+
38
41
  $cssvars: () !default;
39
42
 
40
43
  /// Set global root variables
@@ -54,6 +57,7 @@ $cssvars: () !default;
54
57
  /// ));
55
58
  /// @param {Map} $changes Map of changes
56
59
  /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
60
+
57
61
  @mixin set-cssvars($changes, $merge-mode: null) {
58
62
  $cssvars: utils.map-merge($cssvars, $changes, $merge-mode) !global;
59
63
  }
@@ -19,6 +19,7 @@
19
19
  /// @prop {String} token-color ["color-type"] The token name used for the `color` property on theme classes.
20
20
  /// @prop {String} token-background-color [null] The token name used for the `background-color` property on theme classes. This is not included by default (normally we don't want to set a specific background color but if you do add the background-color token name from the theme)
21
21
  /// @prop {Boolean} token-warnings [true] Since this is an opinionated stylesheet we warn if you have "token-color" set but it's key is not found in the theme. If this is intentional
22
+
22
23
  $config: (
23
24
  "output-inverse": true,
24
25
  "fake-invert-color": black,
@@ -30,20 +31,24 @@ $config: (
30
31
 
31
32
  /// Change modules $config
32
33
  /// @param {Map} $changes Map of changes
34
+
33
35
  @mixin set($changes) {
34
36
  $config: map.merge($config, $changes) !global;
35
37
  }
36
38
 
37
39
  /// Get a config option
38
40
  /// @param {String} $name Name of property
41
+
39
42
  @function get($name) {
40
43
  @return utils.require-map-get($config, $name, "base themes [config]");
41
44
  }
42
45
 
43
46
  /// Outputs base theme variables and classes
47
+ /// @param {String} $root-selector [:root] - Top-level selector for default theme, can be adjusted for things like building an editor stylesheet where these are wrapped
44
48
  /// @example scss
45
49
  /// @include ulu.base-themes-styles();
46
- @mixin styles {
50
+
51
+ @mixin styles($root-selector: ":root") {
47
52
  @include utils.file-header('base', 'themes');
48
53
 
49
54
  @if (list.length(themes.$tokens) > 0) {
@@ -61,7 +66,7 @@ $config: (
61
66
  $selectors: list.append($selectors, "#{ $prefix }-#{ $key }", comma);
62
67
 
63
68
  @if ($key == $default) {
64
- $selectors: list.append($selectors, ":root", comma);
69
+ $selectors: list.append($selectors, $root-selector, comma);
65
70
  }
66
71
 
67
72
  #{ $selectors } {
@@ -139,7 +144,7 @@ $config: (
139
144
  @if ($inverse-target == $key) {
140
145
  $fake-selectors: list.append($fake-selectors, "#{ $prefix }-#{ $current-theme } #{ $inverse-prefix }", comma);
141
146
  @if ($current-theme == $default) {
142
- $fake-selectors: list.append($fake-selectors, ":root #{ $inverse-prefix }", comma);
147
+ $fake-selectors: list.append($fake-selectors, "#{ $root-selector } #{ $inverse-prefix }", comma);
143
148
  }
144
149
  }
145
150
  }
@@ -171,9 +176,9 @@ $config: (
171
176
  }
172
177
 
173
178
  // 3. The Fake Inversion Utility Class
174
- /// Can be used on elements that need a theme but that have colors that can't be updated (canvas charts for example)
175
- /// It inverts the items color, and then inverts/spins the element colors so they match the hue before inversion
176
- /// It also decreases the contrast slightly
179
+ // Can be used on elements that need a theme but that have colors that can't be updated (canvas charts for example)
180
+ // It inverts the items color, and then inverts/spins the element colors so they match the hue before inversion
181
+ // It also decreases the contrast slightly
177
182
  @if (list.length($fake-selectors) > 0) {
178
183
  #{ $fake-selectors } {
179
184
  #{ $prefix }-fake-invert,
@@ -35,7 +35,7 @@
35
35
  @include typography.size($size);
36
36
  }
37
37
  } @else {
38
- .#{$size} {
38
+ .#{ $size } {
39
39
  @include typography.size($size);
40
40
  }
41
41
  }
@@ -53,6 +53,7 @@ $config: (
53
53
 
54
54
  /// Output component stylesheet
55
55
  /// - Note this is setup so that it can be used for separate stylesheets (ie. tinyMCE or ckeditor)
56
+ /// @param {Boolean} $in-selector [true] - Whether to print with .wysiwyg selector or not, used when building like editor/ckeditor stylesheet where these aren't wrapped in selector and should just affect all elements in the editor
56
57
  /// @example scss
57
58
  /// @include ulu.component-wysiwyg-styles(true);
58
59
  /// // Output not in selector (for editor stylesheet/preview)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "A framework-agnostic frontend toolkit providing a modular, tree-shakable library of accessible components and utilities. Designed for seamless integration, it features a highly configurable SCSS system for any environment and vanilla JavaScript modules optimized for traditional websites and content management systems.",
5
5
  "type": "module",
6
6
  "files": [