Skip to content

Commit dc46af9

Browse files
authored
docs: move custom-field style variants to styling page (#4859)
1 parent 5ce051f commit dc46af9

File tree

2 files changed

+61
-40
lines changed

2 files changed

+61
-40
lines changed

articles/components/custom-field/index.adoc

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -250,44 +250,4 @@ endif::[]
250250
--
251251

252252

253-
== Size Variants
254-
255-
The small theme variant can be used to make Custom Field's label, helper, and error message smaller. Custom Field doesn't propagate its theme variant to its internal components. Each internal component's theme variant must be set individually.
256-
257-
[.example]
258-
--
259-
260-
ifdef::lit[]
261-
[source,html]
262-
----
263-
include::{root}/frontend/demo/component/custom-field/custom-field-size-variants.ts[render,tags=snippet,indent=0,group=Lit]
264-
----
265-
endif::[]
266-
267-
ifdef::flow[]
268-
[source,java]
269-
----
270-
include::{root}/src/main/java/com/vaadin/demo/component/customfield/MoneyField.java[tags=snippet,indent=0,group=Flow]
271-
----
272-
273-
[source,java]
274-
----
275-
include::{root}/src/main/java/com/vaadin/demo/component/customfield/CustomFieldSizeVariants.java[render,tags=snippet,indent=0,group=Flow]
276-
----
277-
278-
[source,java]
279-
----
280-
include::{root}/src/main/java/com/vaadin/demo/component/customfield/Money.java[tags=snippet,indent=0,group=Flow]
281-
----
282-
endif::[]
283-
284-
ifdef::react[]
285-
[source,tsx]
286-
----
287-
include::{root}/frontend/demo/component/custom-field/react/custom-field-size-variants.tsx[render,tags=snippet,indent=0,group=React]
288-
----
289-
endif::[]
290-
--
291-
292-
293253
[discussion-id]`CB7FDF39-7653-4DF0-A0C0-9C2A2EE7EDBA`

articles/components/custom-field/styling.adoc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,67 @@ order: 50
77
---
88
= Custom Field Styling
99

10+
11+
== Style Variants
12+
13+
The following variants are supported:
14+
15+
[cols="1,2,1"]
16+
|===
17+
| Variant | Description | Supported by
18+
19+
|`small`
20+
|Used to make label, helper, and error message smaller
21+
|Lumo
22+
23+
|`helper-above-field`
24+
|Used to position the helper above the field, and below the label
25+
|Aura, Lumo
26+
27+
|`whitespace`
28+
|Adds padding below the label for wrapping components without outer margin
29+
|Lumo
30+
31+
|===
32+
33+
[.example]
34+
--
35+
36+
ifdef::lit[]
37+
[source,html]
38+
----
39+
include::{root}/frontend/demo/component/custom-field/custom-field-size-variants.ts[render,tags=snippet,indent=0,group=Lit]
40+
----
41+
endif::[]
42+
43+
ifdef::flow[]
44+
[source,java]
45+
----
46+
include::{root}/src/main/java/com/vaadin/demo/component/customfield/MoneyField.java[tags=snippet,indent=0,group=Flow]
47+
----
48+
49+
[source,java]
50+
----
51+
include::{root}/src/main/java/com/vaadin/demo/component/customfield/CustomFieldSizeVariants.java[render,tags=snippet,indent=0,group=Flow]
52+
----
53+
54+
[source,java]
55+
----
56+
include::{root}/src/main/java/com/vaadin/demo/component/customfield/Money.java[tags=snippet,indent=0,group=Flow]
57+
----
58+
endif::[]
59+
60+
ifdef::react[]
61+
[source,tsx]
62+
----
63+
include::{root}/frontend/demo/component/custom-field/react/custom-field-size-variants.tsx[render,tags=snippet,indent=0,group=React]
64+
----
65+
endif::[]
66+
--
67+
68+
[NOTE]
69+
Custom Field doesn't propagate its style variant to the individual field components it wraps. Each individual component's style variant must be set individually.
70+
1071
include::../_styling-section-intros.adoc[tag=selectors]
1172

1273

0 commit comments

Comments
 (0)