Utility Classes
A set of CSS utility classes that enable building any UI without custom CSS.
The classes are based on Lumo’s custom properties which ensures a consistent looking application. While the classes can be used with Vaadin’s web components they are primarily intended for creating layouts and styling text.
Caution | Work in progress
All utility classes are not yet documented.
|
Usage
To use the classes, make sure that "utility"
is added to the "lumoImports"
entry in your application theme’s configuration theme.json
.
{
"lumoImports": ["...", "utility"]
}
Alternatively, if not using a custom theme folder, you can import the utility class module manually:
Classes
All utility classes are listed below.
Accessibility
Accessibility related classes.
Preview | Class |
Screen reader only content |
|
Backgrounds
Classes for applying a background color.
Borders
Border related classes.
Preview | Class |
| |
| |
| |
| |
| |
|
Box Shadow
Classes for applying a box shadow.
Preview | Class |
| |
| |
| |
| |
|
Flexbox & Grid
Classes for flexbox and grid layouts.
Align Content
Classes for distributing space around and between items along a flexbox’s cross axis or a grid’s block axis. Applies to flexbox and grid layouts.
Preview | Class |
1234 |
|
1234 |
|
1234 |
|
1234 |
|
1234 |
|
1234 |
|
1234 |
|
Align Items
Classes for aligning items along a flexbox’s cross axis or a grid’s block axis. Applies to flexbox and grid layouts.
Preview | Class |
123 |
|
123 |
|
123 |
|
123 |
|
123 |
|
Align Self
Classes for overriding individual items align-item
property.
Applies to flexbox and grid items.
Preview | Class |
123 |
|
123 |
|
123 |
|
123 |
|
123 |
|
123 |
|
Justify Content
Classes for aligning items along a flexbox’s main axis or a grid’s inline axis. Applies to flexbox and grid layouts.
Preview | Class |
12 |
|
12 |
|
12 |
|
12 |
|
12 |
|
12 |
|
Flex
Classes for setting how items grow and shrink in a flexbox layout. Applies to flexbox items.
Preview | Class |
1999 |
|
1999 |
|
Flex Direction
Classes for setting the flex direction of a flexbox layout.
Preview | Class |
123 |
|
123 |
|
123 |
|
123 |
|
Flex Grow
Classes for setting how items grow in a flexbox layout. Applies to flexbox items.
Preview | Class |
1 |
|
1 |
|
Flex Shrink
Classes for setting how items shrink in a flexbox layout. Applies to flexbox items.
Preview | Class |
56px |
|
56px |
|
Flex Wrap
Classes for setting how items wrap in a flexbox layout. Applies to flexbox layouts.
Preview | Class |
1234 |
|
1234 |
|
1234 |
|
Gap
Classes for defining the space between items in a flexbox or grid layout. Applies to flexbox and grid layouts.
Grid Columns
Classes for setting the number of columns in a grid layout.
Preview | Class |
1234 |
|
1234 |
|
1234 |
|
1234 |
|
12345678 |
|
12345678 |
|
12345678 |
|
12345678 |
|
123456789101112 |
|
123456789101112 |
|
123456789101112 |
|
123456789101112 |
|
Grid Rows
Classes for setting the number of rows in a grid layout.
Preview | Class |
12345678 |
|
12345678 |
|
12345678 |
|
12345678 |
|
12345678 |
|
12345678 |
|
Spanning Columns
Classes for setting the column span of an item in a grid layout.
Preview | Class |
123456789101112 |
|
1234567891011121314151617181920212223 |
|
12345678910111213141516171819202122 |
|
123456789101112131415161718192021 |
|
1234567891011121314151617181920 |
|
12345678910111213141516171819 |
|
123456789101112131415161718 |
|
1234567891011121314151617 |
|
12345678910111213141516 |
|
123456789101112131415 |
|
1234567891011121314 |
|
12345678910111213 |
|
Layout
Classes for general layout purposes.
Box Sizing
Classes for setting the box sizing property of an element. Box sizing determines whether an element’s border and padding is considered a part of its size.
Preview | Class |
Size: 44px |
|
Size: 44px |
|
Display
Classes for setting the display property of an element. Determines whether the element is a block or inline element and how its items are laid out.
Preview | Class |
123 |
|
123 |
|
123 |
|
123 |
|
123 |
|
| |
123456789 |
|
123456789 |
|
Overflow
Classes for setting the overflow behaviour of an element.
Preview | Class |
123Scrolls |
|
123No scroll |
|
123Scrolls |
|
Position
Classes for setting the position of an element.
Preview | Class |
RelativeAbsolute |
|
FixedLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|
N/A |
|
Sticky 1Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Sticky 2Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|
N/A |
|
Sizing
Classes for setting height and width of an element.
Height
Preview | Class |
N/A |
|
XS |
|
S |
|
M |
|
L |
|
XL |
|
Auto |
|
Full |
|
Screen(scroll to see total height) |
|
Max Height
Preview | Class |
N/A |
|
N/A |
|
Min Height
Preview | Class |
N/A |
|
Full |
|
Screen(scroll to see total height) |
|
Width
Preview | Class |
XS |
|
S |
|
M |
|
L |
|
XL |
|
Auto |
|
Full |
|
Max Width
Preview | Class |
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
Spacing
Classes for applying margin and padding on individual elements, as well as spacing between elements in a layout.
Typography
Classes for styling text.
Font Size
Classes for setting the font size of an element.
Preview | Class |
Lorem ipsum |
|
Lorem ipsum |
|
Lorem ipsum |
|
Lorem ipsum |
|
Lorem ipsum |
|
Lorem ipsum |
|
Lorem ipsum |
|
Lorem ipsum |
|
Font Weight
Classes for setting the font weight of an element.
Preview | Class |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Line Height
Classes for setting the line height of an element.
Preview | Class |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Text Alignment
Classes for setting an element’s text alignment.
Preview | Class |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Text Color
Classes for setting the text color of an element.
Preview | Class |
Header |
|
Body |
|
Secondary |
|
Tertiary |
|
Disabled |
|
Primary |
|
Primary contrast |
|
Error |
|
Error contrast |
|
Success |
|
Success contrast |
|
Text Overflow
Classes for setting text overflow.
Preview | Class |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
|
Text Transform
Classes for transforming text.
Preview | Class |
Lorem ipsum dolor sit amet |
|
Lorem ipsum dolor sit amet |
|
Lorem ipsum dolor sit amet |
|
Whitespace
Classes for transforming text.
Preview | Class |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
|