Repository navigation
CSSThemeCompiler: #Constants, font-size and box semantics matching the build-time compiler - #6032
shai-almog wants to merge 41 commits into
Conversation
…e build-time compiler Fixes #6024. - #Constants is a constants block like @constants, wherever it sits; constant and custom-property names keep their case and quoted values are unquoted. - font-family/font-size build a Font with the build-time compiler's unit conversions, per UIID state, even when declared in separate rules. - padding/margin expand 1-4 values into top,bottom,left,right storage order and emit padUnit/marUnit per side (px/pt pixels, mm/cm, %, rem, vw...). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63a6e3843d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Cloudflare Preview
|
|
Compared 170 screenshots: 170 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 206 screenshots: 206 matched. |
…base - Unquoted color literals in a constants block are stored as plain hex, as the build-time compiler stores them; consumers parse them with parseInt(v, 16). - A constant whose name ends in Image resolves to the resource image and a missing one fails the compile; getThemeImageConstant casts to Image, which is unchecked on iOS. - Fonts are built after all rules: a state that sets only family or size takes the other from the base style (and a dark style from the light one). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 821dc2cb05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…erive-aware state fonts - Constants blocks are applied again in source order, so a later declaration wins against :root and in-rule custom properties; the first pass still makes them visible to rules above the block. - A constant written as var(--x) is normalized to plain hex once resolved if it is a color. - A state font missing family or size completes it from the UIID's base style and then each cn1-derive parent's matching state and base, as the build-time compiler's flattening does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc3cbf4a2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
An image constant written as var(--x) is looked up once variables are resolved, so a custom property declared after the constants block (or in :root) no longer fails the compile with an unresolved image name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51a606ec92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 185 screenshots: 185 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 17 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
|
Compared 185 screenshots: 185 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 7763 64-Core Processor (baseline 2 performance regressions:
Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
A change that moves performance ON PURPOSE records the new baseline in Result: performance regression |
|
Compared 185 screenshots: 185 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
|
Compared 185 screenshots: 185 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
|
Compared 168 screenshots: 168 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 163 screenshots: 163 matched. |
|
Compared 236 screenshots: 236 matched. |
|
Compared 168 screenshots: 168 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
…braces, state-first font fallback Image constants are looked up after every rule ran, so a cn1-mutable-image can supply one. Only the winning declaration of a constant decides whether it is reinterpreted as an image or a var() color. A quoted brace no longer ends a rule. A state font searches the matching state along the derive chain before any unselected style. The GUI builder normalizer keeps the units the compiler already stored instead of resetting them to px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
When a constants block contains a self-reference or cycle, such as #Constants { a: var(--a); } or a: var(--b); b: var(--a);, this call enters resolveVars(), which repeatedly replaces one var() with another without cycle detection or a progress bound. Compilation then never returns, potentially freezing live reload or the GUI builder; detect repeated keys and reject cyclic constant definitions.
When a quoted string happens to contain variable syntax, for example #Constants { message: "var(--name)"; }, quote information has already been discarded before this unconditional pass, so the literal message is replaced with the value of --name (or with an empty string if it is undefined). The build-time compiler treats this as a string value, so only declarations that were originally unquoted variable expressions should be resolved.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cyclic vars, * font fallback rgba() color constants are stored as their RGB hex. A quoted constant is a string: its var() text is not resolved, and comment delimiters inside quotes are text. A cyclic var() reference is a syntax error instead of a compile that never returns. A state font falls back to the * style after the derive chain. The GUI builder test that used font-size as its example of an unsupported declaration now uses font-style, since the canvas compiler supports font-size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 313a87da68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…g custom properties are a cycle, pressed derives stay in their state, percentage rgb() channels; CSSTheme: percentage rgb() channels were read as 0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63b9e91ae8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…d #Constants names count as redeclarations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0d26b2911
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…micolons stay in identifiers, dark fonts ignore light derives; both compilers clamp out-of-range rgb() channels Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02bfc37a90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 450f1079e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… in a selector list, cn1-derive targets unquoted and decoded, hex escapes end at any CSS whitespace Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1732c45231
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ies, empty rgb() components rejected; GUI builder: #Constants in selector lists, corrupt unselected variants no longer fail the folder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58543d7834
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…font; GUI builder: a mixed #Constants selector list is still probed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c70b2e17ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rk element's derive leads to the light target Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f2dd3ea52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… pass; an image constant of a url() or dimension is left out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64d6855338
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…operty names decoded everywhere, a redefined exported constant retypes later aliases Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #6024.
The runtime CSS compiler (
com.codename1.ui.css.CSSThemeCompiler, used for live reload and by apps that build themes on device) now matches the build-time compiler (CSSTheme) on constants, fonts and spacing.Theme constants
#Constants { ... }is a constants block alongside@constants. Any number of blocks are allowed, in any position, and they are excluded from UIID rule processing.includeNativeBool->@includeNativeBool). Before,var(--myColor)could not find a:root{--myColor:...}declaration.'true'/"true"->true), and a;inside quotes no longer splits the declaration.--nameinside#Constantsbecomes@name, as in the build-time compiler.Fonts
font-family+font-sizeresolve to a realFont. Before, the raw family string was stored and never resolved at runtime.CSSTheme/Resources:px,pt(/72*25.4 mm),mm,cm,in,rem,vw/vh/vmin/vmax,%of medium, and the size keywords.native:MainRegular, so a size alone works. Family and size are tracked per UIID state and combine across rules.IsCssValid), font declarations are validated but noFontis created.Padding / margin
padUnit/marUnitare emitted:px/pt/bare numbers as rounded pixels (asCSSThemedoes),mm/cmas mm,%as screen percentage, andrem/vw/vh/vmin/vmaxwith their own units.CSSSyntaxException.Behaviour changes
@constants{primaryColor:...}now yields@primaryColor(was@primarycolor).Tests
CSSThemeCompilerTest: the issue's examples, every shorthand length, mixed units, state-specific fonts and spacing, resolvedStylevalues, and the existing@constantsbehaviour.RuntimeCompilerParityTest(maven/css-compiler): compiles one sheet with both compilers and compares constants, padding, margin and unit arrays.scripts/*/common/src/main/css/theme.csscompile exactly as they do on master. The three that fail (rgba()colours, a display-dependentbackground-image) fail identically there.🤖 Generated with Claude Code