Skip to content

docs(lumo): add "Responsive Breakpoints" guide for Vaadin Lumo utilities#4508

Merged
Artur- merged 6 commits into
vaadin:mainfrom
fredpena:docs/lumo-responsive-breakpoints
Jun 13, 2026
Merged

docs(lumo): add "Responsive Breakpoints" guide for Vaadin Lumo utilities#4508
Artur- merged 6 commits into
vaadin:mainfrom
fredpena:docs/lumo-responsive-breakpoints

Conversation

@fredpena

@fredpena fredpena commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds a new documentation page “Lumo Utility Classes: Responsive Breakpoints” covering how to use breakpoint prefixes (sm:, md:, lg:, xl:, 2xl:) with the LumoUtility.*.Breakpoint Java API in Vaadin Flow. The page includes:

  • A table of default breakpoints (min-widths and CSS equivalents)
  • Supported responsive utility groups: Align Items, Display, Flex Direction, Font Size, Grid, Position
  • Code samples (Java) for each group
  • Guidance on limitations (e.g., spacing/gap/justify-content currently require custom CSS)
  • A short Conclusion with best practices (mobile-first, testing, custom CSS for non-supported utilities)

Motivation / Context

Developers frequently ask how to apply responsive styles directly from Java without writing media queries. This page centralizes the available breakpoint-enabled utilities, clarifies what’s currently supported, and shows idiomatic examples.

Scope of Changes

  • Adds a new .adoc page:
    docs/<appropriate-path>/lumo-responsive-breakpoints.adoc
    (Please advise if a different folder or navigation entry is preferred.)
  • References the main utility classes page: <<utility-classes.adoc#, Lumo Utility Classes>>.

Visuals / Assets

  • Adds illustrative images under articles/styling/_images/:

Alt text is included in the image::...[] directives for accessibility.
If the repo has an image naming or compression guideline, I can adjust.

How to Review

  1. Content accuracy: Confirm API names and enum constants for LumoUtility.* and their .Breakpoint variants.
  2. Scope and tone: Verify the technical tone and that claims (supported groups/limitations) match the current API.
  3. Navigation: Confirm location in the docs tree and side nav ordering (order: 0 can be changed if needed).
  4. Cross-links: Validate the cross-reference utility-classes.adoc (path and anchor).
  5. Images: Confirm paths and filenames match repo conventions.

@peholmst peholmst added the target/main cherry pick to main branch label Aug 20, 2025
@peholmst peholmst requested a review from anezthes August 26, 2025 10:13
Comment thread articles/styling/lumo/lumo-breakpoint.adoc Outdated
@peholmst peholmst requested a review from jouni September 15, 2025 06:18
@peholmst

Copy link
Copy Markdown
Member

@jouni Can you have a second look at this PR so we can get it merged?

@jouni

jouni commented Sep 23, 2025

Copy link
Copy Markdown
Member

I’m not very familiar with the Lumo utility classes, so I’d like if @anezthes would review this.

@CLAassistant

CLAassistant commented Oct 26, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@anezthes anezthes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, great job!

Just a few minor notes:
– The image captions could use some polish; they don’t read very smoothly.
– Some of the key points seem AI-generated and could use simplification and/or examples to better get their point across (remember the target audience).

= Lumo Utility Classes: Responsive Breakpoints

Lumo includes a powerful set of responsive utility classes that allow you to apply specific styles based on the screen (viewport) size.
These classes use breakpoint CSS class name prefixes (`sm:`, `md:`, `lg:`, `xl:`, `2xl:`) to apply styles only when the screen width meets a certain minimum threshold.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(sm:, md:, lg:, xl: and 2xl:)

Lumo includes a powerful set of responsive utility classes that allow you to apply specific styles based on the screen (viewport) size.
These classes use breakpoint CSS class name prefixes (`sm:`, `md:`, `lg:`, `xl:`, `2xl:`) to apply styles only when the screen width meets a certain minimum threshold.

You can apply these classes to any Vaadin Flow component using the `addClassNames()` method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vaadin Flow

|===
|Breakpoint |CSS class name prefixes |Minimum width |Equivalent screens |Equivalent in CSS

|Breakpoint.Small

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breakpoint.Small

|Breakpoint |CSS class name prefixes |Minimum width |Equivalent screens |Equivalent in CSS

|Breakpoint.Small
|sm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sm

|sm
|640px
|Mobile devices
|@media (min-width: 640px) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@media (min-width: 640px) {}

----
--

.Example of Position Responsive `Viewport >= Breakpoint.Large`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure I understand the demo example. The "updates available" is visible on smaller viewports but not desktop?


==== Key Points

1. *Position Type Changes:* Elements can change from `RELATIVE` on mobile to `ABSOLUTE` or `FIXED` on desktop, enabling different interaction patterns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an real-world example would be good to highlight/mention here to get the point across.

==== Key Points

1. *Position Type Changes:* Elements can change from `RELATIVE` on mobile to `ABSOLUTE` or `FIXED` on desktop, enabling different interaction patterns.
2. *Layout Strategy:* Mobile-first approach often uses normal document flow (`RELATIVE`, `STATIC`) and adds positioned overlays on larger screens.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example? A bit too abstract.

3. *Z-Index Management:* When using positioned elements, consider z-index stacking context for proper layering.
4. *Performance:* Positioned elements, especially `FIXED`, can impact scroll performance on mobile devices.
5. *Accessibility:* Ensure positioned elements don't obstruct important content and remain accessible via keyboard navigation.
6. *Responsive Context:* Position changes work best when the parent container's positioning context is considered across breakpoints.

@anezthes anezthes Oct 28, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand 6.

== Conclusion

Lumo’s responsive breakpoint utilities offer a structured and consistent way to adapt layouts and styles across different device sizes directly from Java code.
By leveraging the six supported groups — *Align Items, Display, Flex Direction, Font Size, Grid,* and *Position* — developers can create responsive, mobile-first designs without writing custom media queries.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline code

@jouni jouni removed their request for review March 23, 2026 13:04
fredpena and others added 2 commits June 12, 2026 20:29
…sponsive breakpoints guide

- Correct LumoUtility.Breakpoint reference to the nested Breakpoint classes
- Fix mobile-first key points: unprefixed classes apply to all sizes,
  breakpoint variants apply from their minimum width upward
- Fix heading levels (=== / ==== under document intro)
- Add missing VaadinIcon and Div imports in code examples
- Fix copy-pasted comments in FontSize, Grid, and Position examples
- Fix invalid AsciiDoc cols spec and column header in font size table
- Remove 'Rows' from Grid example naming (example only uses columns)
- Use present tense, proper ordered list syntax, and spelled-out numbers
- Front matter: add Vaadin to page-title, trim meta-description to
  150-160 chars, set order to 40 to follow Utility Classes (order 30)
@Artur- Artur- force-pushed the docs/lumo-responsive-breakpoints branch from f6a5233 to 74b5487 Compare June 12, 2026 17:31
@Artur- Artur- changed the base branch from v24 to main June 12, 2026 17:31
@Artur- Artur- removed the target/main cherry pick to main branch label Jun 13, 2026
Artur- added 4 commits June 13, 2026 19:52
- Use inline code for breakpoints, prefixes, and media queries in tables
- Convert available-classes bullet lists to tables for all six groups
- Rewrite image captions to read more naturally
- Simplify key points and remove AI-sounding phrasing
- Add gap/flex so icon and text sit together in message and notification
  examples
- 'Vaadin Flow' -> 'Flow' and minor wording fixes
- Use inline code for breakpoints, prefixes, and media queries in the
  breakpoints table
- Convert each "available classes" list to a table, matching the Font
  Size section (per review)
- Reword image captions to read more naturally
- Add gap between icons and text in the Display and Position examples
- Tighten Key Points sections, drop AI-flavored filler, and replace
  abstract points with concrete examples (tab bar, dashboard cards,
  back-to-top button)
- Clarify the Position demo behavior and fix the unclear positioning-
  context point
- 'Vaadin Flow component' -> 'Flow component'; inline code in conclusion
- Make AlignItems Key Points concrete (mobile-first, cascading, combining)
- Drop generic 'Testing' points and puffy 'breakpoint system' summary
  sentences from all sections to match the terse house style
- Use inline code for the six group names in the Conclusion
@Artur- Artur- enabled auto-merge (squash) June 13, 2026 17:33

@Artur- Artur- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed some AI and some manual cleanup. Hope I did not change anything in a fundamentally wrong way.

@Artur- Artur- merged commit ee9524f into vaadin:main Jun 13, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants