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 enumCss values for thealign-itemsproperty.static enumCss values for thealign-selfproperty.static enumstatic enumCss values for the clear property.static enumstatic enumCss values for theflex-basisproperty.static enumCss values for thejustify-contentproperty.static enumCss values for theflex-wrapproperty.static enumCss values for the float property.static enumCss values for thefont-weightproperty.static enumCss values for thejustify-contentproperty.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 StylesetAlignItems(Style.AlignItems value) Sets thealign-itemsproperty.default StylesetAlignSelf(Style.AlignSelf value) Sets thealign-selfproperty.default StylesetBackground(String value) Sets thebackgroundproperty.default StylesetBackgroundColor(String value) Sets thebackground-colorproperty.default StylesetBackgroundPosition(String value) Sets thebackground-positionproperty.default StylesetBackgroundSize(String value) Sets thebackground-sizeproperty.default StyleSets theborderproperty.default StylesetBorderBottom(String value) Sets theborder-bottomproperty.default StylesetBorderLeft(String value) Sets theborder-leftproperty.default StylesetBorderRadius(String value) Sets theborder-radiusproperty.default StylesetBorderRight(String value) Sets theborder-rightproperty.default StylesetBorderTop(String value) Sets theborder-topproperty.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 StyleSets thefilterproperty.default StylesetFlexBasis(Style.FlexBasis value) Sets theflex-basisproperty.default StylesetFlexBasis(String value) Sets theflex-basisproperty.default StyleSets theflex-directionproperty.default StylesetFlexGrow(String value) Sets theflex-growproperty.default StylesetFlexShrink(String value) Sets theflex-shrinkproperty.default StylesetFlexWrap(Style.FlexWrap value) Sets theflex-wrapproperty.default StylesetFloat(Style.FloatCss value) Sets thefloatproperty.default StyleSets thefontproperty.default StylesetFontSize(String value) Sets thefont-sizeproperty.default StylesetFontWeight(Style.FontWeight value) Sets thefont-weightproperty.default StylesetFontWeight(Integer value) Sets thefont-weightproperty.default StylesetFontWeight(String value) Sets thefont-weightproperty.default StyleSets thegapproperty.default StyleSets theheightproperty.default StyleSets thejustify-contentproperty.default StyleSets theleftproperty.default StylesetLineHeight(String value) Sets theline-heightproperty.default StyleSets themarginproperty.default StylesetMarginBottom(String value) Sets themargin-bottomproperty.default StylesetMarginInlineEnd(String value) Sets themargin-inline-endproperty.default StylesetMarginInlineStart(String value) Sets themargin-inline-startproperty.default StylesetMarginLeft(String value) Sets themargin-leftproperty.default StylesetMarginRight(String value) Sets themargin-rightproperty.default StylesetMarginTop(String value) Sets themargin-topproperty.default StylesetMaxHeight(String value) Sets themax-heightproperty.default StylesetMaxWidth(String value) Sets themax-widthproperty.default StylesetMinHeight(String value) Sets themin-heightproperty.default StylesetMinWidth(String value) Sets themin-widthproperty.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 StylesetPaddingBottom(String value) Sets thepadding-bottomproperty.default StylesetPaddingLeft(String value) Sets thepadding-leftproperty.default StylesetPaddingRight(String value) Sets thepadding-rightproperty.default StylesetPaddingTop(String value) Sets thepadding-topproperty.default StylesetPosition(Style.Position value) Sets thepositionproperty.default StyleSets therightproperty.default StyleSets therotateproperty.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 StylesetTransformOrigin(String value) Sets thetransform-originproperty.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
-
setBackgroundColor
Sets thebackground-colorproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBackgroundPosition
Sets thebackground-positionproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBackgroundSize
Sets thebackground-sizeproperty.- 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
-
setBorderLeft
Sets theborder-leftproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBorderRight
Sets theborder-rightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBorderTop
Sets theborder-topproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBorderBottom
Sets theborder-bottomproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setBorderRadius
Sets theborder-radiusproperty.- 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
-
setFilter
Sets thefilterproperty.- 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
-
setGap
Sets thegapproperty.- 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
-
setMinHeight
Sets themin-heightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMaxHeight
Sets themax-heightproperty.- 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
-
setMarginLeft
Sets themargin-leftproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMarginRight
Sets themargin-rightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMarginTop
Sets themargin-topproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMarginBottom
Sets themargin-bottomproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMarginInlineStart
Sets themargin-inline-startproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMarginInlineEnd
Sets themargin-inline-endproperty.- 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
-
setPaddingLeft
Sets thepadding-leftproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setPaddingRight
Sets thepadding-rightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setPaddingTop
Sets thepadding-topproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setPaddingBottom
Sets thepadding-bottomproperty.- 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
-
setRotate
Sets therotateproperty.- 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
-
setTransformOrigin
Sets thetransform-originproperty.- 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
-
setMinWidth
Sets themin-widthproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setMaxWidth
Sets themax-widthproperty.- 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
-
setFontWeight
Sets thefont-weightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFontWeight
Sets thefont-weightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFontWeight
Sets thefont-weightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFontSize
Sets thefont-sizeproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setLineHeight
Sets theline-heightproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setAlignItems
Sets thealign-itemsproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setAlignSelf
Sets thealign-selfproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFlexWrap
Sets theflex-wrapproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFlexGrow
Sets theflex-growproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFlexShrink
Sets theflex-shrinkproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setJustifyContent
Sets thejustify-contentproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFlexDirection
Sets theflex-directionproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFlexBasis
Sets theflex-basisproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-
setFlexBasis
Sets theflex-basisproperty.- Parameters:
value- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
-