Repository navigation
CSSThemeCompiler: #Constants, font-size and box semantics matching the build-time compiler - #6032
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 178 screenshots: 178 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Compared 214 screenshots: 214 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 193 screenshots: 193 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 1 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 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 193 screenshots: 193 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 7763 64-Core Processor (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 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 193 screenshots: 193 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 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 193 screenshots: 193 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 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 176 screenshots: 176 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 171 screenshots: 171 matched. |
|
Compared 236 screenshots: 236 matched. |
|
Compared 176 screenshots: 176 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>
…ble stays text for its aliases 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: daee10eec5
ℹ️ 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".
…amed chains typed by their leading token, universal font-size not validated, escaped #Constants selector recognised 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: 07e0d66a90
ℹ️ 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 var() fallback is rejected like a direct one, hex escapes take ASCII digits only 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: 617245d725
ℹ️ 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".
…t's url() fallback is left out, an undefined font-size variable is passed over; GUI builder keeps the last medium variant like the build Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
…abled states, as in the build Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ead again as a number Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 179 screenshots: 179 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (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 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
…r already moved are dropped or re-anchored) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… queries with an ASCII fold, not the device locale Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, per-side padding/margin, rgba/transparent/opacity, the full CSS named-color table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e the build, keep .unselected rules out of the other states Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lengths in #Constants, drop combinator selectors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… compound media queries, decode escaped UIIDs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…keep hex escapes out of the combinator check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 193 screenshots: 193 matched. Benchmark ResultsDetailed Performance Metrics
|
…iler's parity code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flutter vs Codename OneNo benchmark results were produced. |
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
The compiler runs on the EDT, so Hashtable's locking buys nothing. Only the theme map itself stays a Hashtable, since that is the Resources API type. 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