Skip to content

Commit bb780a0

Browse files
docs: replace Lumo utility in remaining examples (#4831)
* docs: replace Lumo utility in remaining examples * refactor: apply code review suggestions --------- Co-authored-by: Sascha Ißbrücker <[email protected]>
1 parent 269c5e3 commit bb780a0

31 files changed

+85
-67
lines changed

articles/components/context-menu/index.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,12 @@ ifdef::react[]
221221
include::{root}/frontend/demo/component/contextmenu/react/context-menu-classname.tsx[render,tags=snippet,indent=0,group=React]
222222
----
223223
endif::[]
224-
--
225224

226-
.Theme Names, Not Class Names
227-
[NOTE]
228-
In versions prior to 24.3, theme names must be used instead (i.e., `theme` property / `addThemeNames` Java method). The CSS syntax for targeting a theme name is `[theme~="custom-theme"]`
225+
[source,css]
226+
----
227+
include::{root}/frontend/themes/docs/context-menu-class-name.css[]
228+
----
229+
--
229230

230231

231232
== Disabled Menu Items

articles/components/dashboard/index.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@ include::{root}/frontend/demo/component/dashboard/dashboard-announcements.ts[ren
428428
include::{root}/src/main/java/com/vaadin/demo/component/dashboard/WidgetConfig.java[tags=snippet,indent=0,group=Lit]
429429
----
430430
endif::[]
431+
432+
[source,css]
433+
----
434+
include::{root}/frontend/themes/docs/screen-reader-only.css[]
435+
----
431436
--
432437

433438

articles/components/menu-bar/index.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ ifdef::react[]
152152
include::{root}/frontend/demo/component/menubar/react/menu-bar-custom-styling.tsx[render,tags=snippet,indent=0,group=React]
153153
----
154154
endif::[]
155-
--
156155

157-
.Use Theme Names, Not Class Names pre-V24.3
158-
[NOTE]
159-
In versions prior to 24.3, theme names must be used instead of class names (`theme` property / `addThemeNames` Java method). The CSS syntax for targeting a theme name is `[theme~="custom-theme"]`
156+
[source,css]
157+
----
158+
include::{root}/frontend/themes/docs/menu-bar-class-name.css[]
159+
----
160+
--
160161

161162

162163
[role="since:com.vaadin:[email protected]"]

articles/components/message-list/index.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ include::{root}/frontend/demo/component/messages/react/message-list-ai-chat.tsx[
157157
include::{root}/src/main/java/com/vaadin/demo/component/messages/LLMChatService.java[tags=snippet,indent=0,group=React]
158158
----
159159
endif::[]
160+
161+
[source,css]
162+
----
163+
include::{root}/frontend/themes/docs/screen-reader-only.css[]
164+
----
160165
--
161166

162167
== Related Components

frontend/demo/component/auto-form/react/auto-form-custom-renderer-alt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ function GroupingLayoutRenderer({ children }: AutoFormLayoutRendererProps<Employ
1414
return (
1515
<VerticalLayout>
1616
<h4>Personal Information:</h4>
17-
<HorizontalLayout theme="spacing" className="pb-l">
17+
<HorizontalLayout theme="spacing" style={{ paddingBottom: '1.5rem' }}>
1818
{fieldsMapping.get('firstName')}
1919
{fieldsMapping.get('lastName')}
2020
{fieldsMapping.get('gender')}
2121
</HorizontalLayout>
2222
<h4>Employment Information:</h4>
23-
<HorizontalLayout theme="spacing" className="pb-l items-baseline">
23+
<HorizontalLayout theme="spacing" style={{ paddingBottom: '1.5rem', alignItems: 'baseline' }}>
2424
{fieldsMapping.get('startDate')}
2525
{fieldsMapping.get('shiftStartsAt')}
2626
{fieldsMapping.get('active')}

frontend/demo/component/auto-form/react/auto-form-custom-renderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function GroupingLayoutRenderer({ form }: AutoFormLayoutRendererProps<EmployeeMo
2020
return (
2121
<VerticalLayout>
2222
<h4>Personal Information:</h4>
23-
<HorizontalLayout theme="spacing" className="pb-l">
23+
<HorizontalLayout theme="spacing" style={{ paddingBottom: '1.5rem' }}>
2424
<TextField label="First Name" {...field(model.firstName)} />
2525
<TextField label="Last Name" {...field(model.lastName)} />
2626
<Select
@@ -35,7 +35,7 @@ function GroupingLayoutRenderer({ form }: AutoFormLayoutRendererProps<EmployeeMo
3535
/>
3636
</HorizontalLayout>
3737
<h4>Employment Information:</h4>
38-
<HorizontalLayout theme="spacing" className="pb-l items-baseline">
38+
<HorizontalLayout theme="spacing" style={{ paddingBottom: '1.5rem', alignItems: 'baseline' }}>
3939
<DatePicker label="Start Date" {...field(model.startDate)} />
4040
<TimePicker label="Shift Starts At" {...field(model.shiftStartsAt)} />
4141
<Checkbox label="Active" {...field(model.active)} />

frontend/demo/component/auto-grid/react/auto-grid-filtering.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ function Example() {
4747
});
4848

4949
return (
50-
<div className="flex flex-col items-start gap-m">
51-
<div className="flex items-baseline gap-m">
50+
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'start', gap: '1rem' }}>
51+
<div style={{ display: 'flex', alignItems: 'baseline', gap: '1rem' }}>
5252
<Select
5353
label="Filter by category"
5454
items={categories}

frontend/demo/component/contextmenu/context-menu-classname.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Example extends LitElement {
1919
private items: ContextMenuItem[] = [
2020
{ text: 'Share' },
2121
{ text: 'Duplicate' },
22-
{ text: 'Delete', className: 'text-error' },
22+
{ text: 'Delete', className: 'custom' },
2323
];
2424
// end::snippet[]
2525

frontend/demo/component/contextmenu/react/context-menu-classname.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Example() {
1111
const items = useSignal<ContextMenuItem[]>([
1212
{ text: 'Share' },
1313
{ text: 'Duplicate' },
14-
{ text: 'Delete', className: 'text-error' },
14+
{ text: 'Delete', className: 'custom' },
1515
]);
1616
// end::snippet[]
1717

frontend/demo/component/dashboard/dashboard-announcements.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ export class Example extends LitElement {
121121
<!--
122122
Live region for screen reader announcements. Changing its text content will result
123123
in a new announcement. This element is only visible for demonstration purposes. In
124-
your application you should visually hide it using CSS, for example by using the
125-
sr-only Lumo utility class:
126-
<div className="sr-only" aria-live="polite">{announcement}</div>
124+
your application you should visually hide it using CSS by applying a corresponding
125+
class name, like "screen-reader-only", as shown in the attached CSS example file:
126+
<div className="screen-reader-only" aria-live="polite">{announcement}</div>
127127
-->
128128
<div aria-live="polite">${this.announcement}</div>
129129
<vaadin-dashboard

0 commit comments

Comments
 (0)