Class ComponentStyles


  • public class ComponentStyles
    extends Object
    Utility class for common CSS adjustments that are not part of the Vaadin API. Also holds utility class names.

    This class is intended to be used for small generic CSS changes. For component specific CSS styles, use a CSS file instead.

    • Method Detail

      • setOverflowAuto

        public static void setOverflowAuto​(com.vaadin.flow.component.Component component)
        Sets the overflow of the given component to "auto". This makes the component automatically scroll if necessary (see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow).
        Parameters:
        component - Component whose overflow property should be set
      • setFormItemLabelWidth

        public static void setFormItemLabelWidth​(com.vaadin.flow.component.Component component,
                                                 String width)
        Sets the width of all form item labels in the given Component
        Parameters:
        component - the Component on which the property is set. This will affect all labels within the FormLayout.
        width - the width of the label as CSS property, e.g. 12em