Package de.xima.fc.css.builder
Class CssDeclarationListBuilder
- java.lang.Object
-
- de.xima.fc.css.builder.CssDeclarationListBuilder
-
public final class CssDeclarationListBuilder extends Object
Simple builder for creating a CSS declaration list string (e.g. a list of styles such ascolor: red; background: green;
- For lengths,you can use strings or numbers (uses the default unit
ECssUnit.PIXELS
. Strings can also be created viaECssUnit.amount(double)
orCssBuilder.pixels(double)
etc. - For times,you can use strings or numbers (uses the default unit
ECssUnit.MILLISECONDS
. Strings can also be created viaECssUnit.amount(double)
orCssBuilder.milliseconds(double)
etc. - For colors,you can use strings,
ENamedCssColor
, orCssColor
- Author:
- XIMA MEDIA GmbH
- For lengths,you can use strings or numbers (uses the default unit
-
-
Method Summary
-
-
-
Method Detail
-
alignItems
public CssDeclarationListBuilder alignItems(Object... alignItems)
align-items: safe center
- Parameters:
alignItems
- Alignment values.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssAlignItems
-
backgroundRepeat
public CssDeclarationListBuilder backgroundRepeat(Object... repeatModes)
background-repeat: repeat space;
- Parameters:
repeatModes
- Background sizes to set.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssBackgroundRepeat
-
backgroundSize
public CssDeclarationListBuilder backgroundSize(Object... sizes)
background-size: 6px, auto, contain;
- Parameters:
sizes
- Background sizes to set.- Returns:
- This builder instance for chaining method calls.
-
bottom
public CssDeclarationListBuilder bottom(Object value)
bottom: 50%;
- Parameters:
value
- Right position .- Returns:
- This builder instance for chaining method calls.
-
boxSizing
public CssDeclarationListBuilder boxSizing(Object sizing)
box-sizing: "border-box";
- Parameters:
sizing
- Box sizing to use.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssBoxSizing
-
build
public String build()
- Returns:
- The string representing the CSS declaration list.
-
color
public CssDeclarationListBuilder color(Object color)
color: #fff;
- Parameters:
color
- Font color to use.- Returns:
- This builder instance for chaining method calls.
- See Also:
ENamedCssColor
,CssColor
-
cursor
public CssDeclarationListBuilder cursor(Object... cursors)
cursor: pointer
- Parameters:
cursors
- Cursor value.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssCursor
-
declaration
public CssDeclarationListBuilder declaration(String name, String value)
Adds a generic declaration with a property name and a property value.- Parameters:
name
- Name of the property.value
- Name of the property.- Returns:
- This builder instance for chaining method calls.
-
display
public CssDeclarationListBuilder display(Object... displays)
display: inline block
- Parameters:
displays
- Display values.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssDisplay
-
fontFamily
public CssDeclarationListBuilder fontFamily(Object... fontFamilies)
font-family: "Arial";
- Parameters:
fontFamilies
- Font families to use.- Returns:
- This builder instance for chaining method calls.
-
fontSize
public CssDeclarationListBuilder fontSize(Object value)
font-size: 1.5em;
- Parameters:
value
- Font size.- Returns:
- This builder instance for chaining method calls.
-
height
public CssDeclarationListBuilder height(Object value)
width: 50vw;
- Parameters:
value
- Width value.- Returns:
- This builder instance for chaining method calls.
-
justifyContent
public CssDeclarationListBuilder justifyContent(Object... justifyContent)
justify-content: unsafe center
- Parameters:
justifyContent
- Justify values.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssJustifyContent
-
left
public CssDeclarationListBuilder left(Object value)
left: 50%;
- Parameters:
value
- Left position .- Returns:
- This builder instance for chaining method calls.
-
lineHeight
public CssDeclarationListBuilder lineHeight(Object value)
line-height: 4mm)
- Parameters:
value
- Line height value.- Returns:
- This builder instance for chaining method calls.
-
overflow
public CssDeclarationListBuilder overflow(Object... overflows)
overflow: auto hidden
- Parameters:
overflows
- Overflow values.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssOverflow
-
pointerEvents
public CssDeclarationListBuilder pointerEvents(Object pointerEvents)
pointer-events: none
- Parameters:
pointerEvents
- Pointer events value.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssPointerEvent
-
position
public CssDeclarationListBuilder position(Object position)
position: absolute
- Parameters:
position
- Position value.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssPosition
-
right
public CssDeclarationListBuilder right(Object value)
right: 50%;
- Parameters:
value
- Right position .- Returns:
- This builder instance for chaining method calls.
-
textAlign
public CssDeclarationListBuilder textAlign(Object alignment)
text-align: left;
- Parameters:
alignment
- Alignment for the text.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssTextAlign
-
top
public CssDeclarationListBuilder top(Object value)
top: 50%;
- Parameters:
value
- Top position.- Returns:
- This builder instance for chaining method calls.
-
transform
public CssDeclarationListBuilder transform(Object... transforms)
transform: translateX(20px) scale(1.5)
- Parameters:
transforms
- A list of CSS tranforms to apply. transform strings.- Returns:
- This builder instance for chaining method calls.
- See Also:
, for an easy way to build longer
-
transformOrigin
public CssDeclarationListBuilder transformOrigin(Object... origins)
transform-origin: bottom left;
- Parameters:
origins
- A list of origin specifications.- Returns:
- This builder instance for chaining method calls.
- See Also:
ECssTranformOrigin
-
width
public CssDeclarationListBuilder width(Object value)
width(50em)
- Parameters:
value
- Width value.- Returns:
- This builder instance for chaining method calls.
-
-