Package com.vaadin.flow.dom
Interface Style
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BasicElementStyle,ImmutableEmptyStyle
Provides inline styles for
Elements.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionclear()Removes all set style properties.Gets the value of the given style property.getNames()Gets the defined style property names.booleanChecks if the given style property has been set.Removes the given style property if it has been set.Sets the given style property to the given value.
-
Method Details
-
get
Gets the value of the given style property.Note that the name should be in camelCase and not dash-separated, i.e. use "fontFamily" and not "font-family"
- Parameters:
name- the style property name as camelCase, notnull- Returns:
- the style property value, or
nullif the style property has not been set
-
set
Sets the given style property to the given value.Both camelCased (e.g.
fontFamily) and dash-separated (e.g.font-familyversions are supported.- Parameters:
name- the style property name as camelCase, notnullvalue- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
remove
Removes the given style property if it has been set.Both camelCased (e.g.
fontFamily) and dash-separated (e.g.font-familyversions are supported.- Parameters:
name- the style property name as camelCase, notnull- Returns:
- this style instance
-
clear
Style clear()Removes all set style properties.- Returns:
- this style instance
-
has
Checks if the given style property has been set.Both camelCased (e.g.
fontFamily) and dash-separated (e.g.font-familyversions are supported.- Parameters:
name- the style property name as camelCase, notnull- Returns:
trueif the style property has been set,falseotherwise
-
getNames
Gets the defined style property names.Note that this always returns the name as camelCased, e.g.
fontFamilyeven if it has been set as dash-separated (font-family).- Returns:
- a stream of defined style property names
-