Skip to content

Commit e6e3f1b

Browse files
DiegoCardosoclaude
andcommitted
docs: correct and reformat the chart style property tables
The tables listed eight properties no rule reads any more, omitted eleven that exist, and gave --lumo-* variables as default values in a release whose default theme is Aura. They were also the last tables under articles/components/ still using the Default Value column that every other styling page dropped for Supported by. Switch to the standard format, which removes the stale defaults along with the need to maintain any of them, and correct the membership. The per-theme differences move into prose above the tables, where they don't have to be repeated per row. Keep the vaadin-chart {...} selector and say why it isn't html {...}: Lumo declares most of these properties on the chart element, so a value inherited from html never applies. Verified in the browser against Aura, Lumo and no theme, along with every property listed and every one removed. Part of vaadin/web-components#12700. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3af0b4b commit e6e3f1b

1 file changed

Lines changed: 98 additions & 83 deletions

File tree

articles/components/charts/styling/styling.adoc

Lines changed: 98 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ order: 50
1212
== Style Properties
1313
The following style properties can be used in CSS stylesheets to customize the appearance of this component.
1414

15-
To apply values to these properties globally in your application UI, place them in a CSS block using the `vaadin-chart {...}` selector.
15+
Apply them in a CSS block using the `vaadin-chart {...}` selector, or a CSS class name on the chart.
16+
Unlike other components, they can't be applied from an `html {...}` block.
17+
The Lumo theme sets most of them on the chart element, and an inherited value doesn't override that.
1618
ifdef::flow,lit[]
1719
See <<{articles}/styling/styling-components#component-style-properties,Component Style Properties>> for more information on style properties.
1820
endif::[]
@@ -23,192 +25,205 @@ In Flow, these properties have no effect until styled mode is enabled with `conf
2325
See <<{articles}/components/charts/styling/#css.styling.mode,CSS Styling Mode for Flow>>.
2426
In Lit and React, styled mode is enabled by default.
2527

28+
The chart's own styles read these properties, so they work with the Aura theme, with Lumo, and with neither.
29+
The themes differ in what they set by default.
30+
Aura makes the plot background transparent and restyles the range selector buttons.
31+
Lumo gives most of the properties a `--lumo-*` value, and is the only theme with chart
32+
<<{articles}/components/charts/styling/#theme-variants,variants>>.
33+
34+
// Theme defaults live in aura/src/components/charts.css and
35+
// vaadin-lumo-styles/src/components/chart.css in the web-components repository.
36+
2637
=== Common Properties
2738

28-
[cols="1,2,2"]
39+
[cols="1,3,1"]
2940
|===
30-
| Feature | Property | Default Value
41+
| Feature | Property | Supported by
3142

3243
|Background
3344
|`--vaadin-charts-background`
34-
|`--lumo-base-color`
45+
|Aura, Lumo
46+
47+
|Surface the chart draws against
48+
|`--vaadin-charts-surface`
49+
|Aura, Lumo
50+
51+
|Font size
52+
|`--vaadin-charts-font-size`
53+
|Aura, Lumo
3554

3655
|Axis line
3756
|`--vaadin-charts-axis-line`
38-
|`--lumo-contrast-5pct`
57+
|Aura, Lumo
58+
59+
|X-axis line width
60+
|`--vaadin-charts-xaxis-line-width`
61+
|Aura, Lumo
3962

4063
|Grid line
4164
|`--vaadin-charts-grid-line`
42-
|`--lumo-contrast-20pct`
65+
|Aura, Lumo
4366

44-
|X-axis line width
45-
|`--vaadin-charts-xaxis-line-width`
46-
|`0`
67+
|Minor grid line
68+
|`--vaadin-charts-minor-grid-line`
69+
|Aura, Lumo
70+
71+
|Point border
72+
|`--vaadin-charts-point-border`
73+
|Aura, Lumo
74+
75+
|Contrast
76+
|`--vaadin-charts-contrast`
77+
|Aura, Lumo
78+
79+
|Candlestick line
80+
|`--vaadin-charts-candlestick-line`
81+
|Aura, Lumo
4782

4883
|===
4984

5085
=== Data Series Colors
5186

52-
[cols="1,2,2"]
87+
[cols="1,3,1"]
5388
|===
54-
| Feature | Property | Default Value
89+
| Feature | Property | Supported by
5590

5691
|Charts color 0
5792
|`--vaadin-charts-color-0`
58-
|`#5ac2f7`
93+
|Aura, Lumo
5994

6095
|Charts color 1
6196
|`--vaadin-charts-color-1`
62-
|`#1676f3`
97+
|Aura, Lumo
6398

6499
|Charts color 2
65100
|`--vaadin-charts-color-2`
66-
|`#ff7d94`
101+
|Aura, Lumo
67102

68103
|Charts color 3
69104
|`--vaadin-charts-color-3`
70-
|`#c5164e`
105+
|Aura, Lumo
71106

72107
|Charts color 4
73108
|`--vaadin-charts-color-4`
74-
|`#15c15d`
109+
|Aura, Lumo
75110

76111
|Charts color 5
77112
|`--vaadin-charts-color-5`
78-
|`#0e8151`
113+
|Aura, Lumo
79114

80115
|Charts color 6
81116
|`--vaadin-charts-color-6`
82-
|`#c18ed2`
117+
|Aura, Lumo
83118

84119
|Charts color 7
85120
|`--vaadin-charts-color-7`
86-
|`#9233b3`
121+
|Aura, Lumo
87122

88123
|Charts color 8
89124
|`--vaadin-charts-color-8`
90-
|`#fda253`
125+
|Aura, Lumo
91126

92127
|Charts color 9
93128
|`--vaadin-charts-color-9`
94-
|`#e24932`
95-
96-
|Color for positive values
97-
|`--vaadin-charts-color-positive`
98-
|`--vaadin-charts-color-4`
99-
100-
|Color for negative values
101-
|`--vaadin-charts-color-negative`
102-
|`--vaadin-charts-color-9`
129+
|Aura, Lumo
103130

104131
|===
105132

106133
=== Text Colors
107134

108-
[cols="1,2,2"]
135+
[cols="1,3,1"]
109136
|===
110-
| Feature | Property | Default Value
137+
| Feature | Property | Supported by
138+
139+
|Label
140+
|`--vaadin-charts-label`
141+
|Aura, Lumo
111142

112143
|Chart title
113144
|`--vaadin-charts-title-label`
114-
|`--lumo-header-text-color`
145+
|Aura, Lumo
115146

116147
|Axis title
117148
|`--vaadin-charts-axis-title`
118-
|`--lumo-secondary-text-color`
149+
|Aura, Lumo
119150

120151
|Axis label
121152
|`--vaadin-charts-axis-label`
122-
|`--lumo-secondary-text-color`
153+
|Aura, Lumo
123154

124155
|Data label
125156
|`--vaadin-charts-data-label`
126-
|`--lumo-body-text-color`
157+
|Aura, Lumo
127158

128159
|Secondary label
129160
|`--vaadin-charts-secondary-label`
130-
|`--lumo-secondary-text-color`
161+
|Aura, Lumo
131162

132163
|Disabled label
133164
|`--vaadin-charts-disabled-label`
134-
|`--lumo-disabled-text-color`
135-
136-
|===
137-
138-
=== Other Chart Colors
139-
140-
[cols="1,2,2"]
141-
|===
142-
| Feature | Property | Default Value
143-
144-
|Contrast
145-
|`--vaadin-charts-contrast`
146-
|`--lumo-contrast`
147-
148-
|Contrast 5%
149-
|`--vaadin-charts-contrast-5pct`
150-
|`--lumo-contrast-5pct`
151-
152-
|Contrast 10%
153-
|`--vaadin-charts-contrast-10pct`
154-
|`--lumo-contrast-10pct`
155-
156-
|Contrast 20%
157-
|`--vaadin-charts-contrast-20pct`
158-
|`--lumo-contrast-20pct`
159-
160-
|Contrast 60%
161-
|`--vaadin-charts-contrast-60pct`
162-
|`--lumo-contrast-60pct`
165+
|Aura, Lumo
163166

164167
|===
165168

166169
=== Button
167-
Style properties for range selector buttons.
170+
Style properties for range selector buttons and inputs.
168171

169-
[cols="1,2,2"]
172+
[cols="1,3,1"]
170173
|===
171-
| Feature | Property | Default Value
174+
| Feature | Property | Supported by
172175

173176
|Button label
174177
|`--vaadin-charts-button-label`
175-
|`--lumo-primary-text-color`
178+
|Aura, Lumo
176179

177180
|Button background
178181
|`--vaadin-charts-button-background`
179-
|`--lumo-contrast-5pct`
182+
|Aura, Lumo
180183

181184
|Button hover background
182185
|`--vaadin-charts-button-hover-background`
183-
|`--lumo-primary-color-10pct`
186+
|Aura, Lumo
184187

185188
|Button active label
186189
|`--vaadin-charts-button-active-label`
187-
|`--lumo-primary-contrast-color`
190+
|Aura, Lumo
188191

189192
|Button active background
190193
|`--vaadin-charts-button-active-background`
191-
|`--lumo-primary-color`
194+
|Aura, Lumo
195+
196+
|Button disabled label
197+
|`--vaadin-charts-button-disabled-label`
198+
|Aura, Lumo
199+
200+
|Button border radius
201+
|`--vaadin-charts-button-border-radius`
202+
|Aura, Lumo
203+
204+
|Range input background
205+
|`--vaadin-charts-range-input-background`
206+
|Aura, Lumo
207+
208+
|Range input hover background
209+
|`--vaadin-charts-range-input-background-hover`
210+
|Aura, Lumo
192211

193212
|===
194213

195214
=== Tooltips
196215
Tooltips within a chart.
197216

198-
[cols="1,2,2"]
217+
[cols="1,3,1"]
199218
|===
200-
| Feature | Property | Default Value
219+
| Feature | Property | Supported by
201220

202221
|Tooltip background
203222
|`--vaadin-charts-tooltip-background`
204-
|`--lumo-base-color`
205-
206-
|Tooltip border
207-
|`--vaadin-charts-tooltip-border-color`
208-
|`inherit`
223+
|Aura, Lumo
209224

210-
|Tooltip background opacity
211-
|`--vaadin-charts-tooltip-background-opacity`
212-
|`1`
225+
|Tooltip shadow
226+
|`--vaadin-charts-tooltip-shadow`
227+
|Aura, Lumo
213228

214229
|===

0 commit comments

Comments
 (0)