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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enumCss values for the clear property.static enumstatic enumCss values for the float property.static enumstatic enumCss values for the position property.static enumCss values for the text-align property.static enumCss values for the visibility property.static enumCss values for the white-space property. -
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.default StylesetBackground(String value) Sets thebackgroundproperty.default StyleSets theborderproperty.default StyleSets thebottomproperty.default StylesetBoxShadow(String value) Sets thebox-shadowproperty.default StylesetBoxSizing(Style.BoxSizing value) Sets thebox-sizingproperty.default StylesetClear(Style.Clear value) Sets theclearproperty.default StyleSets thecolorproperty.default StyleSets thecursorproperty.default StylesetDisplay(Style.Display value) Sets thedisplayproperty.default StylesetFloat(Style.FloatCss value) Sets thefloatproperty.default StyleSets thefontproperty.default StyleSets theheightproperty.default StyleSets theleftproperty.default StyleSets themarginproperty.default StylesetOpacity(String value) Sets theopacityproperty.default StylesetOutline(String value) Sets theoutlineproperty.default StylesetOverflow(Style.Overflow value) Sets theoverflowproperty.default StylesetPadding(String value) Sets thepaddingproperty.default StylesetPosition(Style.Position value) Sets thepositionproperty.default StyleSets therightproperty.default StyleSets thescaleproperty.default StylesetTextAlign(Style.TextAlign value) Sets thetext-alignproperty.default StylesetTextDecoration(String value) Sets thetext-decorationproperty.default StyleSets thetopproperty.default StylesetTransform(String value) Sets thetransformproperty.default StylesetTransition(String value) Sets thetransitionproperty.default StylesetVisibility(Style.Visibility value) Sets thevisibilityproperty.default StylesetWhiteSpace(Style.WhiteSpace value) Sets thewhite-spaceproperty.default StyleSets thewidthproperty.default StyleSets thez-indexproperty.
-
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
-
setBackground
Sets thebackgroundproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBorder
Sets theborderproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBoxSizing
Sets thebox-sizingproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBoxShadow
Sets thebox-shadowproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setClear
Sets theclearproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setCursor
Sets thecursorproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setColor
Sets thecolorproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setDisplay
Sets thedisplayproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFloat
Sets thefloatproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFont
Sets thefontproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setHeight
Sets theheightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMargin
Sets themarginproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setOutline
Sets theoutlineproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setOpacity
Sets theopacityproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setOverflow
Sets theoverflowproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setPadding
Sets thepaddingproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setPosition
Sets thepositionproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setScale
Sets thescaleproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setTextAlign
Sets thetext-alignproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setTextDecoration
Sets thetext-decorationproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setTransform
Sets thetransformproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setTransition
Sets thetransitionproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setVisibility
Sets thevisibilityproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setWidth
Sets thewidthproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setWhiteSpace
Sets thewhite-spaceproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setLeft
Sets theleftproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setRight
Sets therightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setTop
Sets thetopproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBottom
Sets thebottomproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setZIndex
Sets thez-indexproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-