@progress/kendo-theme-core 7.2.2-dev.0 → 7.3.0-dev.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-theme-core",
3
3
  "description": "A collection of functions and mixins used for building themes for Kendo UI",
4
- "version": "7.2.2-dev.0",
4
+ "version": "7.3.0-dev.1",
5
5
  "author": "Progress",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
@@ -44,5 +44,5 @@
44
44
  "directories": {
45
45
  "doc": "docs"
46
46
  },
47
- "gitHead": "14dd89a76f235649ba2cf9f260465cdcb486c135"
47
+ "gitHead": "dd6bd98014ab25b166cbb4b2f715a81805644168"
48
48
  }
@@ -132,26 +132,3 @@ $kendo-color-level-step: 8% !default;
132
132
  @function k-true-mix( $color1, $color2, $weight: 50% ) {
133
133
  @return k-color-mix( rgba( $color1, 1 ), rgba( $color2, 1 ), $weight );
134
134
  }
135
-
136
- /// Generates all color variations of a given main color
137
- /// @param {String} $name - The name of the main color
138
- /// @param {Color} $level - The color value to be assigned to the main color
139
- /// @return {Map} - A map with the generated keys and values
140
- ///
141
- /// @group color-system
142
- @function k-generate-colors( $name, $color ) {
143
- $_variations: (
144
- #{$name}-subtle: k-try-tint( $color, 80% ),
145
- #{$name}-subtle-hover: k-try-tint( $color, 65% ),
146
- #{$name}-subtle-active: k-try-tint( $color, 50% ),
147
- #{$name}: $color,
148
- #{$name}-hover: k-try-shade( $color, 0.5 ),
149
- #{$name}-active: k-try-shade( $color, 1.5 ),
150
- #{$name}-emphasis: k-try-tint( $color, 4.5 ),
151
- #{$name}-on-subtle: k-try-shade( $color, 8 ),
152
- on-#{$name}: k-contrast-legacy( $color ),
153
- #{$name}-on-surface: $color,
154
- );
155
-
156
- @return $_variations;
157
- }
@@ -0,0 +1,122 @@
1
+ /// Generates all color variations of a given main color
2
+ /// @param {String} $name - The name of the main color
3
+ /// @param {Color} $color - The color value to be assigned to the main color
4
+ /// @param {String} $theme - The theme the colors will be generated for
5
+ /// @return {Map} - A map with the generated keys and values
6
+ ///
7
+ /// @group color-system
8
+ @function k-generate-color-variations( $name, $color, $theme: null ) {
9
+ $result: ();
10
+
11
+ // DataViz
12
+ @if (
13
+ $name == 'series-a' or
14
+ $name == 'series-b' or
15
+ $name == 'series-c' or
16
+ $name == 'series-d' or
17
+ $name == 'series-e' or
18
+ $name == 'series-f'
19
+ ) {
20
+ $_variations: (
21
+ #{$name}: $color,
22
+ #{$name}-bold: k-color-mix(black, $color, 25%),
23
+ #{$name}-bolder: k-color-mix(black, $color, 50%),
24
+ #{$name}-subtle: k-color-mix(white, $color, 25%),
25
+ #{$name}-subtler: k-color-mix(white, $color, 50%),
26
+ );
27
+
28
+ $result: k-map-merge($result, $_variations);
29
+ } @else {
30
+ // Default
31
+ @if ( $theme == 'default' or $theme == null ) { // stylelint-disable-line
32
+ $_variations: (
33
+ #{$name}-subtle: if( $name == 'base', k-try-shade( $color, 4% ), k-try-tint( $color, 80% )),
34
+ #{$name}-subtle-hover: if( $name == 'base', k-try-shade( $color, 8% ), k-try-tint($color, 65% )),
35
+ #{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 13% ), k-try-tint( $color, 50% )),
36
+ #{$name}: $color,
37
+ #{$name}-hover: k-try-shade( $color, 0.5 ),
38
+ #{$name}-active: k-try-shade( $color, 1.5 ),
39
+ #{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 21% ), k-try-tint( $color, 25% )),
40
+ #{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 75% ), k-try-shade( $color, 65% )),
41
+ on-#{$name}: if( $name == 'base', k-try-shade( $color, 75% ), k-contrast-legacy( $color )),
42
+ #{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 75% ), k-try-shade( $color, 25% )),
43
+ );
44
+
45
+ $result: k-map-merge($result, $_variations);
46
+ }
47
+
48
+ // Bootstrap
49
+ @if ( $theme == 'bootstrap' ) {
50
+ $_variations: (
51
+ #{$name}-subtle: if( $name == 'base', k-try-tint( $color, 30% ), k-try-tint( $color, 80% )),
52
+ #{$name}-subtle-hover: if( $name == 'base', $color, k-try-tint($color, 65% )),
53
+ #{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 8% ), k-try-tint( $color, 50% )),
54
+ #{$name}: $color,
55
+ #{$name}-hover: k-color-darken( $color, 7.5% ),
56
+ #{$name}-active: k-color-darken( $color, 10% ),
57
+ #{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 21% ), k-try-tint( $color, 25% )),
58
+ #{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 65% )),
59
+ on-#{$name}: if( $name == 'base', k-try-shade( $color, 84% ), k-contrast-color( $color )),
60
+ #{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 25% )),
61
+ );
62
+
63
+ $result: k-map-merge($result, $_variations);
64
+ }
65
+
66
+ // Material
67
+ @if ( $theme == 'material' ) {
68
+ $_variations: (
69
+ #{$name}-subtle: if( $name == 'base', k-try-shade( $color, 12% ), k-try-tint( $color, 80% )),
70
+ #{$name}-subtle-hover: if( $name == 'base', k-try-shade( $color, 16% ), k-try-tint($color, 65% )),
71
+ #{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 24% ), k-try-tint( $color, 50% )),
72
+ #{$name}: $color,
73
+ #{$name}-hover: k-try-shade( $color, 0.5 ),
74
+ #{$name}-active: k-try-shade( $color, 1.5 ),
75
+ #{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 32% ), k-try-tint( $color, 25% )),
76
+ #{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 87% ), k-try-shade( $color, 65% )),
77
+ on-#{$name}: if( $name == 'base', k-try-shade( $color, 87% ), k-contrast-color( $color )),
78
+ #{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 87% ), k-try-shade( $color, 50% )),
79
+ );
80
+
81
+ $result: k-map-merge($result, $_variations);
82
+ }
83
+
84
+ // Fluent
85
+ @if ( $theme == 'fluent' ) {
86
+ $_variations: (
87
+ #{$name}-subtle: if( $name == 'base', k-try-shade( $color, 2% ), k-try-tint( $color, 80% )),
88
+ #{$name}-subtle-hover: if( $name == 'base', k-try-shade( $color, 8% ), k-try-tint($color, 65% )),
89
+ #{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 12% ), k-try-tint( $color, 50% )),
90
+ #{$name}: $color,
91
+ #{$name}-hover: k-try-shade( $color, 0.5 ),
92
+ #{$name}-active: k-try-shade( $color, 1.5 ),
93
+ #{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 18% ), k-try-tint( $color, 25% )),
94
+ #{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 74% ), k-try-shade( $color, 65% )),
95
+ on-#{$name}: if( $name == 'base', k-try-shade( $color, 86% ), k-contrast-legacy( $color )),
96
+ #{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 86% ), k-try-shade( $color, 25% )),
97
+ );
98
+
99
+ $result: k-map-merge($result, $_variations);
100
+ }
101
+
102
+ // Classic
103
+ @if ( $theme == 'classic' ) {
104
+ $_variations: (
105
+ #{$name}-subtle: if( $name == 'base', k-try-tint( $color, 20% ), k-try-tint( $color, 80% )),
106
+ #{$name}-subtle-hover: if( $name == 'base', k-try-tint( $color, 8% ), k-try-tint($color, 65% )),
107
+ #{$name}-subtle-active: if( $name == 'base', k-try-shade( $color, 6% ), k-try-tint( $color, 50% )),
108
+ #{$name}: $color,
109
+ #{$name}-hover: k-try-shade( $color, 1 ),
110
+ #{$name}-active: k-try-shade( $color, 2 ),
111
+ #{$name}-emphasis: if( $name == 'base', k-try-shade( $color, 14% ), k-try-tint( $color, 25% )),
112
+ #{$name}-on-subtle: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 65% )),
113
+ on-#{$name}: if( $name == 'base', k-try-shade( $color, 84% ), k-contrast-legacy( $color )),
114
+ #{$name}-on-surface: if( $name == 'base', k-try-shade( $color, 84% ), k-try-shade( $color, 25% )),
115
+ );
116
+
117
+ $result: k-map-merge($result, $_variations);
118
+ }
119
+ }
120
+
121
+ @return $result;
122
+ }
@@ -1,6 +1,7 @@
1
1
  @import "./_color.import.scss";
2
2
  @import "./_color-contrast.import.scss";
3
3
  @import "./_color-manipulation.import.scss";
4
+ @import "./_color-variations.import.scss";
4
5
  @import "./_custom-properties.import.scss";
5
6
  @import "./_escape-string.import.scss";
6
7
  @import "./_lang.import.scss";