You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CSSThemeCompiler: support theme constants, font sizes, and spacing semantics for parity #6024
com.codename1.ui.css.CSSThemeCompiler should support the following syntax and theme semantics for parity with the standard Codename One CSS compiler (com.codename1.designer.css.CSSTheme).
Theme constants
Recognize #Constants { ... } as a theme-constant block, while retaining @constants support.
Preserve constant-name case. For example, includeNativeBool must produce @includeNativeBool, not @includenativebool. Ordinary CSS property names can remain case-insensitive.
Decode quoted constant values: both 'true' and "true" should produce the string true, without quote delimiters. Unquoted values should continue to work.
Exclude constant blocks from ordinary UIID rule processing.
Expected theme entries include @includeNativeBool = "true" and @customMessage = "Hello".
Font sizes
Support font-size with mm, px, and pt, including correct conversion and integration with font-family. Size declarations should also work without a family declaration and remain associated with the correct component state.
The resulting theme should resolve to a usable font at the requested size, with the same sizing semantics as the standard CSS compiler.
Padding and margin
Expand one-, two-, three-, and four-value CSS shorthand correctly.
Convert CSS top/right/bottom/left order to Codename One's top/bottom/left/right storage order.
Emit the corresponding per-side unit metadata, preserving mm, px, and % semantics and converting pt consistently with the standard compiler. Mixed-unit declarations should preserve each side's unit.
For example:
Label {
padding:1px2px3px4px;
margin:1mm2mm;
}
Expected padding values in theme storage order are 1,3,4,2. Expected margin values are 1,1,2,2, with millimeter unit metadata for all four sides.
Current gaps and validation
Source inspection of the current default branch shows that compileConstants() recognizes only @constants, parseDeclarations() lowercases all names and retains quoted values, font-size has no handler, and normalizeBox() preserves CSS ordering while scalar() only strips px.
Add regression coverage for the examples above, all shorthand lengths, mixed units, and state-specific font/spacing declarations. Compare generated theme values and resolved styles against the standard CSS compiler, and retain coverage for existing @constants behavior.
Activity