Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class CSSThemeCompiler
- Object
- 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 types
class CSSThemeCompiler.CSSSyntaxException |
Constructors
public CSSThemeCompiler() |
Methods
public void compile(String css, MutableResource resources, String themeName) |
Inherited methods
Constructor details
CSSThemeCompiler
public CSSThemeCompiler()Method details
compile
public void compile(String css, MutableResource resources, String themeName)