Skip to content

Conversation

@fredpena
Copy link
Contributor

@fredpena fredpena commented Aug 18, 2025

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.

fredpena and others added 14 commits July 25, 2025 08:54
Remove 'The temporary files are automatically deleted when the upload is complete or the component is detached.'
Provided detailed documentation on what Custom Authorization Rules are, their use cases, and how they complement Vaadin's view-based access control.
Documented the purpose and effects of disabling CSRF configuration and Navigation Access Control in VaadinSecurityConfigurer. Clarified default behavior, when it is safe to disable, and the implications for application security.
@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
Co-authored-by: Jouni Koivuviita <[email protected]>
@peholmst peholmst requested a review from jouni September 15, 2025 06:18
@peholmst
Copy link
Member

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

@jouni
Copy link
Member

jouni commented Sep 23, 2025

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

@CLAassistant
Copy link

CLAassistant commented Oct 26, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@anezthes anezthes left a comment

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
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
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
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
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
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
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
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
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.
Copy link
Contributor

@anezthes anezthes Oct 28, 2025

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
Contributor

Choose a reason for hiding this comment

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

Inline code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/main cherry pick to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants