Skip to content

Commit 1871244

Browse files
refactor: convert input field style variants to table (#4906)
* convert input field style variants to table * remove border style from variant examples * fix cross-reference * update text alignment variants --------- Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
1 parent 6456c77 commit 1871244

File tree

49 files changed

+55
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+55
-122
lines changed

articles/components/_input-field-common-features.adoc

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Visible labels are strongly recommended for all input fields. In cases where the
2929
====
3030
Helpers are used to provide additional information that the user may need to enter in the field, such as format requirements or explanations of the field's purpose below the field.
3131

32-
A style variant is available for rendering the helper <<#helper-above-field,above the field>>.
32+
A <<styling#style-variants,style variant>> is available for rendering the helper above the field.
3333

3434
In addition to plain text, helpers can contain components and HTML elements. However, complex and interactive content is likely to have accessibility issues.
3535
====
@@ -220,53 +220,55 @@ Note: add component-specific live examples after each of these includes.
220220
////
221221

222222

223-
// tag::styles-intro[]
223+
// tag::styles-start[]
224224
[.collapsible-list]
225225
== Style Variants
226226

227227
The following style variants can be applied:
228-
// end::styles-intro[]
229228

229+
[cols="1,3,1"]
230+
|===
231+
| Variant | Description | Supported by
232+
233+
// end::styles-start[]
230234

231235
// tag::text-alignment[]
232-
[#text-alignment]
233-
.Text Alignment
234-
[%collapsible]
235-
====
236-
Three different text alignments are supported: `left`, which is the default; `center`; and `right`.
236+
|`align-left`
237+
|Aligns the text to the left side of the field (default)
238+
|Aura, Lumo
237239

238-
Right-alignment is recommended for numerical values when presented in vertical groups. This tends to aid interpretation and comparison of values.
239-
====
240-
// end::text-alignment[]
240+
|`align-center`
241+
|Centers the text within the field
242+
|Lumo
243+
244+
|`align-right`
245+
|Aligns the text to the right side of the field. Recommended for numerical values when presented in vertical groups.
246+
|Aura, Lumo
241247

248+
|`align-start`
249+
|Aligns the text to the start side of the field, taking into account the current text direction (left for LTR, right for RTL)
250+
|Aura
251+
252+
|`align-end`
253+
|Aligns the text to the end side of the field, taking into account the current text direction (right for LTR, left for RTL)
254+
|Aura
255+
256+
// end::text-alignment[]
242257

243258
// tag::small-variant[]
244-
[#small-variant]
245-
.Small Variant
246-
[%collapsible]
247-
====
248-
The small variant can be used to make individual fields more compact. The default size of fields can be customized with <<{articles}/components/themes/lumo/lumo-style-properties#,style properties>>.
249-
====
250-
// end::small-variant[]
259+
|`small`
260+
|Renders a more compact field
261+
|Lumo
251262

263+
// end::small-variant[]
252264

253265
// tag::helper-above-field[]
254-
[#helper-above-field]
255-
.Helper Above Field
256-
[%collapsible]
257-
====
258-
The helper can be rendered above the field, and below the label.
259-
====
260-
// end::helper-above-field[]
266+
|`helper-above-field`
267+
|Renders the helper above the field, and below the label
268+
|Aura, Lumo
261269

270+
// end::helper-above-field[]
262271

263-
// tag::borders[]
264-
[#borders]
265-
.Borders
266-
[%collapsible]
267-
====
268-
Borders can be applied to the field surface by providing a value (e.g., `1px`) to the `--vaadin-input-field-border-width` CSS property. This can be applied globally to all input fields using the `html` selector, or to individual component instances. Borders are required to achieve https://www.w3.org/TR/WCAG21/#non-text-contrast[WCAG 2.1 level AA] conformant color contrast with the default Lumo styling of fields.
269-
270-
You can override the default border color with the `--vaadin-input-field-border-color` property.
271-
====
272-
// end::borders[]
272+
// tag::styles-end[]
273+
|===
274+
// end::styles-end[]

articles/components/checkbox/styling.adoc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,7 @@ order: 50
77
---
88
= Checkbox Styling
99

10-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro]
11-
12-
[cols="1,3,1"]
13-
|===
14-
| Variant | Description | Supported by
15-
16-
|`helper-above-field`
17-
|Positions the helper text above the checkbox group field
18-
|Aura, Lumo
19-
20-
|===
10+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;helper-above-field;styles-end]
2111

2212

2313
[.example]

articles/components/combo-box/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ endif::[]
479479

480480
// Style Variants
481481

482-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
482+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
483483

484484
[.example]
485485
--

articles/components/date-picker/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ endif::[]
312312

313313
// Style Variants
314314

315-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
315+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
316316

317317
[.example]
318318
--

articles/components/date-time-picker/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ endif::[]
401401

402402
// Style Variants
403403

404-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
404+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
405405

406406
[.example]
407407
--

articles/components/email-field/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ endif::[]
155155

156156
// Style Variants
157157

158-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
158+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
159159

160160
[.example]
161161
--

articles/components/number-field/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ endif::[]
276276

277277
// Style Variants
278278

279-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
279+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
280280

281281
[.example]
282282
--

articles/components/password-field/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ endif::[]
168168

169169
// Style Variants
170170

171-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
171+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
172172

173173
[.example]
174174
--

articles/components/radio-button/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ endif::[]
236236

237237
// Style Variants
238238

239-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;helper-above-field;borders]
239+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;helper-above-field;styles-end]
240240

241241
[.example]
242242
--

articles/components/select/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ endif::[]
231231

232232
// Style Variants
233233

234-
include::{articles}/components/_input-field-common-features.adoc[tags=styles-intro;text-alignment;small-variant;helper-above-field;borders]
234+
include::{articles}/components/_input-field-common-features.adoc[tags=styles-start;text-alignment;small-variant;helper-above-field;styles-end]
235235

236236
[.example]
237237
--

0 commit comments

Comments
 (0)