igniteui-theming 1.0.2 → 1.1.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.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/sass/themes/charts/_category-chart-theme.scss +319 -0
  3. package/sass/themes/charts/_data-chart-theme.scss +142 -0
  4. package/sass/themes/charts/_doughnut-chart-theme.scss +81 -0
  5. package/sass/themes/charts/_financial-chart-theme.scss +325 -0
  6. package/sass/themes/charts/_funnel-chart-theme.scss +98 -0
  7. package/sass/themes/charts/_gauge-theme.scss +167 -0
  8. package/sass/themes/charts/_geo-map-theme.scss +53 -0
  9. package/sass/themes/charts/_graph-theme.scss +133 -0
  10. package/sass/themes/charts/_index.scss +12 -0
  11. package/sass/themes/charts/_pie-chart-theme.scss +108 -0
  12. package/sass/themes/charts/_shape-chart-theme.scss +271 -0
  13. package/sass/themes/charts/_sparkline-theme.scss +114 -0
  14. package/sass/themes/charts/_theme.scss +27 -0
  15. package/sass/themes/schemas/_index.scss +35 -0
  16. package/sass/themes/schemas/charts/_index.scss +2 -0
  17. package/sass/themes/schemas/charts/dark/_category-chart.scss +33 -0
  18. package/sass/themes/schemas/charts/dark/_data-chart.scss +27 -0
  19. package/sass/themes/schemas/charts/dark/_doughnut-chart.scss +28 -0
  20. package/sass/themes/schemas/charts/dark/_financial-chart.scss +28 -0
  21. package/sass/themes/schemas/charts/dark/_funnel-chart.scss +28 -0
  22. package/sass/themes/schemas/charts/dark/_gauge.scss +47 -0
  23. package/sass/themes/schemas/charts/dark/_geo-map.scss +31 -0
  24. package/sass/themes/schemas/charts/dark/_graph.scss +27 -0
  25. package/sass/themes/schemas/charts/dark/_index.scss +68 -0
  26. package/sass/themes/schemas/charts/dark/_pie-chart.scss +31 -0
  27. package/sass/themes/schemas/charts/dark/_shape-chart.scss +28 -0
  28. package/sass/themes/schemas/charts/dark/_sparkline.scss +28 -0
  29. package/sass/themes/schemas/charts/light/_category-chart.scss +178 -0
  30. package/sass/themes/schemas/charts/light/_data-chart.scss +60 -0
  31. package/sass/themes/schemas/charts/light/_doughnut-chart.scss +50 -0
  32. package/sass/themes/schemas/charts/light/_financial-chart.scss +140 -0
  33. package/sass/themes/schemas/charts/light/_funnel-chart.scss +48 -0
  34. package/sass/themes/schemas/charts/light/_gauge.scss +132 -0
  35. package/sass/themes/schemas/charts/light/_geo-map.scss +35 -0
  36. package/sass/themes/schemas/charts/light/_graph.scss +86 -0
  37. package/sass/themes/schemas/charts/light/_index.scss +68 -0
  38. package/sass/themes/schemas/charts/light/_pie-chart.scss +51 -0
  39. package/sass/themes/schemas/charts/light/_shape-chart.scss +115 -0
  40. package/sass/themes/schemas/charts/light/_sparkline.scss +71 -0
  41. package/sass/typography/_mixins.scss +26 -0
  42. package/sass/typography/charts/_index.scss +19 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-theming",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
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": {
@@ -0,0 +1,319 @@
1
+ /* stylelint-disable max-line-length */
2
+ @use 'sass:map';
3
+ @use '../index' as *;
4
+ @use '../schemas/charts' as *;
5
+ @use '../../utils' as *;
6
+ @use '../../typography' as *;
7
+
8
+ ////
9
+ /// @group themes
10
+ /// @access public
11
+ /// @author <a href="https://github.com/SisIvanova" target="_blank">Silvia Ivanova</a>
12
+ ////
13
+
14
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
15
+ /// @param {Map} $target ['angular'] - The target platform to be used when scoping the theme variables.
16
+ /// @param {List} $margin [null] - Sets the margin (top, right, bottom, left) of the chart content.
17
+ /// @param {List} $brushes [series] - Defines the palette from which automatically assigned series brushes colors are selected.
18
+ /// @param {List} $marker-brushes [series]- Defines the palette from which automatically assigned series marker brushes colors are selected.
19
+ /// @param {List} $negative-brushes [series] - Defines the palette used for coloring negative items in a chart type with contextual coloring, such as Waterfall.
20
+ /// @param {List} $outlines [series] - Defines the palette from which automatically assigned series outline colors are selected.
21
+ /// @param {List} $marker-outlines [series] - Defines the palette from which automatically assigned series marker outline colors are selected.
22
+ /// @param {List} $negative-outlines [series] - Defines the brushes used for drawing negative elements in a chart type with contextual coloring, such as Waterfall.
23
+ /// @param {String} $title-alignment [null] - The horizontal alignment to use for the title.
24
+ /// @param {List} $title-margin [null] - Sets the margin (top, right, bottom, left) of the chart title.
25
+ /// @param {Color} $title-text-color [null] - Sets the color of the chart title.
26
+ /// @param {String} $title-text-style [null] - Sets the CSS font property of the chart title.
27
+ /// @param {List} $subtitle-margin [null] - Sets the margins (top, right, bottom, left) of the chart subtitle.
28
+ /// @param {String} $subtitle-alignment [null] - The horizontal alignment to use for the subtitle.
29
+ /// @param {Color} $subtitle-text-color [null] - Sets the color of the chart subtitle.
30
+ /// @param {String} $subtitle-text-style [null] - Sets the CSS font property of the chart subtitle.
31
+ /// @param {Number} $thickness [null] - Sets the thickness for all series in a chart.
32
+ /// @param {List} $trend-line-brushes [series] - Defines the palette of brushes used for coloring trend lines in a chart.
33
+ /// @param {Number} $trend-line-thickness [null] - Sets the thickness of the trend lines in a chart of type point, line, spline or bubble.
34
+ /// @param {List} $x-axis-label-margin [null] - Sets the margin (top, right, bottom, left) of labels on the X-axis.
35
+ /// @param {Color} $x-axis-label-text-color [null] - Sets the color of labels on the X-axis.
36
+ /// @param {String} $x-axis-label-text-style [null] - Sets the CSS font property for labels on X-axis.
37
+ /// @param {String} $x-axis-label-vertical-alignment [null] - Sets the vertical alignment of X-axis labels.
38
+ /// @param {Color} $x-axis-major-stroke [null] - Sets the color to apply to major gridlines along the X-axis.
39
+ /// @param {Number} $x-axis-major-stroke-thickness [null] - Sets the thickness to apply to major gridlines along the X-axis.
40
+ /// @param {Color} $x-axis-minor-stroke [null] - Sets the color to apply to minor gridlines along the X-axis.
41
+ /// @param {Number} $x-axis-minor-stroke-thickness [null] - Sets the thickness to apply to minor gridlines along the X-axis.
42
+ /// @param {Color} $x-axis-strip [null] - Sets the color to apply to stripes along the X-axis.
43
+ /// @param {Color} $x-axis-stroke [null] - Sets the color to apply to the X-axis line.
44
+ /// @param {Number} $x-axis-stroke-thickness [null] - Sets the thickness to apply to the X-axis line.
45
+ /// @param {Number} $x-axis-tick-length [null] - Sets the length of tickmarks along the X-axis.
46
+ /// @param {Color} $x-axis-tick-stroke [null] - Sets the color to apply to tickmarks along the X-axis.
47
+ /// @param {Number} $x-axis-tick-stroke-thickness [null] - Sets the thickness to apply to tickmarks along the X-axis.
48
+ /// @param {String} $x-axis-title-alignment [null] - Sets the horizontal alignment of the X-axis title.
49
+ /// @param {List} $x-axis-title-margin [null] - Sets the margin (top, right, bottom, left) of a title on the X-axis.
50
+ /// @param {Color} $x-axis-title-text-color [null] - Sets the color of the title on the X-axis.
51
+ /// @param {String} $x-axis-title-text-style [null] - Sets the CSS font property for the title on the X-axis.
52
+ /// @param {List} $y-axis-label-margin [null] - Sets the margin (top, right, bottom, left) of labels on the Y-axis.
53
+ /// @param {Color} $y-axis-label-text-color [null] - Sets the color of labels on the Y-axis.
54
+ /// @param {String} $y-axis-label-text-style [null] - Sets the CSS font property for labels on Y-axis.
55
+ /// @param {String} $y-axis-label-vertical-alignment [null] - Sets the vertical alignment of Y-axis labels.
56
+ /// @param {Color} $y-axis-major-stroke [null] - Sets the color to apply to major gridlines along the y-axis.
57
+ /// @param {Number} $y-axis-major-stroke-thickness [null] - Sets the thickness to apply to major gridlines along the Y-axis.
58
+ /// @param {Color} $y-axis-minor-stroke [null] - Sets the color to apply to minor gridlines along the Y-axis.
59
+ /// @param {Number} $y-axis-minor-stroke-thickness [null] - Sets the thickness to apply to minor gridlines along the Y-axis.
60
+ /// @param {Color} $y-axis-strip [null] - Sets the color to apply to stripes along the Y-axis.
61
+ /// @param {Color} $y-axis-stroke [null] - Sets the color to apply to the Y-axis line.
62
+ /// @param {Number} $y-axis-stroke-thickness [null] - Sets the thickness to apply to the Y-axis line.
63
+ /// @param {String} $y-axis-title-alignment [null] - Sets the horizontal alignment of the Y-axis title.
64
+ /// @param {List} $y-axis-title-margin [null] - Sets the margin (top, right, bottom, left) of a title on the Y-axis.
65
+ /// @param {Color} $y-axis-title-text-color [null] - Sets the color of a title on the Y-axis.
66
+ /// @param {String} $y-axis-title-text-style [null] - Sets the CSS font property for the title on the Y-axis.
67
+ /// @param {Number} $y-axis-tick-length [null] - Sets the length of tickmarks along the Y-axis.
68
+ /// @param {Color} $y-axis-tick-stroke [null] - Sets the color to apply to tickmarks along the Y-axis.
69
+ /// @param {Number} $y-axis-tick-stroke-thickness [null] - Sets the thickness to apply to tickmarks along the Y-axis.
70
+ /// @requires $light-schema
71
+ /// @requires extend
72
+ ///
73
+ /// @example scss
74
+ /// $custom-chart-theme: category-chart-theme($brushes: (red, green, blue));
75
+ /// // Pass the theme to the css-vars mixin
76
+ /// @include css-vars($custom-chart-theme);
77
+ @function category-chart-theme(
78
+ $schema: $light-material-schema,
79
+ $target: 'angular',
80
+
81
+ $margin: null,
82
+ $brushes: null,
83
+ $marker-brushes: null,
84
+ $negative-brushes: null,
85
+ $outlines: null,
86
+ $marker-outlines: null,
87
+ $negative-outlines: null,
88
+ $title-margin: null,
89
+ $title-alignment: null,
90
+ $title-text-color: null,
91
+ $title-text-style: null,
92
+ $subtitle-margin: null,
93
+ $subtitle-alignment: null,
94
+ $subtitle-text-color: null,
95
+ $subtitle-text-style: null,
96
+ $thickness: null,
97
+ $trend-line-brushes: null,
98
+ $trend-line-thickness: null,
99
+ $x-axis-label-margin: null,
100
+ $x-axis-label-text-color: null,
101
+ $x-axis-label-text-style: null,
102
+ $x-axis-label-vertical-alignment: null,
103
+ $x-axis-major-stroke: null,
104
+ $x-axis-major-stroke-thickness: null,
105
+ $x-axis-minor-stroke: null,
106
+ $x-axis-minor-stroke-thickness: null,
107
+ $x-axis-strip: null,
108
+ $x-axis-stroke: null,
109
+ $x-axis-stroke-thickness: null,
110
+ $x-axis-tick-length: null,
111
+ $x-axis-tick-stroke: null,
112
+ $x-axis-tick-stroke-thickness: null,
113
+ $x-axis-title-alignment: null,
114
+ $x-axis-title-margin: null,
115
+ $x-axis-title-text-color: null,
116
+ $x-axis-title-text-style: null,
117
+ $y-axis-label-margin: null,
118
+ $y-axis-label-text-color: null,
119
+ $y-axis-label-text-style: null,
120
+ $y-axis-label-vertical-alignment: null,
121
+ $y-axis-major-stroke: null,
122
+ $y-axis-major-stroke-thickness: null,
123
+ $y-axis-minor-stroke: null,
124
+ $y-axis-minor-stroke-thickness: null,
125
+ $y-axis-strip: null,
126
+ $y-axis-stroke: null,
127
+ $y-axis-stroke-thickness: null,
128
+ $y-axis-title-alignment: null,
129
+ $y-axis-title-margin: null,
130
+ $y-axis-title-text-color: null,
131
+ $y-axis-title-text-style: null,
132
+ $y-axis-tick-length: null,
133
+ $y-axis-tick-stroke: null,
134
+ $y-axis-tick-stroke-thickness: null
135
+ ) {
136
+ $name: 'category-chart';
137
+ $selector: map.get(
138
+ (
139
+ 'angular': 'igx-category-chart',
140
+ 'webc': 'igc-category-chart',
141
+ 'blazor': 'igb-category-chart'
142
+ ),
143
+ $target
144
+ );
145
+ $chart-schema: ();
146
+
147
+ @if map.has-key($schema, $name) {
148
+ $chart-schema: map.get($schema, $name);
149
+ } @else {
150
+ $chart-schema: $schema;
151
+ }
152
+
153
+ $theme: digest-schema($chart-schema);
154
+ $margin-default: map.get($theme, 'margin');
155
+ $title-margin-default: map.get($theme, 'title-margin');
156
+ $subtitle-margin-default: map.get($theme, 'subtitle-margin');
157
+ $x-axis-label-margin-default: map.get($theme, 'x-axis-label-margin');
158
+ $x-axis-title-margin-default: map.get($theme, 'x-axis-title-margin');
159
+ $y-axis-label-margin-default: map.get($theme, 'y-axis-label-margin');
160
+ $y-axis-title-margin-default: map.get($theme, 'y-axis-title-margin');
161
+
162
+ @if not($margin) {
163
+ $margin: $margin-default;
164
+ } @else {
165
+ $margin: expand-shorthand(($margin));
166
+ }
167
+
168
+ @if not($title-margin) {
169
+ $title-margin: $title-margin-default;
170
+ } @else {
171
+ $title-margin: map-keys-prefix(expand-shorthand(($title-margin)), 'title');
172
+ }
173
+
174
+ @if not($subtitle-margin) {
175
+ $subtitle-margin: $subtitle-margin-default;
176
+ } @else {
177
+ $subtitle-margin: map-keys-prefix(expand-shorthand(($subtitle-margin)), 'subtitle');
178
+ }
179
+
180
+ @if not($x-axis-label-margin) {
181
+ $x-axis-label-margin: $x-axis-label-margin-default;
182
+ } @else {
183
+ $x-axis-label-margin: map-keys-prefix(expand-shorthand(($x-axis-label-margin)), 'x-axis-label');
184
+ }
185
+
186
+ @if not($x-axis-title-margin) {
187
+ $x-axis-title-margin: $x-axis-title-margin-default;
188
+ } @else {
189
+ $x-axis-title-margin: map-keys-prefix(expand-shorthand(($x-axis-title-margin)), 'x-axis-title');
190
+ }
191
+
192
+ @if not($y-axis-label-margin) {
193
+ $y-axis-label-margin: $y-axis-label-margin-default;
194
+ } @else {
195
+ $y-axis-label-margin: map-keys-prefix(expand-shorthand(($y-axis-label-margin)), 'y-axis-label');
196
+ }
197
+
198
+ @if not($y-axis-title-margin) {
199
+ $y-axis-title-margin: $y-axis-title-margin-default;
200
+ } @else {
201
+ $y-axis-title-margin: map-keys-prefix(expand-shorthand(($y-axis-title-margin)), 'y-axis-title');
202
+ }
203
+
204
+ @return extend(
205
+ $theme,
206
+ $margin,
207
+ $title-margin,
208
+ $subtitle-margin,
209
+ $x-axis-label-margin,
210
+ $x-axis-title-margin,
211
+ $y-axis-label-margin,
212
+ $y-axis-title-margin,
213
+ (
214
+ name: $name,
215
+ selector: $selector,
216
+ brushes: $brushes,
217
+ marker-brushes: $marker-brushes,
218
+ negative-brushes: $negative-brushes,
219
+ outlines: $outlines,
220
+ marker-outlines: $marker-outlines,
221
+ negative-outlines: $negative-outlines,
222
+ title-alignment: $title-alignment,
223
+ title-text-color: $title-text-color,
224
+ title-text-style: $title-text-style,
225
+ subtitle-alignment: $subtitle-alignment,
226
+ subtitle-text-color: $subtitle-text-color,
227
+ subtitle-text-style: $subtitle-text-style,
228
+ thickness: $thickness,
229
+ trend-line-brushes: $trend-line-brushes,
230
+ trend-line-thickness: $trend-line-thickness,
231
+ x-axis-label-text-color: $x-axis-label-text-color,
232
+ x-axis-label-text-style: $x-axis-label-text-style,
233
+ x-axis-label-vertical-alignment: $x-axis-label-vertical-alignment,
234
+ x-axis-major-stroke: $x-axis-major-stroke,
235
+ x-axis-major-stroke-thickness: $x-axis-major-stroke-thickness,
236
+ x-axis-minor-stroke: $x-axis-minor-stroke,
237
+ x-axis-minor-stroke-thickness: $x-axis-minor-stroke-thickness,
238
+ x-axis-strip: $x-axis-strip,
239
+ x-axis-stroke: $x-axis-stroke,
240
+ x-axis-stroke-thickness: $x-axis-stroke-thickness,
241
+ x-axis-tick-length: $x-axis-tick-length,
242
+ x-axis-tick-stroke: $x-axis-tick-stroke,
243
+ x-axis-tick-stroke-thickness: $x-axis-tick-stroke-thickness,
244
+ x-axis-title-alignment: $x-axis-title-alignment,
245
+ x-axis-title-text-color: $x-axis-title-text-color,
246
+ x-axis-title-text-style: $x-axis-title-text-style,
247
+ y-axis-label-text-color: $y-axis-label-text-color,
248
+ y-axis-label-text-style: $y-axis-label-text-style,
249
+ y-axis-label-vertical-alignment: $y-axis-label-vertical-alignment,
250
+ y-axis-major-stroke: $y-axis-major-stroke,
251
+ y-axis-major-stroke-thickness: $y-axis-major-stroke-thickness,
252
+ y-axis-minor-stroke: $y-axis-minor-stroke,
253
+ y-axis-minor-stroke-thickness: $y-axis-minor-stroke-thickness,
254
+ y-axis-strip: $y-axis-strip,
255
+ y-axis-stroke: $y-axis-stroke,
256
+ y-axis-stroke-thickness: $y-axis-stroke-thickness,
257
+ y-axis-title-alignment: $y-axis-title-alignment,
258
+ y-axis-title-text-color: $y-axis-title-text-color,
259
+ y-axis-title-text-style: $y-axis-title-text-style,
260
+ y-axis-tick-length: $y-axis-tick-length,
261
+ y-axis-tick-stroke: $y-axis-tick-stroke,
262
+ y-axis-tick-stroke-thickness: $y-axis-tick-stroke-thickness
263
+ )
264
+ );
265
+ }
266
+
267
+ /// Adds typography styles for the category-chart component.
268
+ /// Uses the 'h6', 'subtitle-1' and 'body-2'
269
+ /// category from the typographic scale.
270
+ /// @group typography
271
+ /// @param {Map} $type-scale - A typographic scale as produced by type-scale.
272
+ /// @param {Map} $categories [(
273
+ /// 'title': 'h6',
274
+ /// 'subtitle': 'subtitle-1,
275
+ /// 'x-axis-label-text-style': 'body-2',
276
+ /// 'y-axis-label-text-style': 'body-2',
277
+ /// 'x-axis-title-text-style': 'body-2',
278
+ /// 'y-axis-title-text-style': 'body-2',
279
+ /// )] - The categories from the typographic scale used for type styles.
280
+ /// @requires {mixin} type-style
281
+ @mixin category-chart-typography($type-scale, $categories: (
282
+ 'title': 'h6',
283
+ 'subtitle': 'subtitle-1',
284
+ 'x-axis-label-text-style': 'body-2',
285
+ 'x-axis-title-text-style': 'body-2',
286
+ 'y-axis-label-text-style': 'body-2',
287
+ 'y-axis-title-text-style': 'body-2',
288
+ ), $target: 'angular') {
289
+ $name: 'category-chart';
290
+ $selector: map.get(
291
+ (
292
+ 'angular': 'igx-category-chart',
293
+ 'webc': 'igc-category-chart',
294
+ 'blazor': 'igb-category-chart'
295
+ ),
296
+ $target
297
+ );
298
+ $title: map.get($categories, 'title');
299
+ $subtitle: map.get($categories, 'subtitle');
300
+ $x-axis-label-text-style: map.get($categories, 'x-axis-label-text-style');
301
+ $x-axis-title-text-style: map.get($categories, 'x-axis-title-text-style');
302
+ $y-axis-label-text-style: map.get($categories, 'y-axis-label-text-style');
303
+ $y-axis-title-text-style: map.get($categories, 'y-axis-title-text-style');
304
+ $title-styles: type-scale-category($type-scale, $title);
305
+ $subtitle-styles: type-scale-category($type-scale, $subtitle);
306
+ $x-axis-label-styles: type-scale-category($type-scale, $x-axis-label-text-style);
307
+ $x-axis-title-styles: type-scale-category($type-scale, $x-axis-title-text-style);
308
+ $y-axis-label-styles: type-scale-category($type-scale, $y-axis-label-text-style);
309
+ $y-axis-title-styles: type-scale-category($type-scale, $y-axis-title-text-style);
310
+
311
+ #{$selector} {
312
+ @include font-var('title-text-style', $title-styles, $name);
313
+ @include font-var('subtitle-text-style', $subtitle-styles, $name);
314
+ @include font-var('x-axis-label-text-style', $x-axis-label-styles, $name);
315
+ @include font-var('x-axis-title-text-style', $x-axis-title-styles, $name);
316
+ @include font-var('y-axis-label-text-style', $y-axis-label-styles, $name);
317
+ @include font-var('y-axis-title-text-style', $y-axis-title-styles, $name);
318
+ }
319
+ }
@@ -0,0 +1,142 @@
1
+ /* stylelint-disable max-line-length */
2
+ @use 'sass:map';
3
+ @use '../index' as *;
4
+ @use '../schemas/charts' as *;
5
+ @use '../../utils' as *;
6
+ @use '../../typography' as *;
7
+
8
+ ////
9
+ /// @group themes
10
+ /// @access public
11
+ /// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
12
+ ////
13
+
14
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
15
+ /// @param {Map} $target ['angular'] - The target platform to be used when scoping the theme variables.
16
+ /// @param {List} $margin [null] - Sets the margin (top, right, bottom, left) of the chart content.
17
+ /// @param {Color} $title-text-color [null] - Sets the color of the chart title.
18
+ /// @param {List} $title-margin [null] - Sets the margin (top, right, bottom, left) of the chart title.
19
+ /// @param {Color} $subtitle-text-color [null] - Sets the color of the chart subtitle.
20
+ /// @param {List} $subtitle-margin [null] - Sets the margins (top, right, bottom, left) of the chart subtitle.
21
+ /// @param {List} $brushes [null] - Defines the palette from which automatically assigned series colors are selected.
22
+ /// @param {List} $marker-brushes [null] - Defines the palette from which automatically assigned marker brushes are selected.
23
+ /// @param {List} $outlines [null] - Defines the palette from which automatically assigned series outline colors are selected.
24
+ /// @param {List} $marker-outlines [null] - Defines the palette from which automatically assigned marker outlines are selected.
25
+ /// @param {Color} $plot-area-background [null] - Sets the brush used as the background for the current Chart object's plot area.
26
+ /// @param {String} $title-horizontal-alignment [null] - The horizontal alignment to use for the title. Valid options are 'left', 'center', and 'right';
27
+ /// @param {String} $subtitle-horizontal-alignment [null] - The horizontal alignment to use for the subtitle. Valid options are 'left', 'center', and 'right';
28
+ /// @requires $light-schema
29
+ /// @requires extend
30
+ ///
31
+ /// @example scss
32
+ /// $my-chart-theme: data-chart-theme($brushes: (orange, blue, pink));
33
+ /// // Pass the theme to the css-vars mixin
34
+ /// @include css-vars($my-chart-theme);
35
+ @function data-chart-theme(
36
+ $schema: $light-material-schema,
37
+ $target: 'angular',
38
+
39
+ $margin: null,
40
+ $title-text-color: null,
41
+ $title-margin: null,
42
+ $subtitle-text-color: null,
43
+ $subtitle-margin: null,
44
+ $brushes: null,
45
+ $outlines: null,
46
+ $marker-brushes: null,
47
+ $marker-outlines: null,
48
+ $plot-area-background: null,
49
+ $title-horizontal-alignment: null,
50
+ $subtitle-horizontal-alignment: null,
51
+ ) {
52
+ $name: 'data-chart';
53
+ $selector: map.get(
54
+ (
55
+ 'angular': 'igx-data-chart',
56
+ 'webc': 'igc-data-chart',
57
+ 'blazor': 'igb-data-chart'
58
+ ),
59
+ $target
60
+ );
61
+ $chart-schema: ();
62
+
63
+ @if map.has-key($schema, $name) {
64
+ $chart-schema: map.get($schema, $name);
65
+ } @else {
66
+ $chart-schema: $schema;
67
+ }
68
+
69
+ $theme: digest-schema($chart-schema);
70
+ $margin-default: map.get($theme, 'margin');
71
+ $title-margin-default: map.get($theme, 'title-margin');
72
+ $subtitle-margin-default: map.get($theme, 'subtitle-margin');
73
+
74
+ @if not($margin) {
75
+ $margin: $margin-default;
76
+ } @else {
77
+ $margin: expand-shorthand(($margin));
78
+ }
79
+
80
+ @if not($title-margin) {
81
+ $title-margin: $title-margin-default;
82
+ } @else {
83
+ $title-margin: map-keys-prefix(expand-shorthand(($title-margin)), 'title');
84
+ }
85
+
86
+ @if not($subtitle-margin) {
87
+ $subtitle-margin: $subtitle-margin-default;
88
+ } @else {
89
+ $subtitle-margin: map-keys-prefix(expand-shorthand(($subtitle-margin)), 'subtitle');
90
+ }
91
+
92
+ @return extend(
93
+ $theme,
94
+ $margin,
95
+ $title-margin,
96
+ $subtitle-margin,
97
+ (
98
+ name: $name,
99
+ selector: $selector,
100
+ title-text-color: $title-text-color,
101
+ subtitle-text-color: null,
102
+ brushes: $brushes,
103
+ outlines: $outlines,
104
+ marker-brushes: $marker-brushes,
105
+ marker-outlines: $marker-outlines,
106
+ plot-area-background: $plot-area-background,
107
+ title-horizontal-alignment: $title-horizontal-alignment,
108
+ subtitle-horizontal-alignment: $subtitle-horizontal-alignment,
109
+ )
110
+ );
111
+ }
112
+
113
+ /// Adds typography styles for the data-chart component.
114
+ /// Uses the 'h6' and 'subtitle-1'
115
+ /// category from the typographic scale.
116
+ /// @group typography
117
+ /// @param {Map} $type-scale - A typographic scale as produced by type-scale.
118
+ /// @param {Map} $categories [(title: 'h6', subtitle: 'subtitle-1')] - The categories from the typographic scale used for type styles.
119
+ /// @requires {mixin} type-style
120
+ @mixin data-chart-typography($type-scale, $categories: (
121
+ title: 'h6',
122
+ subtitle: 'subtitle-1',
123
+ ), $target: 'angular') {
124
+ $name: 'data-chart';
125
+ $title: map.get($categories, 'title');
126
+ $subtitle: map.get($categories, 'subtitle');
127
+ $title-styles: type-scale-category($type-scale, $title);
128
+ $subtitle-styles: type-scale-category($type-scale, $subtitle);
129
+ $selector: map.get(
130
+ (
131
+ 'angular': 'igx-data-chart',
132
+ 'webc': 'igc-data-chart',
133
+ 'blazor': 'igb-data-chart'
134
+ ),
135
+ $target
136
+ );
137
+
138
+ #{$selector} {
139
+ @include font-var('title-text-style', $title-styles, $name);
140
+ @include font-var('subtitle-text-style', $subtitle-styles, $name);
141
+ }
142
+ }
@@ -0,0 +1,81 @@
1
+ @use 'sass:map';
2
+ @use '../index' as *;
3
+ @use '../schemas/charts' as *;
4
+ @use '../../utils' as *;
5
+ @use '../../typography' as *;
6
+
7
+ ////
8
+ /// @group themes
9
+ /// @access public
10
+ /// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
11
+ ////
12
+
13
+ /// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
14
+ /// @param {Map} $target ['angular'] - The target platform to be used when scoping the theme variables.
15
+ /// @param {Color} $others-category-fill [null] - Sets the fill color for others category.
16
+ /// @param {Number} $others-category-opacity [null] - Sets the opacity for others category.
17
+ /// @param {Color} $others-category-stroke [null] - Sets the others category stroke color.
18
+ /// @param {Number} $others-category-stroke-thickness [null] - Sets the others category stroke thickness.
19
+ /// @param {Color} $selected-slice-fill [null] - Sets the fill color of the selected slice.
20
+ /// @param {Number} $selected-slice-opacity [null] - Sets the opacity of the selected slice.
21
+ /// @param {Color} $selected-slice-stroke [null] - Sets the stroke color of the selected slice.
22
+ /// @param {Number} $selected-slice-stroke-thickness [null] - Sets the stroke thickness of the selected slice.
23
+ /// @requires $light-schema
24
+ /// @requires extend
25
+ ///
26
+ /// @example scss
27
+ /// $my-chart-theme: doughnut-chart-theme($brushes: (orange, blue, pink));
28
+ /// // Pass the theme to the css-vars mixin
29
+ /// @include css-vars($my-chart-theme);
30
+ @function doughnut-chart-theme(
31
+ $schema: $light-material-schema,
32
+ $target: 'angular',
33
+
34
+ $brushes: null,
35
+ $outlines: null,
36
+ $others-category-fill: null,
37
+ $others-category-opacity: null,
38
+ $others-category-stroke: null,
39
+ $others-category-stroke-thickness: null,
40
+ $selected-slice-fill: null,
41
+ $selected-slice-opacity: null,
42
+ $selected-slice-stroke: null,
43
+ $selected-slice-stroke-thickness: null,
44
+ ) {
45
+ $name: 'doughnut-chart';
46
+ $selector: map.get(
47
+ (
48
+ 'angular': 'igx-doughnut-chart',
49
+ 'webc': 'igc-doughnut-chart',
50
+ 'blazor': 'igb-doughnut-chart'
51
+ ),
52
+ $target
53
+ );
54
+ $chart-schema: ();
55
+
56
+ @if map.has-key($schema, $name) {
57
+ $chart-schema: map.get($schema, $name);
58
+ } @else {
59
+ $chart-schema: $schema;
60
+ }
61
+
62
+ $theme: digest-schema($chart-schema);
63
+
64
+ @return extend(
65
+ $theme,
66
+ (
67
+ name: 'ring-series',
68
+ selector: $selector,
69
+ brushes: $brushes,
70
+ outlines: $outlines,
71
+ others-category-fill: $others-category-fill,
72
+ others-category-opacity: $others-category-opacity,
73
+ others-category-stroke: $others-category-stroke,
74
+ others-category-stroke-thickness: $others-category-stroke-thickness,
75
+ selected-slice-fill: $selected-slice-fill,
76
+ selected-slice-opacity: $selected-slice-opacity,
77
+ selected-slice-stroke: $selected-slice-stroke,
78
+ selected-slice-stroke-thickness: $selected-slice-stroke-thickness,
79
+ )
80
+ );
81
+ }