Skip to content

refactor(builder): libraryLessGenerator: Rewrite svg.less imports - #1488

Merged
matz3 merged 1 commit into
UI5:mainfrom
stopcoder:feat/svg-less-rewrite
Jul 31, 2026
Merged

refactor(builder): libraryLessGenerator: Rewrite svg.less imports#1488
matz3 merged 1 commit into
UI5:mainfrom
stopcoder:feat/svg-less-rewrite

Conversation

@stopcoder

@stopcoder stopcoder commented Jul 28, 2026

Copy link
Copy Markdown
Member

The libraryLessGenerator processor already rewrites base.less imports from the UI5 resource path (sap/ui/core/themes//base.less) to the theming-base-content path (Base/baseLib//base.less) used by the Theme Designer. Extend this to also rewrite svg.less imports to Base/icons//svg.less.

The Theme Designer resolves imports against the theming-base-content structure. When a customer creates a custom theme, icon overrides are stored under Base/icons/<custom_theme>/. The parent theme's library.less must import from the same Base/icons/ path so that custom content layered on top takes effect via LESS "last definition wins" semantics.

Extract a shared rewriteThemeDesignerImport() static method and drive both rewrites from a config array, so adding future rewrites is a one-liner.

JIRA: CPOUI5FRAMEWORK-812

Up-port of SAP/ui5-builder#1223

…LessGenerator

The libraryLessGenerator processor already rewrites base.less imports
from the UI5 resource path (sap/ui/core/themes/<theme>/base.less) to the
theming-base-content path (Base/baseLib/<theme>/base.less) used by the
Theme Designer. Extend this to also rewrite svg.less imports to
Base/icons/<theme>/svg.less.

The Theme Designer resolves imports against the theming-base-content
structure. When a customer creates a custom theme, icon overrides are
stored under Base/icons/<custom_theme>/. The parent theme's library.less
must import from the same Base/icons/ path so that custom content layered
on top takes effect via LESS "last definition wins" semantics.

Extract a shared rewriteThemeDesignerImport() static method and drive
both rewrites from a config array, so adding future rewrites is a
one-liner.
@flovogt
flovogt requested a review from matz3 July 31, 2026 09:17
@matz3 matz3 changed the title feat(builder): Rewrite svg.less imports in libraryLessGenerator feat(builder): libraryLessGenerator: Rewrite svg.less imports Jul 31, 2026
@matz3 matz3 changed the title feat(builder): libraryLessGenerator: Rewrite svg.less imports refactor(builder): libraryLessGenerator: Rewrite svg.less imports Jul 31, 2026
@matz3

matz3 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Merging as refactor, not feat, as this is already part of v4, so there is no point in marking it as a new feature of v5.

@matz3
matz3 merged commit 7f7cfc9 into UI5:main Jul 31, 2026
57 checks passed
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