com.vaadin.flow.dom.
Interface Style
All Superinterfaces:
All Known Implementing Classes:
Provides inline styles for Element
s.
Since:
1.0
Author:
Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Css values for the
align-items
property.static enum
Css values for the
align-self
property.static enum
static enum
Css values for the clear property.
static enum
static enum
Css values for the
flex-basis
property.static enum
Css values for the
justify-content
property.static enum
Css values for the
flex-wrap
property.static enum
Css values for the float property.
static enum
Css values for the
font-weight
property.static enum
Css values for the
justify-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 the
align-items
property.default Style
setAlignSelf
(Style.AlignSelf value) Sets the
align-self
property.default Style
setBackground
(String value) Sets the
background
property.default Style
setBackgroundColor
(String value) Sets the
background-color
property.default Style
Sets the
border
property.default Style
setBorderBottom
(String value) Sets the
border-bottom
property.default Style
setBorderLeft
(String value) Sets the
border-left
property.default Style
setBorderRadius
(String value) Sets the
border-radius
property.default Style
setBorderRight
(String value) Sets the
border-right
property.default Style
setBorderTop
(String value) Sets the
border-top
property.default Style
Sets the
bottom
property.default Style
setBoxShadow
(String value) Sets the
box-shadow
property.default Style
setBoxSizing
(Style.BoxSizing value) Sets the
box-sizing
property.default Style
setClear
(Style.Clear value) Sets the
clear
property.default Style
Sets the
color
property.default Style
Sets the
cursor
property.default Style
setDisplay
(Style.Display value) Sets the
display
property.default Style
setFlexBasis
(Style.FlexBasis value) Sets the
flex-basis
property.default Style
setFlexBasis
(String value) Sets the
flex-basis
property.default Style
Sets the
flex-direction
property.default Style
setFlexGrow
(String value) Sets the
flex-grow
property.default Style
setFlexShrink
(String value) Sets the
flex-shrink
property.default Style
setFlexWrap
(Style.FlexWrap value) Sets the
flex-wrap
property.default Style
setFloat
(Style.FloatCss value) Sets the
float
property.default Style
Sets the
font
property.default Style
setFontSize
(String value) Sets the
font-size
property.default Style
setFontWeight
(Style.FontWeight value) Sets the
font-weight
property.default Style
setFontWeight
(Integer value) Sets the
font-weight
property.default Style
setFontWeight
(String value) Sets the
font-weight
property.default Style
Sets the
height
property.default Style
Sets the
justify-content
property.default Style
Sets the
left
property.default Style
setLineHeight
(String value) Sets the
line-height
property.default Style
Sets the
margin
property.default Style
setMarginBottom
(String value) Sets the
margin-bottom
property.default Style
setMarginInlineEnd
(String value) Sets the
margin-inline-end
property.default Style
setMarginInlineStart
(String value) Sets the
margin-inline-start
property.default Style
setMarginLeft
(String value) Sets the
margin-left
property.default Style
setMarginRight
(String value) Sets the
margin-right
property.default Style
setMarginTop
(String value) Sets the
margin-top
property.default Style
setMaxHeight
(String value) Sets the
max-height
property.default Style
setMaxWidth
(String value) Sets the
max-width
property.default Style
setMinHeight
(String value) Sets the
min-height
property.default Style
setMinWidth
(String value) Sets the
min-width
property.default Style
setOpacity
(String value) Sets the
opacity
property.default Style
setOutline
(String value) Sets the
outline
property.default Style
setOverflow
(Style.Overflow value) Sets the
overflow
property.default Style
setPadding
(String value) Sets the
padding
property.default Style
setPaddingBottom
(String value) Sets the
padding-bottom
property.default Style
setPaddingLeft
(String value) Sets the
padding-left
property.default Style
setPaddingRight
(String value) Sets the
padding-right
property.default Style
setPaddingTop
(String value) Sets the
padding-top
property.default Style
setPosition
(Style.Position value) Sets the
position
property.default Style
Sets the
right
property.default Style
Sets the
scale
property.default Style
setTextAlign
(Style.TextAlign value) Sets the
text-align
property.default Style
setTextDecoration
(String value) Sets the
text-decoration
property.default Style
Sets the
top
property.default Style
setTransform
(String value) Sets the
transform
property.default Style
setTransformOrigin
(String value) Sets the
transform-origin
property.default Style
setTransition
(String value) Sets the
transition
property.default Style
setVisibility
(Style.Visibility value) Sets the
visibility
property.default Style
setWhiteSpace
(Style.WhiteSpace value) Sets the
white-space
property.default Style
Sets the
width
property.default Style
Sets the
z-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 the
background
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBackgroundColor
Sets the
background-color
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBorder
Sets the
border
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBorderLeft
Sets the
border-left
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBorderRight
Sets the
border-right
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBorderTop
Sets the
border-top
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBorderBottom
Sets the
border-bottom
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBorderRadius
Sets the
border-radius
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBoxSizing
Sets the
box-sizing
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBoxShadow
Sets the
box-shadow
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setClear
Sets the
clear
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setCursor
Sets the
cursor
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setColor
Sets the
color
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setDisplay
Sets the
display
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFloat
Sets the
float
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFont
Sets the
font
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setHeight
Sets the
height
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMinHeight
Sets the
min-height
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMaxHeight
Sets the
max-height
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMargin
Sets the
margin
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMarginLeft
Sets the
margin-left
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMarginRight
Sets the
margin-right
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMarginTop
Sets the
margin-top
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMarginBottom
Sets the
margin-bottom
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMarginInlineStart
Sets the
margin-inline-start
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMarginInlineEnd
Sets the
margin-inline-end
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setOutline
Sets the
outline
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setOpacity
Sets the
opacity
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setOverflow
Sets the
overflow
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setPadding
Sets the
padding
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setPaddingLeft
Sets the
padding-left
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setPaddingRight
Sets the
padding-right
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setPaddingTop
Sets the
padding-top
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setPaddingBottom
Sets the
padding-bottom
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setPosition
Sets the
position
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setScale
Sets the
scale
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setTextAlign
Sets the
text-align
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setTextDecoration
Sets the
text-decoration
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setTransform
Sets the
transform
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setTransformOrigin
Sets the
transform-origin
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setTransition
Sets the
transition
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setVisibility
Sets the
visibility
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setWidth
Sets the
width
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMinWidth
Sets the
min-width
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setMaxWidth
Sets the
max-width
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setWhiteSpace
Sets the
white-space
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setLeft
Sets the
left
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setRight
Sets the
right
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setTop
Sets the
top
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setBottom
Sets the
bottom
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setZIndex
Sets the
z-index
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFontWeight
Sets the
font-weight
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFontWeight
Sets the
font-weight
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFontWeight
Sets the
font-weight
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFontSize
Sets the
font-size
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setLineHeight
Sets the
line-height
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setAlignItems
Sets the
align-items
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setAlignSelf
Sets the
align-self
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFlexWrap
Sets the
flex-wrap
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFlexGrow
Sets the
flex-grow
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFlexShrink
Sets the
flex-shrink
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setJustifyContent
Sets the
justify-content
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFlexDirection
Sets the
flex-direction
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFlexBasis
Sets the
flex-basis
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-
setFlexBasis
Sets the
flex-basis
property.Parameters:
value
- the style property value (ifnull
, the property will be removed)Returns:
this style instance
-