chartist 1.5.0 → 2.0.0-rc.2

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 (138) hide show
  1. package/README.md +45 -101
  2. package/dist/_settings.scss +1 -89
  3. package/dist/chartist.min.css +2 -0
  4. package/dist/chartist.min.js +2 -0
  5. package/dist/compat.cjs +624 -0
  6. package/dist/compat.cjs.map +1 -0
  7. package/dist/compat.d.cts +202 -0
  8. package/dist/compat.d.ts +201 -0
  9. package/dist/compat.js +603 -0
  10. package/dist/compat.js.map +1 -0
  11. package/dist/compat.min.js +2 -0
  12. package/dist/compat.min.js.map +1 -0
  13. package/dist/compat.umd.js +2 -0
  14. package/dist/compat.umd.js.map +1 -0
  15. package/dist/index.cjs +5970 -3489
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.css +903 -2
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.cts +5167 -0
  20. package/dist/index.d.ts +5166 -8
  21. package/dist/index.js +5935 -3484
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.css +2 -0
  24. package/dist/index.min.css.map +1 -0
  25. package/dist/index.min.js +2 -0
  26. package/dist/index.min.js.map +1 -0
  27. package/dist/index.scss +1 -204
  28. package/dist/index.umd.js +2 -2
  29. package/dist/index.umd.js.map +1 -1
  30. package/dist/scss/_settings.scss +155 -0
  31. package/dist/scss/index.scss +262 -0
  32. package/dist/scss/themes/accessible.scss +53 -0
  33. package/dist/themes/accessible.css +34 -0
  34. package/dist/themes/accessible.min.css +1 -0
  35. package/package.json +238 -12
  36. package/dist/axes/AutoScaleAxis.d.ts +0 -12
  37. package/dist/axes/AutoScaleAxis.d.ts.map +0 -1
  38. package/dist/axes/Axis.d.ts +0 -40
  39. package/dist/axes/Axis.d.ts.map +0 -1
  40. package/dist/axes/FixedScaleAxis.d.ts +0 -11
  41. package/dist/axes/FixedScaleAxis.d.ts.map +0 -1
  42. package/dist/axes/StepAxis.d.ts +0 -9
  43. package/dist/axes/StepAxis.d.ts.map +0 -1
  44. package/dist/axes/index.d.ts +0 -6
  45. package/dist/axes/index.d.ts.map +0 -1
  46. package/dist/axes/types.d.ts +0 -5
  47. package/dist/axes/types.d.ts.map +0 -1
  48. package/dist/charts/BarChart/BarChart.d.ts +0 -50
  49. package/dist/charts/BarChart/BarChart.d.ts.map +0 -1
  50. package/dist/charts/BarChart/BarChart.types.d.ts +0 -66
  51. package/dist/charts/BarChart/BarChart.types.d.ts.map +0 -1
  52. package/dist/charts/BarChart/index.d.ts +0 -3
  53. package/dist/charts/BarChart/index.d.ts.map +0 -1
  54. package/dist/charts/BaseChart.d.ts +0 -47
  55. package/dist/charts/BaseChart.d.ts.map +0 -1
  56. package/dist/charts/LineChart/LineChart.d.ts +0 -97
  57. package/dist/charts/LineChart/LineChart.d.ts.map +0 -1
  58. package/dist/charts/LineChart/LineChart.types.d.ts +0 -83
  59. package/dist/charts/LineChart/LineChart.types.d.ts.map +0 -1
  60. package/dist/charts/LineChart/index.d.ts +0 -3
  61. package/dist/charts/LineChart/index.d.ts.map +0 -1
  62. package/dist/charts/PieChart/PieChart.d.ts +0 -101
  63. package/dist/charts/PieChart/PieChart.d.ts.map +0 -1
  64. package/dist/charts/PieChart/PieChart.types.d.ts +0 -95
  65. package/dist/charts/PieChart/PieChart.types.d.ts.map +0 -1
  66. package/dist/charts/PieChart/index.d.ts +0 -3
  67. package/dist/charts/PieChart/index.d.ts.map +0 -1
  68. package/dist/charts/index.d.ts +0 -6
  69. package/dist/charts/index.d.ts.map +0 -1
  70. package/dist/charts/types.d.ts +0 -11
  71. package/dist/charts/types.d.ts.map +0 -1
  72. package/dist/core/constants.d.ts +0 -13
  73. package/dist/core/constants.d.ts.map +0 -1
  74. package/dist/core/creation.d.ts +0 -61
  75. package/dist/core/creation.d.ts.map +0 -1
  76. package/dist/core/data/bounds.d.ts +0 -14
  77. package/dist/core/data/bounds.d.ts.map +0 -1
  78. package/dist/core/data/data.d.ts +0 -23
  79. package/dist/core/data/data.d.ts.map +0 -1
  80. package/dist/core/data/highLow.d.ts +0 -13
  81. package/dist/core/data/highLow.d.ts.map +0 -1
  82. package/dist/core/data/index.d.ts +0 -7
  83. package/dist/core/data/index.d.ts.map +0 -1
  84. package/dist/core/data/normalize.d.ts +0 -11
  85. package/dist/core/data/normalize.d.ts.map +0 -1
  86. package/dist/core/data/segments.d.ts +0 -29
  87. package/dist/core/data/segments.d.ts.map +0 -1
  88. package/dist/core/data/serialize.d.ts +0 -12
  89. package/dist/core/data/serialize.d.ts.map +0 -1
  90. package/dist/core/index.d.ts +0 -8
  91. package/dist/core/index.d.ts.map +0 -1
  92. package/dist/core/lang.d.ts +0 -23
  93. package/dist/core/lang.d.ts.map +0 -1
  94. package/dist/core/math.d.ts +0 -42
  95. package/dist/core/math.d.ts.map +0 -1
  96. package/dist/core/optionsProvider.d.ts +0 -15
  97. package/dist/core/optionsProvider.d.ts.map +0 -1
  98. package/dist/core/types.d.ts +0 -274
  99. package/dist/core/types.d.ts.map +0 -1
  100. package/dist/event/EventEmitter.d.ts +0 -27
  101. package/dist/event/EventEmitter.d.ts.map +0 -1
  102. package/dist/event/index.d.ts +0 -2
  103. package/dist/event/index.d.ts.map +0 -1
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/interpolation/cardinal.d.ts +0 -30
  106. package/dist/interpolation/cardinal.d.ts.map +0 -1
  107. package/dist/interpolation/index.d.ts +0 -6
  108. package/dist/interpolation/index.d.ts.map +0 -1
  109. package/dist/interpolation/monotoneCubic.d.ts +0 -30
  110. package/dist/interpolation/monotoneCubic.d.ts.map +0 -1
  111. package/dist/interpolation/none.d.ts +0 -22
  112. package/dist/interpolation/none.d.ts.map +0 -1
  113. package/dist/interpolation/simple.d.ts +0 -30
  114. package/dist/interpolation/simple.d.ts.map +0 -1
  115. package/dist/interpolation/step.d.ts +0 -26
  116. package/dist/interpolation/step.d.ts.map +0 -1
  117. package/dist/svg/Svg.d.ts +0 -201
  118. package/dist/svg/Svg.d.ts.map +0 -1
  119. package/dist/svg/SvgList.d.ts +0 -31
  120. package/dist/svg/SvgList.d.ts.map +0 -1
  121. package/dist/svg/SvgPath.d.ts +0 -125
  122. package/dist/svg/SvgPath.d.ts.map +0 -1
  123. package/dist/svg/animation.d.ts +0 -37
  124. package/dist/svg/animation.d.ts.map +0 -1
  125. package/dist/svg/index.d.ts +0 -6
  126. package/dist/svg/index.d.ts.map +0 -1
  127. package/dist/svg/types.d.ts +0 -55
  128. package/dist/svg/types.d.ts.map +0 -1
  129. package/dist/utils/extend.d.ts +0 -10
  130. package/dist/utils/extend.d.ts.map +0 -1
  131. package/dist/utils/functional.d.ts +0 -31
  132. package/dist/utils/functional.d.ts.map +0 -1
  133. package/dist/utils/index.d.ts +0 -5
  134. package/dist/utils/index.d.ts.map +0 -1
  135. package/dist/utils/types.d.ts +0 -7
  136. package/dist/utils/types.d.ts.map +0 -1
  137. package/dist/utils/utils.d.ts +0 -31
  138. package/dist/utils/utils.d.ts.map +0 -1
@@ -0,0 +1,155 @@
1
+ @use 'sass:math';
2
+
3
+ // Scales for responsive SVG containers
4
+ $ct-scales: (
5
+ (1),
6
+ math.div(15, 16),
7
+ math.div(8, 9),
8
+ math.div(5, 6),
9
+ math.div(4, 5),
10
+ math.div(3, 4),
11
+ math.div(2, 3),
12
+ math.div(5, 8),
13
+ math.div(1, 1.618),
14
+ math.div(3, 5),
15
+ math.div(9, 16),
16
+ math.div(8, 15),
17
+ math.div(1, 2),
18
+ math.div(2, 5),
19
+ math.div(3, 8),
20
+ math.div(1, 3),
21
+ math.div(1, 4)
22
+ ) !default;
23
+ $ct-scales-names: (
24
+ ct-square,
25
+ ct-minor-second,
26
+ ct-major-second,
27
+ ct-minor-third,
28
+ ct-major-third,
29
+ ct-perfect-fourth,
30
+ ct-perfect-fifth,
31
+ ct-minor-sixth,
32
+ ct-golden-section,
33
+ ct-major-sixth,
34
+ ct-minor-seventh,
35
+ ct-major-seventh,
36
+ ct-octave,
37
+ ct-major-tenth,
38
+ ct-major-eleventh,
39
+ ct-major-twelfth,
40
+ ct-double-octave
41
+ ) !default;
42
+
43
+ // Class names to be used when generating CSS
44
+ $ct-class-chart: ct-chart !default;
45
+ $ct-class-chart-line: ct-chart-line !default;
46
+ $ct-class-chart-bar: ct-chart-bar !default;
47
+ $ct-class-horizontal-bars: ct-horizontal-bars !default;
48
+ $ct-class-chart-pie: ct-chart-pie !default;
49
+ $ct-class-chart-donut: ct-chart-donut !default;
50
+ $ct-class-label: ct-label !default;
51
+ $ct-class-series: ct-series !default;
52
+ $ct-class-line: ct-line !default;
53
+ $ct-class-point: ct-point !default;
54
+ $ct-class-area: ct-area !default;
55
+ $ct-class-bar: ct-bar !default;
56
+ $ct-class-slice-pie: ct-slice-pie !default;
57
+ $ct-class-slice-donut: ct-slice-donut !default;
58
+ $ct-class-grid: ct-grid !default;
59
+ $ct-class-grid-background: ct-grid-background !default;
60
+ $ct-class-vertical: ct-vertical !default;
61
+ $ct-class-horizontal: ct-horizontal !default;
62
+ $ct-class-start: ct-start !default;
63
+ $ct-class-end: ct-end !default;
64
+
65
+ // Container ratio
66
+ $ct-container-ratio: math.div(1, 1.618) !default;
67
+
68
+ // Text styles for labels
69
+ $ct-text-color: rgba(0, 0, 0, 0.4) !default;
70
+ $ct-text-size: 0.75rem !default;
71
+ $ct-text-align: flex-start !default;
72
+ $ct-text-justify: flex-start !default;
73
+ $ct-text-line-height: 1 !default;
74
+
75
+ // Grid styles
76
+ $ct-grid-color: rgba(0, 0, 0, 0.2) !default;
77
+ $ct-grid-dasharray: 2px !default;
78
+ $ct-grid-width: 1px !default;
79
+ $ct-grid-background-fill: none !default;
80
+
81
+ // Line chart properties
82
+ $ct-line-width: 4px !default;
83
+ $ct-line-dasharray: false !default;
84
+ $ct-point-size: 10px !default;
85
+ // Line chart point, can be either round or square
86
+ $ct-point-shape: round !default;
87
+ // Area fill transparency between 0 and 1
88
+ $ct-area-opacity: 0.1 !default;
89
+
90
+ // Bar chart bar width
91
+ $ct-bar-width: 10px !default;
92
+
93
+ // Donut width (If donut width is to big it can cause issues where the shape gets distorted)
94
+ $ct-donut-width: 60px !default;
95
+
96
+ // If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you
97
+ // should set this property to false
98
+ $ct-include-classes: true !default;
99
+
100
+ // If this is set to true the CSS will contain colored series. You can extend or change the color with the
101
+ // properties below
102
+ $ct-include-colored-series: $ct-include-classes !default;
103
+
104
+ // If set to true this will include all responsive container variations using the scales defined at the top of the script
105
+ $ct-include-alternative-responsive-containers: $ct-include-classes !default;
106
+
107
+ // Series names and colors. This can be extended or customized as desired. The names match the series classes
108
+ // Chartist sets (`ct-series-a` to `ct-series-z`). With fewer colors than names, the colors repeat in order, and a
109
+ // series whose color repeats falls back to the custom property of the series it repeats (`--ct-series-p` to
110
+ // `--ct-series-a`).
111
+ $ct-series-names: (
112
+ a,
113
+ b,
114
+ c,
115
+ d,
116
+ e,
117
+ f,
118
+ g,
119
+ h,
120
+ i,
121
+ j,
122
+ k,
123
+ l,
124
+ m,
125
+ n,
126
+ o,
127
+ p,
128
+ q,
129
+ r,
130
+ s,
131
+ t,
132
+ u,
133
+ v,
134
+ w,
135
+ x,
136
+ y,
137
+ z
138
+ ) !default;
139
+ $ct-series-colors: (
140
+ #d70206,
141
+ #f05b4f,
142
+ #f4c63d,
143
+ #d17905,
144
+ #453d3f,
145
+ #59922b,
146
+ #0544d3,
147
+ #6b0392,
148
+ #e6805e,
149
+ #dda458,
150
+ #eacf7d,
151
+ #86797d,
152
+ #b2c326,
153
+ #6188e2,
154
+ #a748ca
155
+ ) !default;
@@ -0,0 +1,262 @@
1
+ @import 'settings';
2
+
3
+ // The value of an optional setting (false: not set) as a CSS value.
4
+ @function ct-or-none($value) {
5
+ @if $value {
6
+ @return $value;
7
+ }
8
+ @return none;
9
+ }
10
+
11
+ @mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {
12
+ display: block;
13
+ position: relative;
14
+ width: $width;
15
+
16
+ &:before {
17
+ display: block;
18
+ float: left;
19
+ content: '';
20
+ width: 0;
21
+ height: 0;
22
+ padding-bottom: $ratio * 100%;
23
+ }
24
+
25
+ &:after {
26
+ content: '';
27
+ display: table;
28
+ clear: both;
29
+ }
30
+
31
+ > svg {
32
+ display: block;
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ }
37
+ }
38
+
39
+ @mixin ct-align-justify(
40
+ $ct-text-align: $ct-text-align,
41
+ $ct-text-justify: $ct-text-justify
42
+ ) {
43
+ align-items: $ct-text-align;
44
+ justify-content: $ct-text-justify;
45
+ // Fallback to text-align for non-flex browsers
46
+ @if ($ct-text-justify == 'flex-start') {
47
+ text-align: left;
48
+ } @else if ($ct-text-justify == 'flex-end') {
49
+ text-align: right;
50
+ } @else {
51
+ text-align: center;
52
+ }
53
+ }
54
+
55
+ @mixin ct-chart-label(
56
+ $ct-text-color: $ct-text-color,
57
+ $ct-text-size: $ct-text-size,
58
+ $ct-text-line-height: $ct-text-line-height
59
+ ) {
60
+ fill: var(--ct-label-color, #{$ct-text-color});
61
+ color: var(--ct-label-color, #{$ct-text-color});
62
+ font-size: var(--ct-label-size, #{$ct-text-size});
63
+ line-height: $ct-text-line-height;
64
+ }
65
+
66
+ @mixin ct-chart-grid(
67
+ $ct-grid-color: $ct-grid-color,
68
+ $ct-grid-width: $ct-grid-width,
69
+ $ct-grid-dasharray: $ct-grid-dasharray
70
+ ) {
71
+ stroke: var(--ct-grid-color, #{$ct-grid-color});
72
+ stroke-width: var(--ct-grid-width, #{$ct-grid-width});
73
+ // Always emitted, so the property works; `none` is the initial value.
74
+ stroke-dasharray: var(--ct-grid-dasharray, #{ct-or-none($ct-grid-dasharray)});
75
+ }
76
+
77
+ @mixin ct-chart-point(
78
+ $ct-point-size: $ct-point-size,
79
+ $ct-point-shape: $ct-point-shape
80
+ ) {
81
+ stroke-width: var(--ct-point-size, #{$ct-point-size});
82
+ stroke-linecap: var(--ct-point-shape, #{$ct-point-shape});
83
+ }
84
+
85
+ @mixin ct-chart-line(
86
+ $ct-line-width: $ct-line-width,
87
+ $ct-line-dasharray: $ct-line-dasharray
88
+ ) {
89
+ fill: none;
90
+ stroke-width: var(--ct-line-width, #{$ct-line-width});
91
+ stroke-dasharray: var(--ct-line-dasharray, #{ct-or-none($ct-line-dasharray)});
92
+ }
93
+
94
+ @mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {
95
+ stroke: none;
96
+ fill-opacity: var(--ct-area-opacity, #{$ct-area-opacity});
97
+ }
98
+
99
+ @mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {
100
+ fill: none;
101
+ stroke-width: var(--ct-bar-width, #{$ct-bar-width});
102
+ }
103
+
104
+ @mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {
105
+ fill: none;
106
+ stroke-width: var(--ct-donut-width, #{$ct-donut-width});
107
+ }
108
+
109
+ // Sets the series color as `--ct-color`, which the series' elements use.
110
+ @mixin ct-chart-series-color($color) {
111
+ --ct-color: #{$color};
112
+
113
+ .#{$ct-class-point},
114
+ .#{$ct-class-line},
115
+ .#{$ct-class-bar},
116
+ .#{$ct-class-slice-donut} {
117
+ stroke: var(--ct-color);
118
+ }
119
+
120
+ .#{$ct-class-slice-pie},
121
+ .#{$ct-class-area} {
122
+ fill: var(--ct-color);
123
+ }
124
+ }
125
+
126
+ @mixin ct-chart(
127
+ $ct-container-ratio: $ct-container-ratio,
128
+ $ct-text-color: $ct-text-color,
129
+ $ct-text-size: $ct-text-size,
130
+ $ct-grid-color: $ct-grid-color,
131
+ $ct-grid-width: $ct-grid-width,
132
+ $ct-grid-dasharray: $ct-grid-dasharray,
133
+ $ct-point-size: $ct-point-size,
134
+ $ct-point-shape: $ct-point-shape,
135
+ $ct-line-width: $ct-line-width,
136
+ $ct-bar-width: $ct-bar-width,
137
+ $ct-donut-width: $ct-donut-width,
138
+ $ct-series-names: $ct-series-names,
139
+ $ct-series-colors: $ct-series-colors
140
+ ) {
141
+ .#{$ct-class-label} {
142
+ @include ct-chart-label($ct-text-color, $ct-text-size);
143
+ }
144
+
145
+ .#{$ct-class-chart-line} .#{$ct-class-label},
146
+ .#{$ct-class-chart-bar} .#{$ct-class-label},
147
+ // HTML labels of composed charts, whose svg has no chart-type class.
148
+ foreignObject > .#{$ct-class-label} {
149
+ display: flex;
150
+ }
151
+
152
+ .#{$ct-class-chart-pie} .#{$ct-class-label},
153
+ .#{$ct-class-chart-donut} .#{$ct-class-label} {
154
+ dominant-baseline: central;
155
+ }
156
+
157
+ .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
158
+ @include ct-align-justify(flex-end, flex-start);
159
+ }
160
+
161
+ .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
162
+ @include ct-align-justify(flex-start, flex-start);
163
+ }
164
+
165
+ .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-start} {
166
+ @include ct-align-justify(flex-end, flex-end);
167
+ }
168
+
169
+ .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-end} {
170
+ @include ct-align-justify(flex-end, flex-start);
171
+ }
172
+
173
+ .#{$ct-class-chart-bar}
174
+ .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
175
+ @include ct-align-justify(flex-end, center);
176
+ }
177
+
178
+ .#{$ct-class-chart-bar}
179
+ .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
180
+ @include ct-align-justify(flex-start, center);
181
+ }
182
+
183
+ .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars}
184
+ .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
185
+ @include ct-align-justify(flex-end, flex-start);
186
+ }
187
+
188
+ .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars}
189
+ .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
190
+ @include ct-align-justify(flex-start, flex-start);
191
+ }
192
+
193
+ .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars}
194
+ .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-start} {
195
+ @include ct-align-justify(center, flex-end);
196
+ }
197
+
198
+ .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars}
199
+ .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-end} {
200
+ @include ct-align-justify(center, flex-start);
201
+ }
202
+
203
+ .#{$ct-class-grid} {
204
+ @include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);
205
+ }
206
+
207
+ .#{$ct-class-grid-background} {
208
+ fill: var(--ct-grid-background-fill, #{$ct-grid-background-fill});
209
+ }
210
+
211
+ .#{$ct-class-point} {
212
+ @include ct-chart-point($ct-point-size, $ct-point-shape);
213
+ }
214
+
215
+ .#{$ct-class-line} {
216
+ @include ct-chart-line($ct-line-width);
217
+ }
218
+
219
+ .#{$ct-class-area} {
220
+ @include ct-chart-area();
221
+ }
222
+
223
+ .#{$ct-class-bar} {
224
+ @include ct-chart-bar($ct-bar-width);
225
+ }
226
+
227
+ .#{$ct-class-slice-donut} {
228
+ @include ct-chart-donut($ct-donut-width);
229
+ }
230
+
231
+ @if $ct-include-colored-series {
232
+ $colors: length($ct-series-colors);
233
+
234
+ @for $i from 0 to length($ct-series-names) {
235
+ $name: nth($ct-series-names, $i + 1);
236
+ // The colors repeat when there are more names than colors.
237
+ $index: $i % $colors + 1;
238
+ $color: nth($ct-series-colors, $index);
239
+
240
+ // A repeated color follows the property of the series it repeats.
241
+ @if $i >= $colors {
242
+ $color: var(--ct-series-#{nth($ct-series-names, $index)}, #{$color});
243
+ }
244
+
245
+ .#{$ct-class-series}-#{$name} {
246
+ @include ct-chart-series-color(var(--ct-series-#{$name}, #{$color}));
247
+ }
248
+ }
249
+ }
250
+ }
251
+
252
+ @if $ct-include-classes {
253
+ @include ct-chart();
254
+
255
+ @if $ct-include-alternative-responsive-containers {
256
+ @for $i from 0 to length($ct-scales-names) {
257
+ .#{nth($ct-scales-names, $i + 1)} {
258
+ @include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));
259
+ }
260
+ }
261
+ }
262
+ }
@@ -0,0 +1,53 @@
1
+ @use 'sass:list';
2
+
3
+ // Opt-in color-blind-safe palette (CVD-validated, from the v2 brand design).
4
+ // Light and dark values follow the element's `color-scheme` through
5
+ // light-dark(), so the theme works with any dark-mode setup that declares
6
+ // `color-scheme: dark`.
7
+ //
8
+ // Usage: import 'chartist/themes/accessible.css' and add the class
9
+ // `ct-theme-accessible` to the page or to a chart's container.
10
+
11
+ $ct-accessible-colors: (
12
+ a: (
13
+ #d7263d,
14
+ #e5484d
15
+ ),
16
+ b: (
17
+ #2b6cd8,
18
+ #5b8def
19
+ ),
20
+ c: (
21
+ #b07800,
22
+ #b98a12
23
+ ),
24
+ d: (
25
+ #8445b0,
26
+ #9a63d0
27
+ ),
28
+ e: (
29
+ #00917f,
30
+ #1fa192
31
+ ),
32
+ f: (
33
+ #d2621c,
34
+ #d9702f
35
+ ),
36
+ g: (
37
+ #b8479f,
38
+ #cb5ab0
39
+ ),
40
+ h: (
41
+ #6e8b1f,
42
+ #7d9a2e
43
+ )
44
+ ) !default;
45
+
46
+ .ct-theme-accessible {
47
+ @each $name, $pair in $ct-accessible-colors {
48
+ --ct-series-#{$name}: light-dark(
49
+ #{list.nth($pair, 1)},
50
+ #{list.nth($pair, 2)}
51
+ );
52
+ }
53
+ }
@@ -0,0 +1,34 @@
1
+ .ct-theme-accessible {
2
+ --ct-series-a: light-dark(
3
+ #d7263d,
4
+ #e5484d
5
+ );
6
+ --ct-series-b: light-dark(
7
+ #2b6cd8,
8
+ #5b8def
9
+ );
10
+ --ct-series-c: light-dark(
11
+ #b07800,
12
+ #b98a12
13
+ );
14
+ --ct-series-d: light-dark(
15
+ #8445b0,
16
+ #9a63d0
17
+ );
18
+ --ct-series-e: light-dark(
19
+ #00917f,
20
+ #1fa192
21
+ );
22
+ --ct-series-f: light-dark(
23
+ #d2621c,
24
+ #d9702f
25
+ );
26
+ --ct-series-g: light-dark(
27
+ #b8479f,
28
+ #cb5ab0
29
+ );
30
+ --ct-series-h: light-dark(
31
+ #6e8b1f,
32
+ #7d9a2e
33
+ );
34
+ }
@@ -0,0 +1 @@
1
+ .ct-theme-accessible{--ct-series-a:light-dark(#d7263d,#e5484d);--ct-series-b:light-dark(#2b6cd8,#5b8def);--ct-series-c:light-dark(#b07800,#b98a12);--ct-series-d:light-dark(#8445b0,#9a63d0);--ct-series-e:light-dark(#00917f,#1fa192);--ct-series-f:light-dark(#d2621c,#d9702f);--ct-series-g:light-dark(#b8479f,#cb5ab0);--ct-series-h:light-dark(#6e8b1f,#7d9a2e)}