Skip to content

Add Advanced CSS editor to Initializr theme customization#4580

Closed
shai-almog wants to merge 3 commits intomasterfrom
codex/add-advanced-mode-for-css-editing
Closed

Add Advanced CSS editor to Initializr theme customization#4580
shai-almog wants to merge 3 commits intomasterfrom
codex/add-advanced-mode-for-css-editing

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Enable direct editing of CSS in the Initializr theme section so users can author CSS (using the new MutableResource + CSSThemeCompiler flow) and see live UI preview updates in the initializer preview pane.

Description

  • Add ThemeEditorMode and customCss to ProjectOptions and thread editor mode and CSS through the initializer state model so options include editor mode and CSS content (scripts/initializr/common/src/main/java/com/codename1/initializr/model/ProjectOptions.java).
  • Extend the Theme Customization panel in the Initializr UI to present an Editor toggle (SIMPLE / ADVANCED), keep existing controls in simple mode, and show a multiline CSS TextArea with a starter stylesheet in advanced mode (scripts/initializr/common/src/main/java/com/codename1/initializr/Initializr.java).
  • Wire the live preview to compile and apply the user CSS at preview time by resetting the base theme and compiling the CSS with CSSThemeCompiler into a MutableResource, then merging parsed theme props into UIManager with addThemeProps so changes are reflected in the preview (scripts/initializr/common/src/main/java/com/codename1/initializr/ui/TemplatePreviewPanel.java).

Testing

  • Tried cd scripts/initializr && ./mvnw -pl common test -DskipTests=false which failed in this environment due to network error while the Maven wrapper attempted to download the Maven distribution (java.net.SocketException: Network is unreachable).
  • Tried offline compile with system Maven: cd scripts/initializr && mvn -pl common -DskipTests compile -o which failed because required plugin artifacts were not available in the local cache (missing maven-antrun-plugin:3.1.0).
  • Attempted an automated UI screenshot via Playwright to validate the running Initializr preview, but there was no local server responding at http://localhost:8080 so the screenshot attempt returned net::ERR_EMPTY_RESPONSE.

Codex Task

@github-actions
Copy link

Cloudflare Preview

@shai-almog shai-almog closed this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant