Package com.vaadin.flow.dom
Interface Style
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BasicElementStyle
,ImmutableEmptyStyle
Provides inline styles for
Element
s.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Css values for thealign-items
property.static enum
Css values for thealign-self
property.static enum
static enum
Css values for the clear property.static enum
static enum
Css values for theflex-basis
property.static enum
Css values for thejustify-content
property.static enum
Css values for theflex-wrap
property.static enum
Css values for the float property.static enum
Css values for thefont-weight
property.static enum
Css values for thejustify-content
property.static enum
static enum
Css values for the position property.static enum
Css values for the text-align property.static enum
Css values for the visibility property.static enum
Css 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.boolean
Checks 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 Style
setAlignItems
(Style.AlignItems value) Sets thealign-items
property.default Style
setAlignSelf
(Style.AlignSelf value) Sets thealign-self
property.default Style
setBackground
(String value) Sets thebackground
property.default Style
setBackgroundColor
(String value) Sets thebackground-color
property.default Style
Sets theborder
property.default Style
setBorderBottom
(String value) Sets theborder-bottom
property.default Style
setBorderLeft
(String value) Sets theborder-left
property.default Style
setBorderRadius
(String value) Sets theborder-radius
property.default Style
setBorderRight
(String value) Sets theborder-right
property.default Style
setBorderTop
(String value) Sets theborder-top
property.default Style
Sets thebottom
property.default Style
setBoxShadow
(String value) Sets thebox-shadow
property.default Style
setBoxSizing
(Style.BoxSizing value) Sets thebox-sizing
property.default Style
setClear
(Style.Clear value) Sets theclear
property.default Style
Sets thecolor
property.default Style
Sets thecursor
property.default Style
setDisplay
(Style.Display value) Sets thedisplay
property.default Style
setFlexBasis
(Style.FlexBasis value) Sets theflex-basis
property.default Style
setFlexBasis
(String value) Sets theflex-basis
property.default Style
Sets theflex-direction
property.default Style
setFlexGrow
(String value) Sets theflex-grow
property.default Style
setFlexShrink
(String value) Sets theflex-shrink
property.default Style
setFlexWrap
(Style.FlexWrap value) Sets theflex-wrap
property.default Style
setFloat
(Style.FloatCss value) Sets thefloat
property.default Style
Sets thefont
property.default Style
setFontSize
(String value) Sets thefont-size
property.default Style
setFontWeight
(Style.FontWeight value) Sets thefont-weight
property.default Style
setFontWeight
(Integer value) Sets thefont-weight
property.default Style
setFontWeight
(String value) Sets thefont-weight
property.default Style
Sets theheight
property.default Style
Sets thejustify-content
property.default Style
Sets theleft
property.default Style
setLineHeight
(String value) Sets theline-height
property.default Style
Sets themargin
property.default Style
setMarginBottom
(String value) Sets themargin-bottom
property.default Style
setMarginInlineEnd
(String value) Sets themargin-inline-end
property.default Style
setMarginInlineStart
(String value) Sets themargin-inline-start
property.default Style
setMarginLeft
(String value) Sets themargin-left
property.default Style
setMarginRight
(String value) Sets themargin-right
property.default Style
setMarginTop
(String value) Sets themargin-top
property.default Style
setMaxHeight
(String value) Sets themax-height
property.default Style
setMaxWidth
(String value) Sets themax-width
property.default Style
setMinHeight
(String value) Sets themin-height
property.default Style
setMinWidth
(String value) Sets themin-width
property.default Style
setOpacity
(String value) Sets theopacity
property.default Style
setOutline
(String value) Sets theoutline
property.default Style
setOverflow
(Style.Overflow value) Sets theoverflow
property.default Style
setPadding
(String value) Sets thepadding
property.default Style
setPaddingBottom
(String value) Sets thepadding-bottom
property.default Style
setPaddingLeft
(String value) Sets thepadding-left
property.default Style
setPaddingRight
(String value) Sets thepadding-right
property.default Style
setPaddingTop
(String value) Sets thepadding-top
property.default Style
setPosition
(Style.Position value) Sets theposition
property.default Style
Sets theright
property.default Style
Sets thescale
property.default Style
setTextAlign
(Style.TextAlign value) Sets thetext-align
property.default Style
setTextDecoration
(String value) Sets thetext-decoration
property.default Style
Sets thetop
property.default Style
setTransform
(String value) Sets thetransform
property.default Style
setTransformOrigin
(String value) Sets thetransform-origin
property.default Style
setTransition
(String value) Sets thetransition
property.default Style
setVisibility
(Style.Visibility value) Sets thevisibility
property.default Style
setWhiteSpace
(Style.WhiteSpace value) Sets thewhite-space
property.default Style
Sets thewidth
property.default Style
Sets thez-index
property.
-
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
null
if 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-family
versions are supported.- Parameters:
name
- the style property name as camelCase, notnull
value
- 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-family
versions 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-family
versions are supported.- Parameters:
name
- the style property name as camelCase, notnull
- Returns:
true
if the style property has been set,false
otherwise
-
getNames
Gets the defined style property names.Note that this always returns the name as camelCased, e.g.
fontFamily
even if it has been set as dash-separated (font-family
).- Returns:
- a stream of defined style property names
-
setBackground
Sets thebackground
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBackgroundColor
Sets thebackground-color
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorder
Sets theborder
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorderLeft
Sets theborder-left
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorderRight
Sets theborder-right
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorderTop
Sets theborder-top
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorderBottom
Sets theborder-bottom
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBorderRadius
Sets theborder-radius
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBoxSizing
Sets thebox-sizing
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBoxShadow
Sets thebox-shadow
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setClear
Sets theclear
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setCursor
Sets thecursor
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setColor
Sets thecolor
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setDisplay
Sets thedisplay
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFloat
Sets thefloat
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFont
Sets thefont
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setHeight
Sets theheight
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMinHeight
Sets themin-height
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMaxHeight
Sets themax-height
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMargin
Sets themargin
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMarginLeft
Sets themargin-left
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMarginRight
Sets themargin-right
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMarginTop
Sets themargin-top
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMarginBottom
Sets themargin-bottom
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMarginInlineStart
Sets themargin-inline-start
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMarginInlineEnd
Sets themargin-inline-end
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setOutline
Sets theoutline
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setOpacity
Sets theopacity
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setOverflow
Sets theoverflow
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPadding
Sets thepadding
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPaddingLeft
Sets thepadding-left
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPaddingRight
Sets thepadding-right
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPaddingTop
Sets thepadding-top
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPaddingBottom
Sets thepadding-bottom
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setPosition
Sets theposition
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setScale
Sets thescale
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTextAlign
Sets thetext-align
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTextDecoration
Sets thetext-decoration
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTransform
Sets thetransform
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTransformOrigin
Sets thetransform-origin
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTransition
Sets thetransition
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setVisibility
Sets thevisibility
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setWidth
Sets thewidth
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMinWidth
Sets themin-width
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setMaxWidth
Sets themax-width
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setWhiteSpace
Sets thewhite-space
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setLeft
Sets theleft
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setRight
Sets theright
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setTop
Sets thetop
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setBottom
Sets thebottom
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setZIndex
Sets thez-index
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFontWeight
Sets thefont-weight
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFontWeight
Sets thefont-weight
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFontWeight
Sets thefont-weight
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFontSize
Sets thefont-size
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setLineHeight
Sets theline-height
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setAlignItems
Sets thealign-items
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setAlignSelf
Sets thealign-self
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFlexWrap
Sets theflex-wrap
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFlexGrow
Sets theflex-grow
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFlexShrink
Sets theflex-shrink
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setJustifyContent
Sets thejustify-content
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFlexDirection
Sets theflex-direction
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFlexBasis
Sets theflex-basis
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-
setFlexBasis
Sets theflex-basis
property.- Parameters:
value
- the style property value (ifnull
, the property will be removed)- Returns:
- this style instance
-