@progress/kendo-theme-core 7.1.0-dev.7 → 7.1.0-dev.9

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.
@@ -132,3 +132,26 @@ $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,5 @@
1
+ @mixin kendo-core--styles--colors() {
2
+ @if ($kendo-enable-color-system) {
3
+ @include color-system--styles();
4
+ }
5
+ }
@@ -5,9 +5,10 @@
5
5
  @import "./_base.scss";
6
6
  @import "./_loading.scss";
7
7
  @import "./_selection.scss";
8
-
8
+ @import "./_colors.scss";
9
9
 
10
10
  @mixin kendo-core--styles() {
11
+ @include kendo-core--styles--colors();
11
12
  @include kendo-core--styles--accessibility();
12
13
  @include kendo-core--styles--asp-fallback();
13
14
  @include kendo-core--styles--layout();
@@ -1,198 +0,0 @@
1
- // Color constants
2
-
3
- /// The color white.
4
- /// Note: you cannot change this value.
5
- /// @type Color
6
- /// @group color-system
7
- $kendo-color-white: #ffffff; // stylelint-disable-line scss/dollar-variable-default
8
-
9
- /// The color black.
10
- /// Note: you cannot change this value.
11
- /// @type Color
12
- /// @group color-system
13
- $kendo-color-black: #000000; // stylelint-disable-line scss/dollar-variable-default
14
-
15
- /// The color transparent.
16
- /// Note: you cannot change this value.
17
- /// @type Color
18
- /// @group color-system
19
- $kendo-color-rgba-transparent: rgba( 0, 0, 0, 0 ); // stylelint-disable-line scss/dollar-variable-default
20
-
21
- /// A gradient that goes from transparent to black.
22
- /// Note: you cannot change this value.
23
- /// @type Gradient
24
- /// @group color-system
25
- $kendo-gradient-transparent-to-black: rgba( black, 0 ), black; // stylelint-disable-line scss/dollar-variable-default
26
-
27
- /// A gradient that goes from transparent to white.
28
- /// Note: you cannot change this value.
29
- /// @type Gradient
30
- /// @group color-system
31
- $kendo-gradient-transparent-to-white: rgba( white, 0 ), white; // stylelint-disable-line scss/dollar-variable-default
32
-
33
- /// A gradient that goes from black to transparent.
34
- /// Note: you cannot change this value.
35
- /// @type Gradient
36
- /// @group color-system
37
- $kendo-gradient-black-to-transparent: black, rgba( black, 0 ); // stylelint-disable-line scss/dollar-variable-default
38
-
39
- /// A gradient that goes from white to transparent.
40
- /// Note: you cannot change this value.
41
- /// @type Gradient
42
- /// @group color-system
43
- $kendo-gradient-white-to-transparent: white, rgba( white, 0 ); // stylelint-disable-line scss/dollar-variable-default
44
-
45
- /// A gradient that cycles through the colors of the rainbow.
46
- /// Note: you cannot change this value.
47
- /// @type Gradient
48
- /// @group color-system
49
- $kendo-gradient-rainbow: #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000; // stylelint-disable-line scss/dollar-variable-default
50
-
51
-
52
- // Root styles
53
- $kendo-body-bg: $kendo-color-white !default;
54
- $kendo-body-text: k-get-theme-color-var( neutral-160 ) !default;
55
-
56
- // Component styles
57
- $kendo-component-bg: $kendo-body-bg !default;
58
- $kendo-component-text: $kendo-body-text !default;
59
- $kendo-component-border: k-get-theme-color-var( neutral-30 ) !default;
60
-
61
- // States styles
62
- $kendo-hover-bg: k-get-theme-color-var( neutral-20 ) !default;
63
- $kendo-hover-text: k-get-theme-color-var( neutral-190 ) !default;
64
- $kendo-hover-border: k-get-theme-color-var( neutral-20 ) !default;
65
-
66
- $kendo-selected-bg: k-get-theme-color-var( neutral-30 ) !default;
67
- $kendo-selected-text: k-get-theme-color-var( neutral-160 ) !default;
68
- $kendo-selected-border: k-get-theme-color-var( neutral-130 ) !default;
69
-
70
- $kendo-selected-hover-bg: k-get-theme-color-var( neutral-40 ) !default;
71
- $kendo-selected-hover-text: k-get-theme-color-var( neutral-190 ) !default;
72
- $kendo-selected-hover-border: k-get-theme-color-var( neutral-130 ) !default;
73
-
74
- $kendo-focus-outline: k-get-theme-color-var( neutral-130 ) !default;
75
-
76
- $kendo-subtle-text: k-get-theme-color-var( neutral-130 ) !default;
77
-
78
- // Link
79
- $kendo-link-text: k-get-theme-color-var( primary-100 ) !default;
80
- $kendo-link-hover-text: k-get-theme-color-var( primary-120 ) !default;
81
-
82
- // Validator
83
- $kendo-invalid-bg: initial !default;
84
- $kendo-invalid-text: k-get-theme-color-var( error-190 ) !default;
85
- $kendo-invalid-border: k-get-theme-color-var( error-190 ) !default;
86
- $kendo-invalid-shadow: null !default;
87
-
88
- $kendo-valid-bg: initial !default;
89
- $kendo-valid-text: k-get-theme-color-var( success-190 ) !default;
90
- $kendo-valid-border: k-get-theme-color-var( success-190 ) !default;
91
- $kendo-valid-shadow: null !default;
92
-
93
- // Disabled Styling
94
- $kendo-disabled-bg: k-get-theme-color-var( neutral-20 ) !default;
95
- $kendo-disabled-text: k-get-theme-color-var( neutral-90 ) !default;
96
- $kendo-disabled-border: transparent !default;
97
-
98
- // Loading
99
- $kendo-loading-bg: $kendo-component-bg !default;
100
- $kendo-loading-text: currentColor !default;
101
-
102
-
103
- // Theme colors
104
- $kendo-theme-colors: (
105
- primary: (
106
- text: k-get-theme-color-var( primary-130 ),
107
- bg: k-get-theme-color-var( primary-20 ),
108
- border: k-get-theme-color-var( primary-20 )
109
- ),
110
- info: (
111
- text: k-get-theme-color-var( info-190 ),
112
- bg: k-get-theme-color-var( info-20 ),
113
- border: k-get-theme-color-var( info-20 )
114
- ),
115
- success: (
116
- text: k-get-theme-color-var( success-190 ),
117
- bg: k-get-theme-color-var( success-20 ),
118
- border: k-get-theme-color-var( success-20 )
119
- ),
120
- warning: (
121
- text: k-get-theme-color-var( neutral-160 ),
122
- bg: k-get-theme-color-var( warning-20 ),
123
- border: k-get-theme-color-var( warning-20 )
124
- ),
125
- error: (
126
- text: k-get-theme-color-var( error-190 ),
127
- bg: k-get-theme-color-var( error-20 ),
128
- border: k-get-theme-color-var( error-20 )
129
- )
130
- ) !default;
131
-
132
-
133
- @mixin color-system-styles() {
134
- :root {
135
- @include k-css-vars( $kendo-palettes );
136
- @include k-css-vars( $kendo-theme-colors );
137
-
138
- --kendo-body-bg: #{$kendo-body-bg};
139
- --kendo-body-text: #{$kendo-body-text};
140
-
141
- --kendo-component-bg: #{$kendo-component-bg};
142
- --kendo-component-text: #{$kendo-component-text};
143
- --kendo-component-border: #{$kendo-component-border};
144
-
145
- --kendo-link-text: #{$kendo-link-text};
146
- --kendo-link-hover-text: #{$kendo-link-hover-text};
147
-
148
- --kendo-disabled-bg: #{$kendo-disabled-bg};
149
- --kendo-disabled-text: #{$kendo-disabled-text};
150
- --kendo-disabled-border: #{$kendo-disabled-border};
151
-
152
- --kendo-hover-bg: #{$kendo-hover-bg};
153
- --kendo-hover-text: #{$kendo-hover-text};
154
- --kendo-hover-border: #{$kendo-hover-border};
155
-
156
- --kendo-selected-bg: #{$kendo-selected-bg};
157
- --kendo-selected-text: #{$kendo-selected-text};
158
- --kendo-selected-border: #{$kendo-selected-border};
159
-
160
- --kendo-selected-hover-bg: #{$kendo-selected-hover-bg};
161
- --kendo-selected-hover-text: #{$kendo-selected-hover-text};
162
- --kendo-selected-hover-border: #{$kendo-selected-hover-border};
163
-
164
- --kendo-focus-outline: #{$kendo-focus-outline};
165
-
166
- --kendo-subtle-text: #{$kendo-subtle-text};
167
-
168
- --kendo-invalid-bg: #{$kendo-invalid-bg};
169
- --kendo-invalid-text: #{$kendo-invalid-text};
170
- --kendo-invalid-border: #{$kendo-invalid-border};
171
- --kendo-invalid-shadow: #{$kendo-invalid-shadow};
172
-
173
- --kendo-border-radius-sm: #{$kendo-border-radius-sm};
174
- --kendo-border-radius-md: #{$kendo-border-radius-md};
175
- --kendo-border-radius-lg: #{$kendo-border-radius-lg};
176
- }
177
-
178
- // Text colors
179
- @each $theme-color, $color-props in $kendo-theme-colors {
180
- $_color: k-map-get( $color-props, text );
181
-
182
- .k-text-#{$theme-color},
183
- .k-color-#{$theme-color} {
184
- color: var( --kendo-text-#{$theme-color}, #{$_color} );
185
- }
186
- .\!k-text-#{$theme-color},
187
- .\!k-color-#{$theme-color} {
188
- color: var( --kendo-text-#{$theme-color}, #{$_color} ) !important; // stylelint-disable-line declaration-no-important
189
- }
190
-
191
- .k-bg-#{$theme-color} {
192
- background-color: var( --kendo-bg-#{$theme-color}, #{$_color} );
193
- }
194
- .\!k-bg-#{$theme-color} {
195
- background-color: var( --kendo-bg-#{$theme-color}, #{$_color} ) !important; // stylelint-disable-line declaration-no-important
196
- }
197
- };
198
- }