igniteui-theming 1.0.0-beta.7 → 1.0.0-beta.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-theming",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.8",
4
4
  "description": "A set of Sass variables, mixins, and functions for generating palettes, typography, and elevations used by Ignite UI components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -116,12 +116,11 @@ $ignored-keys: ('name', 'palette', 'variant', 'selector');
116
116
  /// Adds the required CSS properties so that the scope can react to size changes.
117
117
  /// @access public
118
118
  @mixin sizable() {
119
- --size: clamp(1, var(--ig-size, var(--ig-size-small, 1)), 3);
120
- --is-large: clamp(0, (var(--size) + 1) - var(--ig-size-large, 3), 1);
119
+ --is-large: clamp(0, (var(--ig-size, 1) + 1) - var(--ig-size-large, 3), 1);
121
120
  --is-medium:
122
121
  min(
123
- clamp(0, (var(--size) + 1) - var(--ig-size-medium, 2), 1),
124
- clamp(0, var(--ig-size-large, 3) - var(--size), 1)
122
+ clamp(0, (var(--ig-size, 1) + 1) - var(--ig-size-medium, 2), 1),
123
+ clamp(0, var(--ig-size-large, 3) - var(--ig-size, 1), 1)
125
124
  );
126
- --is-small: clamp(0, var(--ig-size-medium) - var(--size), 1);
125
+ --is-small: clamp(0, var(--ig-size-medium) - var(--ig-size, 1), 1);
127
126
  }
@@ -10,13 +10,15 @@
10
10
 
11
11
  /// Includes all category related styles into the current style block.
12
12
  /// @param {String} $category - The type scale category.
13
+ /// @param {String} $check [true] - Toggles category checks against ITypeScale.
14
+ /// Set to false when using a custom type scale.
13
15
  /// @example scss Add the `h1` styles to custom CSS selector.
14
16
  /// .fancy-h1 {
15
17
  /// @include type-style('h1');
16
18
  /// color: mediumvioletred;
17
19
  /// }
18
- @mixin type-style($category) {
19
- $valid: list.index(types.$ITypeScale, $category);
20
+ @mixin type-style($category, $check: true) {
21
+ $valid: if($check, list.index(types.$ITypeScale, $category), true);
20
22
 
21
23
  @if $valid {
22
24
  @each $key, $value in types.$ITypeStyle {
@@ -8,6 +8,7 @@
8
8
  @use 'sass:string';
9
9
  @use '../node_modules/sass-true/' as *;
10
10
  @use '../sass/typography/' as *;
11
+ @use '../sass/typography/presets' as presets;
11
12
 
12
13
  $h1: (font-size: 96px);
13
14
  $h2: (font-size: 70px);
@@ -157,6 +158,22 @@ $scale: type-scale(
157
158
  }
158
159
  }
159
160
 
161
+ @include it('should include all styles from a custom type category') {
162
+ @include assert() {
163
+ $custom-category: 'calendar-labels';
164
+
165
+ @include output() {
166
+ @include type-style($custom-category, $check: false);
167
+ }
168
+
169
+ @include expect() {
170
+ @each $key, $value in map.get(presets.$bootstrap-type-scale, $custom-category) {
171
+ #{$key}: var(--ig-#{$custom-category}-#{$key});
172
+ }
173
+ }
174
+ }
175
+ }
176
+
160
177
  @include it('should include type styles with CSS var refs as values for a specific category') {
161
178
  $category: 'h1';
162
179