Skip to content

Support side border shorthands in CSSBorder#4966

Merged
shai-almog merged 2 commits into
codenameone:masterfrom
jsfan3:fix-cssborder-side-shorthands
May 16, 2026
Merged

Support side border shorthands in CSSBorder#4966
shai-almog merged 2 commits into
codenameone:masterfrom
jsfan3:fix-cssborder-side-shorthands

Conversation

@jsfan3
Copy link
Copy Markdown
Contributor

@jsfan3 jsfan3 commented May 16, 2026

This adds support for side-specific CSS border shorthands in CSSBorder.

Context: the Initializr template CSS uses declarations such as:

SideCommand {
    border-bottom: 2px solid #cccccc;
}

This is accepted by the regular Designer/Maven CSS compiler, but the lightweight CSSThemeCompiler paths used by Initializr preview / agent validation eventually pass this declaration to CSSBorder, where it fails with:

Unsupported CSS property: border-bottom

The issue is that CSSBorder supported general border properties such as border-width, border-style, and border-color, but not side-specific shorthand properties like:

  • border-top
  • border-right
  • border-bottom
  • border-left

This PR adds support for those side-specific border shorthands, plus the corresponding side-specific longhands such as border-bottom-width, border-bottom-style, and border-bottom-color.

I also added a regression test covering:

SideCommand {
    border: none;
    border-bottom: 2px solid #cccccc;
}

Verification:

mvn -DunitTests -pl core-unittests -am -Dtest=CSSThemeCompilerTest -DfailIfNoTests=false test
mvn -DunitTests -pl core-unittests -am -Dtest=CSSBorderTest,BorderAndPlafTest -DfailIfNoTests=false test

Results:

  • CSSThemeCompilerTest: 5 tests, 0 failures, 0 errors
  • CSSBorderTest + BorderAndPlafTest: 18 tests, 0 failures, 0 errors

jsfan3 and others added 2 commits May 16, 2026 15:05
Removes the non-spec border-width-<side>/border-style-<side>/
border-color-<side> aliases (CSS only defines border-<side>-width
etc.), wraps borderSide() in the same try/catch + Log.e pattern
used by borderStyle(), and adds a longhand-decorator regression test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog shai-almog merged commit 6e0eff9 into codenameone:master May 16, 2026
14 of 15 checks passed
@shai-almog
Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants