Interface Style
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BasicElementStyle,ImmutableEmptyStyle
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 TypeMethodDescriptiondefault StyleBinds the given style property to the provided string signal and keeps the style property value synchronized with the signal.clear()Removes all set style properties.Gets the value of the given style property.default ColorScheme.ValueGets thecolor-schemeproperty.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 StylesetColorScheme(ColorScheme.Value value) Sets thecolor-schemeproperty.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".
When a style property is bound to a signal with
bind(String, Signal), this method returns the value of the latest signal applied for the given style property name while the element was in the attached state.- Parameters:
name- the style property name as camelCase, notnull- Returns:
- the style property value, or
nullif the style property has not been set - See Also:
-
set
Sets the given style property to the given value.Both camelCased (e.g.
fontFamily) and dash-separated (e.g.font-familyversions are supported.While a signal binding for a specific style name is active, any attempt to manually set that same style throws a
BindingActiveException.- Parameters:
name- the style property name as camelCase, notnullvalue- the style property value (ifnull, the property will be removed)- Returns:
- this style instance
- See Also:
-
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.While a signal binding for a specific style name is active, any attempt to manually remove that same style throws a
BindingActiveException.- Parameters:
name- the style property name as camelCase, notnull- Returns:
- this style instance
- See Also:
-
clear
Style clear()Removes all set style properties.This method silently clears all style signal bindings (unsubscribe and forget recorded values) in addition to clearing style values.
- Returns:
- this style instance
- See Also:
-
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).Includes names of the style properties bound with the signals while the element was in the attached state.
- Returns:
- a stream of defined style property names
- See Also:
-
bind
Binds the given style property to the provided string signal and keeps the style property value synchronized with the signal.Passing
nullas thesignalremoves any existing binding for the given style property. When unbinding, the current presence of the style property is left unchanged.When a binding is in place, the style signal mirrors
signal.value(). If the signal value isnull, the style property is removed; otherwise it is set to the string value.The binding effect is active only while the owner element is in the attached state. While the owner is in the detached state, updates from the signal have no effect.
While a binding for a specific style name is active, any attempt to bind another signal for the same name throws a
BindingActiveException.Name handling follows the same rules as
set(String, String): both camelCase and dash-separated names are supported and normalized in the same way.- Parameters:
name- the style property name, notnullsignal- the signal that provides the style signal;nullremoves an existing binding for the given name- Returns:
- this style instance
- Throws:
BindingActiveException- thrown when there is already an existing binding- Since:
- 25.0
- See Also:
-
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
-
setColorScheme
Sets thecolor-schemeproperty.The color scheme affects how the browser renders UI elements and allows the component to adapt to system color scheme preferences.
- Parameters:
value- the color scheme value (ifnullor NORMAL, the property will be removed)- Returns:
- this style instance
-
getColorScheme
Gets thecolor-schemeproperty.- Returns:
- the color scheme value, or NORMAL if not set
-
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
-