Class VStyle
- All Implemented Interfaces:
com.vaadin.flow.dom.Style,Serializable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.dom.Style
com.vaadin.flow.dom.Style.AlignItems, com.vaadin.flow.dom.Style.AlignSelf, com.vaadin.flow.dom.Style.BoxSizing, com.vaadin.flow.dom.Style.Clear, com.vaadin.flow.dom.Style.Display, com.vaadin.flow.dom.Style.FlexBasis, com.vaadin.flow.dom.Style.FlexDirection, com.vaadin.flow.dom.Style.FlexWrap, com.vaadin.flow.dom.Style.FloatCss, com.vaadin.flow.dom.Style.FontWeight, com.vaadin.flow.dom.Style.JustifyContent, com.vaadin.flow.dom.Style.Overflow, com.vaadin.flow.dom.Style.Position, com.vaadin.flow.dom.Style.TextAlign, com.vaadin.flow.dom.Style.Visibility, com.vaadin.flow.dom.Style.WhiteSpace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(com.vaadin.flow.component.Component component) Applies the styles defined in this VStyle to the given component.voidApplies the styles defined in this VStyle to an element specified by the context component and css selector.voidapplyToShadowRoot(com.vaadin.flow.component.Component component, String cssSelector) Applies the styles defined in this VStyle to an element specified by the context component and css selector, but specifically to the shadow root of the component.clear()in.virit.color.Colorin.virit.color.ColorgetColor()getNames()booleanvoidinjectWithSelectors(String... cssSelectors) Injects the styles defined in this object to the host page as CSS, for the given CSS selector.setBackgroundColor(in.virit.color.Color color) voidsetBorderRadiusPx(Number pixels) Sets the CSSborder-radiusproperty in pixels.voidsetBorderWidthPx(Number pixels) Sets the CSSborder-widthproperty in pixels.voidsetBottomPx(Number pixels) Sets the CSSbottomproperty in pixels.setColor(in.virit.color.Color color) voidsetColumnGapPx(Number pixels) Sets the CSScolumn-gapproperty in pixels.voidsetFontSizePx(Number pixels) Sets the CSSfont-sizeproperty in pixels.voidSets the CSSgapproperty in pixels.voidsetHeightPx(Number pixels) Sets the CSSheightproperty in pixels.voidSets the CSSleftproperty in pixels.voidsetLineHeightPx(Number pixels) Sets the CSSline-heightproperty in pixels.voidsetMarginBottomPx(Number pixels) Sets the CSSmargin-bottomproperty in pixels.voidsetMarginLeftPx(Number pixels) Sets the CSSmargin-leftproperty in pixels.voidsetMarginPx(Number pixels) Sets the CSSmarginproperty in pixels (all sides).voidsetMarginRightPx(Number pixels) Sets the CSSmargin-rightproperty in pixels.voidsetMarginTopPx(Number pixels) Sets the CSSmargin-topproperty in pixels.voidsetMaxHeightPx(Number pixels) Sets the CSSmax-heightproperty in pixels.voidsetMaxWidthPx(Number pixels) Sets the CSSmax-widthproperty in pixels.voidsetMinHeightPx(Number pixels) Sets the CSSmin-heightproperty in pixels.voidsetMinWidthPx(Number pixels) Sets the CSSmin-widthproperty in pixels.voidsetPaddingBottomPx(Number pixels) Sets the CSSpadding-bottomproperty in pixels.voidsetPaddingLeftPx(Number pixels) Sets the CSSpadding-leftproperty in pixels.voidsetPaddingPx(Number pixels) Sets the CSSpaddingproperty in pixels (all sides).voidsetPaddingRightPx(Number pixels) Sets the CSSpadding-rightproperty in pixels.voidsetPaddingTopPx(Number pixels) Sets the CSSpadding-topproperty in pixels.voidsetRightPx(Number pixels) Sets the CSSrightproperty in pixels.voidsetRowGapPx(Number pixels) Sets the CSSrow-gapproperty in pixels.voidSets the CSStopproperty in pixels.voidsetWidthPx(Number pixels) Sets the CSSwidthproperty in pixels.static VStylewrap(com.vaadin.flow.dom.Style original) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.dom.Style
bind, getColorScheme, setAlignItems, setAlignSelf, setBackground, setBackgroundColor, setBackgroundPosition, setBackgroundSize, setBorder, setBorderBottom, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBottom, setBoxShadow, setBoxSizing, setClear, setColor, setColorScheme, setCursor, setDisplay, setFilter, setFlexBasis, setFlexBasis, setFlexDirection, setFlexGrow, setFlexShrink, setFlexWrap, setFloat, setFont, setFontSize, setFontWeight, setFontWeight, setFontWeight, setGap, setHeight, setJustifyContent, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginInlineEnd, setMarginInlineStart, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOpacity, setOutline, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPosition, setRight, setRotate, setScale, setTextAlign, setTextDecoration, setTop, setTransform, setTransformOrigin, setTransition, setVisibility, setWhiteSpace, setWidth, setZIndex
-
Constructor Details
-
VStyle
public VStyle(com.vaadin.flow.dom.Style wrapped) -
VStyle
public VStyle()
-
-
Method Details
-
wrap
-
getColor
public in.virit.color.Color getColor() -
setColor
-
getBackgroundColor
public in.virit.color.Color getBackgroundColor() -
setBackgroundColor
-
get
- Specified by:
getin interfacecom.vaadin.flow.dom.Style
-
set
- Specified by:
setin interfacecom.vaadin.flow.dom.Style
-
remove
- Specified by:
removein interfacecom.vaadin.flow.dom.Style
-
clear
- Specified by:
clearin interfacecom.vaadin.flow.dom.Style
-
has
- Specified by:
hasin interfacecom.vaadin.flow.dom.Style
-
getNames
- Specified by:
getNamesin interfacecom.vaadin.flow.dom.Style
-
apply
public void apply(com.vaadin.flow.component.Component component) Applies the styles defined in this VStyle to the given component.- Parameters:
component- the component to which the styles will be applied
-
apply
Applies the styles defined in this VStyle to an element specified by the context component and css selector.Note that the styles are applied to the element after it has been rendered using JS. If you happen to use "preserve on refresh" feature of Vaadin, you might need to call this method again after the refresh, as the styles are not preserved automatically.
- Parameters:
component- the component to which the styles will be appliedcssSelector- the CSS selector to target the specific element within the component
-
injectWithSelectors
Injects the styles defined in this object to the host page as CSS, for the given CSS selector.- Parameters:
cssSelectors- the CSS selector to target the specific element within the host page
-
toCss
-
applyToShadowRoot
Applies the styles defined in this VStyle to an element specified by the context component and css selector, but specifically to the shadow root of the component.Note that the styles are applied to the element after it has been rendered using JS. If you happen to use "preserve on refresh" feature of Vaadin, you might need to call this method again after the refresh, as the styles are not preserved automatically.
- Parameters:
component- the component to which the styles will be appliecssSelector- the CSS selector to target the specific element within the component's shadow root
-
setLeftPx
Sets the CSSleftproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setTopPx
Sets the CSStopproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setRightPx
Sets the CSSrightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setBottomPx
Sets the CSSbottomproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setWidthPx
Sets the CSSwidthproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setHeightPx
Sets the CSSheightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMinWidthPx
Sets the CSSmin-widthproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMaxWidthPx
Sets the CSSmax-widthproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMinHeightPx
Sets the CSSmin-heightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMaxHeightPx
Sets the CSSmax-heightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMarginPx
Sets the CSSmarginproperty in pixels (all sides).- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMarginTopPx
Sets the CSSmargin-topproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMarginRightPx
Sets the CSSmargin-rightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMarginBottomPx
Sets the CSSmargin-bottomproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setMarginLeftPx
Sets the CSSmargin-leftproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setPaddingPx
Sets the CSSpaddingproperty in pixels (all sides).- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setPaddingTopPx
Sets the CSSpadding-topproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setPaddingRightPx
Sets the CSSpadding-rightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setPaddingBottomPx
Sets the CSSpadding-bottomproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setPaddingLeftPx
Sets the CSSpadding-leftproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setGapPx
Sets the CSSgapproperty in pixels.This property is used with flexbox and grid layouts to set the spacing between items.
- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setRowGapPx
Sets the CSSrow-gapproperty in pixels.This property is used with flexbox and grid layouts to set the spacing between rows.
- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setColumnGapPx
Sets the CSScolumn-gapproperty in pixels.This property is used with flexbox and grid layouts to set the spacing between columns.
- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setBorderWidthPx
Sets the CSSborder-widthproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setBorderRadiusPx
Sets the CSSborder-radiusproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setFontSizePx
Sets the CSSfont-sizeproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-
setLineHeightPx
Sets the CSSline-heightproperty in pixels.- Parameters:
pixels- the value in pixels, ornullto clear the property
-