igniteui-theming 1.0.0-beta.2 → 1.0.0-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-theming",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.5",
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": {
@@ -7,7 +7,7 @@
7
7
  @use 'charts';
8
8
  @use 'multipliers';
9
9
  @use 'types';
10
- @use '../utils' as *;
10
+ @use '../utils/math' as *;
11
11
 
12
12
  $_enhanced-accessibility: false;
13
13
 
@@ -175,7 +175,7 @@ $_enhanced-accessibility: false;
175
175
  $meta: if($palette, map.get($palette, '_meta'), null);
176
176
 
177
177
  @if not($c) {
178
- @error 'The passed color #{$color} is not valid.';
178
+ @error 'The passed color #{meta.inspect($color)} is not valid.';
179
179
  }
180
180
 
181
181
  @if not($palette) or not($meta) {
@@ -3,4 +3,3 @@
3
3
  @forward 'types';
4
4
  @forward 'multipliers';
5
5
  @forward 'charts';
6
- @forward 'presets';
@@ -1,8 +1,2 @@
1
- @forward './light/material' as light-material-*;
2
- @forward './light/bootstrap' as light-bootstrap-*;
3
- @forward './light/fluent' as light-fluent-*;
4
- @forward './light/indigo' as light-indigo-*;
5
- @forward './dark/material' as dark-material-*;
6
- @forward './dark/bootstrap' as dark-bootstrap-*;
7
- @forward './dark/fluent' as dark-fluent-*;
8
- @forward './dark/indigo' as dark-indigo-*;
1
+ @forward 'light';
2
+ @forward 'dark';
@@ -0,0 +1,4 @@
1
+ @forward 'material' as dark-material-*;
2
+ @forward 'bootstrap' as dark-bootstrap-*;
3
+ @forward 'fluent' as dark-fluent-*;
4
+ @forward 'indigo' as dark-indigo-*;
@@ -0,0 +1,4 @@
1
+ @forward 'material' as light-material-*;
2
+ @forward 'bootstrap' as light-bootstrap-*;
3
+ @forward 'fluent' as light-fluent-*;
4
+ @forward 'indigo' as light-indigo-*;
@@ -1,3 +1,2 @@
1
1
  @forward 'functions';
2
2
  @forward 'mixins';
3
- @forward 'presets';
@@ -1,4 +1,4 @@
1
- @use '../utils' as *;
1
+ @use '../utils/meta' as *;
2
2
 
3
3
  ////
4
4
  /// @group elevations
@@ -1,14 +1,13 @@
1
1
  @use 'sass:map';
2
2
  @use 'sass:meta';
3
3
  @use 'sass:string';
4
- @use '../utils/map' as *;
5
- @use '../elevations/' as *;
6
- @use '../color/' as color;
4
+ @use '../typography/functions' as *;
5
+ @use '../elevations/functions' as *;
6
+ @use '../color/functions' as color;
7
7
 
8
8
  /// Digests a theme schema and returns a resolved theme map.
9
9
  /// @access private
10
10
  /// @param {Map} $schema - A theme schema.
11
- /// @requires {function} extend
12
11
  /// @requires {function} resolve-value
13
12
  /// @example scss Get the resolved theme for a schema
14
13
  /// $custom-schema: (
@@ -24,14 +23,14 @@
24
23
 
25
24
  @each $key, $value in $schema {
26
25
  @if meta.type-of($value) == 'map' {
27
- $result: extend($result, (#{$key}: resolve-value($value)));
26
+ $result: map.merge($result, (#{$key}: resolve-value($value)));
28
27
  } @else {
29
- $result: extend($result, (#{$key}: $value));
28
+ $result: map.merge($result, (#{$key}: $value));
30
29
  }
31
30
 
32
31
  // Special case for chart elevation literals
33
32
  @if string.index($key, 'elevation') {
34
- $result: extend(
33
+ $result: map.merge(
35
34
  $result,
36
35
  (
37
36
  #{$key}: #{elevation($value)}
@@ -41,7 +40,7 @@
41
40
 
42
41
  // Special case for chart brushes
43
42
  @if $value == 'series' {
44
- $result: extend(
43
+ $result: map.merge(
45
44
  $result,
46
45
  (
47
46
  #{$key}: #{color.chart-brushes()}
@@ -105,6 +104,6 @@
105
104
  /// @param {Number} $radius - The preferred value.
106
105
  /// @param {Number} $min [rem(0)] - The minimum value.
107
106
  /// @param {Number} $max [$radius] - The maximum allowed value.
108
- @function border-radius($radius, $min: rem(0), $max: $radius) {
109
- @return clamp($min, calc(var(--ig-radius-factor) * #{$radius}), $max);
107
+ @function border-radius($radius, $min: #{rem(0)}, $max: $radius) {
108
+ @return clamp(#{$min}, #{calc(var(--ig-radius-factor) * #{$radius})}, #{$max});
110
109
  }
@@ -1,9 +1,8 @@
1
1
  @use 'sass:map';
2
2
  @use 'sass:meta';
3
3
  @use 'sass:string';
4
- @use '../utils/' as *;
5
- @use '../elevations/' as *;
6
- @use './functions' as *;
4
+ @use '../utils/meta' as *;
5
+ @use '../typography/functions' as *;
7
6
 
8
7
  /// A list of ignored keywords to be excluded when generating CSS variables for a theme.
9
8
  /// @access private
@@ -65,8 +64,8 @@ $ignored-keys: ('name', 'palette', 'variant', 'selector');
65
64
  /// @param {Number} $radius - The preferred value.
66
65
  /// @param {Number} $min [rem(0)] - The minimum value.
67
66
  /// @param {Number} $max [$radius] - The maximum allowed value.
68
- @mixin border-radius($radius, $min: rem(0), $max: $radius) {
69
- border-radius: border-radius($radius, $min, $max);
67
+ @mixin border-radius($radius, $min: #{rem(0)}, $max: $radius) {
68
+ border-radius: clamp(#{$min}, #{calc(var(--ig-radius-factor) * #{$radius})}, #{$max});
70
69
  }
71
70
 
72
71
  /// Truncates text to a specific number of lines.
@@ -57,7 +57,7 @@ $browser-context: 16px;
57
57
 
58
58
  /// Produces a type style map of values that adheres to the ITypeStyle map.
59
59
  /// @access public
60
- /// @param {String} $font-family [var(--igc-font-family)] - The font family of the type style.
60
+ /// @param {String} $font-family [var(--ig-font-family)] - The font family of the type style.
61
61
  /// @param {String} $font-size - The font size of the type style.
62
62
  /// @param {Number|String} $font-weight [normal] - The font weight of the type style.
63
63
  /// @param {String} $font-style [normal] - The font style of the type style.
@@ -1,4 +1,3 @@
1
1
  @forward 'functions';
2
2
  @forward 'mixins';
3
3
  @forward 'types';
4
- @forward 'presets';
@@ -5,6 +5,8 @@
5
5
  /// @group Typography
6
6
  ////
7
7
 
8
+ /* stylelint-disable-next-line max-line-length */
9
+ $typeface: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'";
8
10
  $_base-scale: (
9
11
  h1: type-style(
10
12
  $font-size: rem(40px),
@@ -117,7 +119,7 @@ $bootstrap_weekday: type-style(
117
119
  $margin-top: 0,
118
120
  $margin-bottom: 0
119
121
  );
120
- $scale: extend(
122
+ $type-scale: extend(
121
123
  $_base-scale,
122
124
  (
123
125
  calendar-labels: $bootstrap_weekday,
@@ -3,8 +3,8 @@
3
3
  ////
4
4
  /// @group Typography
5
5
  ////
6
-
7
- $scale: (
6
+ $typeface: "'Open Sans', Helvetica, Arial, sans-serif";
7
+ $type-scale: (
8
8
  h1: type-style(
9
9
  $font-size: rem(68px),
10
10
  $font-weight: 700,
@@ -93,6 +93,14 @@ $scale: (
93
93
  $margin-top: 0,
94
94
  $margin-bottom: 0
95
95
  ),
96
+ caption: type-style(
97
+ $font-size: rem(12px),
98
+ $font-weight: 400,
99
+ $font-style: normal,
100
+ $letter-spacing: rem(.4px),
101
+ $line-height: rem(16px),
102
+ $text-transform: none
103
+ ),
96
104
  overline: type-style(
97
105
  $font-size: rem(10px),
98
106
  $font-weight: 400,
@@ -3,8 +3,8 @@
3
3
  ////
4
4
  /// @group Typography
5
5
  ////
6
-
7
- $scale: (
6
+ $typeface: "'Nunito Sans', sans-serif";
7
+ $type-scale: (
8
8
  h1: type-style(
9
9
  $font-size: rem(96px),
10
10
  $font-weight: 200,
@@ -4,9 +4,9 @@
4
4
  /// @group Typography
5
5
  ////
6
6
 
7
- $scale: (
7
+ $typeface: "'Titillium Web', sans-serif";
8
+ $type-scale: (
8
9
  h1: type-style(
9
- $font-family: var(--igc-font-family),
10
10
  $font-size: rem(96px),
11
11
  $font-weight: 300,
12
12
  $font-style: normal,
@@ -17,7 +17,6 @@ $scale: (
17
17
  $margin-bottom: rem(56px)
18
18
  ),
19
19
  h2: type-style(
20
- $font-family: var(--igc-font-family),
21
20
  $font-size: rem(60px),
22
21
  $font-weight: 300,
23
22
  $font-style: normal,
@@ -28,7 +27,6 @@ $scale: (
28
27
  $margin-bottom: rem(28px)
29
28
  ),
30
29
  h3: type-style(
31
- $font-family: var(--igc-font-family),
32
30
  $font-size: rem(48px),
33
31
  $font-weight: 400,
34
32
  $font-style: normal,
@@ -39,7 +37,6 @@ $scale: (
39
37
  $margin-bottom: 0
40
38
  ),
41
39
  h4: type-style(
42
- $font-family: var(--igc-font-family),
43
40
  $font-size: rem(34px),
44
41
  $font-weight: 400,
45
42
  $font-style: normal,
@@ -50,7 +47,6 @@ $scale: (
50
47
  $margin-bottom: 0
51
48
  ),
52
49
  h5: type-style(
53
- $font-family: var(--igc-font-family),
54
50
  $font-size: rem(24px),
55
51
  $font-weight: 400,
56
52
  $font-style: normal,
@@ -61,7 +57,6 @@ $scale: (
61
57
  $margin-bottom: 0
62
58
  ),
63
59
  h6: type-style(
64
- $font-family: var(--igc-font-family),
65
60
  $font-size: rem(20px),
66
61
  $font-weight: 600,
67
62
  $font-style: normal,
@@ -72,7 +67,6 @@ $scale: (
72
67
  $margin-bottom: 0
73
68
  ),
74
69
  subtitle-1: type-style(
75
- $font-family: var(--igc-font-family),
76
70
  $font-size: rem(16px),
77
71
  $font-weight: 400,
78
72
  $font-style: normal,
@@ -81,7 +75,6 @@ $scale: (
81
75
  $text-transform: none
82
76
  ),
83
77
  subtitle-2: type-style(
84
- $font-family: var(--igc-font-family),
85
78
  $font-size: rem(14px),
86
79
  $font-weight: 600,
87
80
  $font-style: normal,
@@ -90,7 +83,6 @@ $scale: (
90
83
  $text-transform: none
91
84
  ),
92
85
  body-1: type-style(
93
- $font-family: var(--igc-font-family),
94
86
  $font-size: rem(16px),
95
87
  $font-weight: 400,
96
88
  $font-style: normal,
@@ -101,7 +93,6 @@ $scale: (
101
93
  $margin-bottom: rem(16)
102
94
  ),
103
95
  body-2: type-style(
104
- $font-family: var(--igc-font-family),
105
96
  $font-size: rem(14px),
106
97
  $font-weight: 400,
107
98
  $font-style: normal,
@@ -110,7 +101,6 @@ $scale: (
110
101
  $text-transform: none
111
102
  ),
112
103
  button: type-style(
113
- $font-family: var(--igc-font-family),
114
104
  $font-size: rem(14px),
115
105
  $font-weight: 600,
116
106
  $font-style: normal,
@@ -119,7 +109,6 @@ $scale: (
119
109
  $text-transform: uppercase
120
110
  ),
121
111
  caption: type-style(
122
- $font-family: var(--igc-font-family),
123
112
  $font-size: rem(12px),
124
113
  $font-weight: 400,
125
114
  $font-style: normal,
@@ -128,7 +117,6 @@ $scale: (
128
117
  $text-transform: none
129
118
  ),
130
119
  overline: type-style(
131
- $font-family: var(--igc-font-family),
132
120
  $font-size: rem(10px),
133
121
  $font-weight: 400,
134
122
  $font-style: normal,
@@ -5,7 +5,7 @@
5
5
  @use 'sass:meta';
6
6
  @use 'sass:color';
7
7
  @use '../node_modules/sass-true/' as *;
8
- @use '../index' as *;
8
+ @use '../sass/color' as *;
9
9
 
10
10
  // base colors
11
11
  $_primary: #09f;
@@ -1,7 +1,7 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:list';
3
3
  @use '../node_modules/sass-true/' as *;
4
- @use '../index' as *;
4
+ @use '../sass/elevations/' as *;
5
5
 
6
6
  @include describe('Elevations') {
7
7
  @include it('should return an empty list for a list of non box-shadow values') {
@@ -180,18 +180,18 @@ $schema: (
180
180
  }
181
181
 
182
182
  @include it('should set the border-radius to a value between min and max') {
183
- $border-radius: border-radius(4px, 2px, 3px);
184
- $expected: meta.inspect(clamp(2px, var(--ig-radius-factor) * 4px, 3px));
183
+ $border-radius: border-radius(rem(4px), rem(2px), rem(3px));
184
+ $expected: clamp(.125rem, meta.inspect(calc(var(--ig-radius-factor) * .25rem)), .1875rem);
185
185
 
186
186
  @include assert-equal($assert: $border-radius, $expected: $expected, $inspect: true);
187
187
  }
188
188
 
189
189
  @include it('should include border-radius styles to a given scope with a value between min and max') {
190
- $expected: meta.inspect(clamp(2px, var(--ig-radius-factor) * 4px, 3px));
190
+ $expected: clamp(.125rem, meta.inspect(calc(var(--ig-radius-factor) * .25rem)), .1875rem);
191
191
 
192
192
  @include assert() {
193
193
  @include output() {
194
- @include border-radius(4px, 2px, 3px);
194
+ @include border-radius(rem(4px), rem(2px), rem(3px));
195
195
  }
196
196
 
197
197
  @include expect() {
@@ -7,8 +7,7 @@
7
7
  @use 'sass:color';
8
8
  @use 'sass:string';
9
9
  @use '../node_modules/sass-true/' as *;
10
- @use '../index' as *;
11
- @use '../sass/typography/types';
10
+ @use '../sass/typography/' as *;
12
11
 
13
12
  $h1: (font-size: 96px);
14
13
  $h2: (font-size: 70px);
@@ -74,7 +73,7 @@ $scale: type-scale(
74
73
  $font-size: 18px;
75
74
  $rules: type-style($font-size: $font-size);
76
75
 
77
- @each $rule, $value in map.remove(types.$ITypeStyle, 'font-size') {
76
+ @each $rule, $value in map.remove($ITypeStyle, 'font-size') {
78
77
  @include assert-equal(map.get($rules, $rule), $value);
79
78
  }
80
79
 
@@ -170,7 +169,7 @@ $scale: type-scale(
170
169
 
171
170
  @include expect() {
172
171
  .my-h1 {
173
- @each $key, $value in types.$ITypeStyle {
172
+ @each $key, $value in $ITypeStyle {
174
173
  #{$key}: var(--ig-#{$category}-#{$key});
175
174
  }
176
175
  }
@@ -185,7 +184,7 @@ $scale: type-scale(
185
184
  }
186
185
 
187
186
  @include expect() {
188
- @each $category in types.$ITypeScale {
187
+ @each $category in $ITypeScale {
189
188
  &__#{$category} {
190
189
  @include type-style($category);
191
190
  }
@@ -201,7 +200,7 @@ $scale: type-scale(
201
200
  }
202
201
 
203
202
  @include expect() {
204
- @each $category, $element in types.$IElementCategories {
203
+ @each $category, $element in $IElementCategories {
205
204
  #{$element} {
206
205
  @include type-style($category);
207
206
  }
@@ -1,6 +1,6 @@
1
1
  /* stylelint-disable max-nesting-depth */
2
2
  @use '../node_modules/sass-true/' as *;
3
- @use '../index' as *;
3
+ @use '../sass/utils/' as *;
4
4
 
5
5
  @include describe('Utilities') {
6
6
  @include describe('meta') {
@@ -1,38 +1,4 @@
1
1
  @use '../../index' as *;
2
- @use '../../sass/elevations/presets/material' as *;
3
-
4
- $h1: (font-size: 96px);
5
- $h2: (font-size: 70px);
6
- $h3: (font-size: 40px);
7
- $h4: (font-size: 30px);
8
- $h5: (font-size: 20px);
9
- $h6: (font-size: 10px);
10
- $subtitle-1: (font-size: 96px);
11
- $subtitle-2: (font-size: 70px);
12
- $body-1: (font-size: 40px);
13
- $body-2: (font-size: 30px);
14
- $button: (font-size: 20px);
15
- $caption: (font-size: 10px);
16
- $overline: (font-size: 10px);
17
- $theme: 'material';
18
- $scale: type-scale(
19
- $h1: $h1,
20
- $h2: $h2,
21
- $h3: $h3,
22
- $h4: $h4,
23
- $h5: $h5,
24
- $h6: $h6,
25
- $subtitle-1: $subtitle-1,
26
- $subtitle-2: $subtitle-2,
27
- $body-1: $body-1,
28
- $body-2: $body-2,
29
- $button: $button,
30
- $caption: $caption,
31
- $overline: $overline,
32
- $_theme: $theme
33
- );
34
- $palette: palette($primary: #9fe, $secondary: orange, $surface: #fff);
35
-
36
- @include palette($palette);
37
- @include typography("'Roboto', sans-serif", $scale);
38
- @include elevations($elevations);
2
+ @include palette($light-material-palette);
3
+ @include typography($material-typeface, $material-type-scale);
4
+ @include elevations($material-elevations);