Class CSSThemeCompiler
java.lang.Object
com.codename1.ui.css.CSSThemeCompiler
Compiles a subset of Codename One CSS into theme properties stored in a MutableResource.
Supported selector syntax
UIIDUIID:selectedUIID:pressedUIID:disabledUIID:hover*(mapped toComponent):root(for constants only)
Supported declarations
colorbackground-colorpadding,margin: one to four values in CSS top/right/bottom/left order, stored in the theme's top/bottom/left/right order together with per-sidepadUnit/marUnitmetadata.px,ptand unitless values are pixels (rounded, as the build-time compiler does),mmandcmare millimetres, andrem,vw,vh,vmin,vmaxkeep their own unit. A percentage is rejected, as the build-time compiler rejects it.font-familyandfont-size: resolved to aFontwith the build-time compiler's semantics. The family defaults tonative:MainRegularand the size to the medium system font;font-sizeacceptspx,pt,mm,cm,in,rem,vw,vh,vmin,vmax,%and thesmall/medium/largekeywords.cn1-derivecn1-image-idcn1-mutable-image- border-related properties:
border,border-*,background-image,background-position,background-repeat
Theme constants
- CSS custom property definitions in
:root, e.g.--primary: #ff00ff; #Constants { name: value; }, the block the build-time compiler reads, and the older@constants { name: value; other: value; }spelling.var(--name)dereferencing in declaration values.
A constant keeps the case of its name (includeNativeBool becomes @includeNativeBool) and
a quoted value is stored without its quotes, so 'true' and "true" both become true.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompile(String css, MutableResource resources, String themeName)
-
Constructor Details
-
CSSThemeCompiler
public CSSThemeCompiler()
-
-
Method Details
-
compile
-