Skip to content

Commit ceacc31

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 cf4a7d0 commit ceacc31

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,197 +12,212 @@ 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::[]
1921

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

22-
[cols="1,2,2"]
33+
[cols="1,3,1"]
2334
|===
24-
| Feature | Property | Default Value
35+
| Feature | Property | Supported by
2536

2637
|Background
2738
|`--vaadin-charts-background`
28-
|`--lumo-base-color`
39+
|Aura, Lumo
40+
41+
|Surface the chart draws against
42+
|`--vaadin-charts-surface`
43+
|Aura, Lumo
44+
45+
|Font size
46+
|`--vaadin-charts-font-size`
47+
|Aura, Lumo
2948

3049
|Axis line
3150
|`--vaadin-charts-axis-line`
32-
|`--lumo-contrast-5pct`
51+
|Aura, Lumo
52+
53+
|X-axis line width
54+
|`--vaadin-charts-xaxis-line-width`
55+
|Aura, Lumo
3356

3457
|Grid line
3558
|`--vaadin-charts-grid-line`
36-
|`--lumo-contrast-20pct`
59+
|Aura, Lumo
3760

38-
|X-axis line width
39-
|`--vaadin-charts-xaxis-line-width`
40-
|`0`
61+
|Minor grid line
62+
|`--vaadin-charts-minor-grid-line`
63+
|Aura, Lumo
64+
65+
|Point border
66+
|`--vaadin-charts-point-border`
67+
|Aura, Lumo
68+
69+
|Contrast
70+
|`--vaadin-charts-contrast`
71+
|Aura, Lumo
72+
73+
|Candlestick line
74+
|`--vaadin-charts-candlestick-line`
75+
|Aura, Lumo
4176

4277
|===
4378

4479
=== Data Series Colors
4580

46-
[cols="1,2,2"]
81+
[cols="1,3,1"]
4782
|===
48-
| Feature | Property | Default Value
83+
| Feature | Property | Supported by
4984

5085
|Charts color 0
5186
|`--vaadin-charts-color-0`
52-
|`#5ac2f7`
87+
|Aura, Lumo
5388

5489
|Charts color 1
5590
|`--vaadin-charts-color-1`
56-
|`#1676f3`
91+
|Aura, Lumo
5792

5893
|Charts color 2
5994
|`--vaadin-charts-color-2`
60-
|`#ff7d94`
95+
|Aura, Lumo
6196

6297
|Charts color 3
6398
|`--vaadin-charts-color-3`
64-
|`#c5164e`
99+
|Aura, Lumo
65100

66101
|Charts color 4
67102
|`--vaadin-charts-color-4`
68-
|`#15c15d`
103+
|Aura, Lumo
69104

70105
|Charts color 5
71106
|`--vaadin-charts-color-5`
72-
|`#0e8151`
107+
|Aura, Lumo
73108

74109
|Charts color 6
75110
|`--vaadin-charts-color-6`
76-
|`#c18ed2`
111+
|Aura, Lumo
77112

78113
|Charts color 7
79114
|`--vaadin-charts-color-7`
80-
|`#9233b3`
115+
|Aura, Lumo
81116

82117
|Charts color 8
83118
|`--vaadin-charts-color-8`
84-
|`#fda253`
119+
|Aura, Lumo
85120

86121
|Charts color 9
87122
|`--vaadin-charts-color-9`
88-
|`#e24932`
89-
90-
|Color for positive values
91-
|`--vaadin-charts-color-positive`
92-
|`--vaadin-charts-color-4`
93-
94-
|Color for negative values
95-
|`--vaadin-charts-color-negative`
96-
|`--vaadin-charts-color-9`
123+
|Aura, Lumo
97124

98125
|===
99126

100127
=== Text Colors
101128

102-
[cols="1,2,2"]
129+
[cols="1,3,1"]
103130
|===
104-
| Feature | Property | Default Value
131+
| Feature | Property | Supported by
132+
133+
|Label
134+
|`--vaadin-charts-label`
135+
|Aura, Lumo
105136

106137
|Chart title
107138
|`--vaadin-charts-title-label`
108-
|`--lumo-header-text-color`
139+
|Aura, Lumo
109140

110141
|Axis title
111142
|`--vaadin-charts-axis-title`
112-
|`--lumo-secondary-text-color`
143+
|Aura, Lumo
113144

114145
|Axis label
115146
|`--vaadin-charts-axis-label`
116-
|`--lumo-secondary-text-color`
147+
|Aura, Lumo
117148

118149
|Data label
119150
|`--vaadin-charts-data-label`
120-
|`--lumo-body-text-color`
151+
|Aura, Lumo
121152

122153
|Secondary label
123154
|`--vaadin-charts-secondary-label`
124-
|`--lumo-secondary-text-color`
155+
|Aura, Lumo
125156

126157
|Disabled label
127158
|`--vaadin-charts-disabled-label`
128-
|`--lumo-disabled-text-color`
129-
130-
|===
131-
132-
=== Other Chart Colors
133-
134-
[cols="1,2,2"]
135-
|===
136-
| Feature | Property | Default Value
137-
138-
|Contrast
139-
|`--vaadin-charts-contrast`
140-
|`--lumo-contrast`
141-
142-
|Contrast 5%
143-
|`--vaadin-charts-contrast-5pct`
144-
|`--lumo-contrast-5pct`
145-
146-
|Contrast 10%
147-
|`--vaadin-charts-contrast-10pct`
148-
|`--lumo-contrast-10pct`
149-
150-
|Contrast 20%
151-
|`--vaadin-charts-contrast-20pct`
152-
|`--lumo-contrast-20pct`
153-
154-
|Contrast 60%
155-
|`--vaadin-charts-contrast-60pct`
156-
|`--lumo-contrast-60pct`
159+
|Aura, Lumo
157160

158161
|===
159162

160163
=== Button
161-
Style properties for range selector buttons.
164+
Style properties for range selector buttons and inputs.
162165

163-
[cols="1,2,2"]
166+
[cols="1,3,1"]
164167
|===
165-
| Feature | Property | Default Value
168+
| Feature | Property | Supported by
166169

167170
|Button label
168171
|`--vaadin-charts-button-label`
169-
|`--lumo-primary-text-color`
172+
|Aura, Lumo
170173

171174
|Button background
172175
|`--vaadin-charts-button-background`
173-
|`--lumo-contrast-5pct`
176+
|Aura, Lumo
174177

175178
|Button hover background
176179
|`--vaadin-charts-button-hover-background`
177-
|`--lumo-primary-color-10pct`
180+
|Aura, Lumo
178181

179182
|Button active label
180183
|`--vaadin-charts-button-active-label`
181-
|`--lumo-primary-contrast-color`
184+
|Aura, Lumo
182185

183186
|Button active background
184187
|`--vaadin-charts-button-active-background`
185-
|`--lumo-primary-color`
188+
|Aura, Lumo
189+
190+
|Button disabled label
191+
|`--vaadin-charts-button-disabled-label`
192+
|Aura, Lumo
193+
194+
|Button border radius
195+
|`--vaadin-charts-button-border-radius`
196+
|Aura, Lumo
197+
198+
|Range input background
199+
|`--vaadin-charts-range-input-background`
200+
|Aura, Lumo
201+
202+
|Range input hover background
203+
|`--vaadin-charts-range-input-background-hover`
204+
|Aura, Lumo
186205

187206
|===
188207

189208
=== Tooltips
190209
Tooltips within a chart.
191210

192-
[cols="1,2,2"]
211+
[cols="1,3,1"]
193212
|===
194-
| Feature | Property | Default Value
213+
| Feature | Property | Supported by
195214

196215
|Tooltip background
197216
|`--vaadin-charts-tooltip-background`
198-
|`--lumo-base-color`
199-
200-
|Tooltip border
201-
|`--vaadin-charts-tooltip-border-color`
202-
|`inherit`
217+
|Aura, Lumo
203218

204-
|Tooltip background opacity
205-
|`--vaadin-charts-tooltip-background-opacity`
206-
|`1`
219+
|Tooltip shadow
220+
|`--vaadin-charts-tooltip-shadow`
221+
|Aura, Lumo
207222

208223
|===

0 commit comments

Comments
 (0)