| name | ui-theme-designer-design-tokens |
| description | TRIGGER: questions about the SAP Design System and SAP Fiori design tokens — which themes exist, what value a theme parameter (e.g. sapButton_Background, sapHighlightColor) has in a given theme, how parameters inherit/extend across the theme chain, which parameters a specific UI component (UI5 control, UI5 Web Component, Fundamental Styles component) consumes. SKIP: how-to questions about UI theme designer as a product (creating, publishing, transporting themes — use ui-theme-designer-help). |
| allowed-tools | Bash(npm ci) Read WebFetch |
Design Tokens
With $THIS being the folder that contains this SKILL.md:
Prerequisite
$THIS/node_modules/ exists and is not older than 7 days; if not: cd $THIS && npm ci
Context
Design Tokens are defined in LESS files of the theming-base-content, and consumed in LESS and CSS files of different frameworks (= UI technologies). In $THIS/node_modules/ you find the following:
- UI5: (with
$LIBRARY being e.g. sap.ui.core, and $THEME being e.g. sap_horizon)
$THIS/node_modules/@openui5/$LIBRARY/src/${LIBRARY/./\//}/**/themes/base contains the baseTheme of the different libraries
$THIS/node_modules/@openui5/themelib_$THEME/src/${LIBRARY/./\//}/themes/ contains the $THEME of the different libraries
- UI5 Web Components: (with
$THEME being e.g. sap_horizon, and $COMPONENT being e.g. Button)
$THIS/node_modules/@ui5/*/src/themes/$COMPONENT.css contains theme-independent component skeleton CSS, using parameters from theming-base-content as CSS custom properties, as well as CSS custom properties defined in base/ (see below)
$THIS/node_modules/@ui5/*/src/themes/base/$COMPONENT-parameters.css contains CSS custom property definitions for components; never report those UI5 Web Components-specific internal CSS custom properties.
$THIS/node_modules/@ui5/*/src/themes/$THEME/$COMPONENT-parameters.css contains theme-dependent values for the custom property definitions from base/ (see above)
- Fundamental Styles:
$THIS/node_modules/fundamental-styles/dist/*.css contains theme-independent component skeleton CSS, using parameters from theming-base-content as CSS custom properties, as well as CSS custom properties defined in theming/ (see below)
$THIS/node_modules/fundamental-styles/dist/theming/$THEME.css contains theme-dependent values for the custom property definitions used in dist/*.css (see above); never report those Fundamental Styles-specific internal CSS custom properties
$THIS/node_modules/@fundamental-styles/common-css/dist/*.css theme-independent helper CSS, using parameters from theming-base-content as CSS custom properties
- Base: (with
$LIBRARY being e.g. baseLib, and $THEME being e.g. sap_horizon)
$THIS/node_modules/@sap-theming/theming-base-content/content is a theme repository as described in https://raw.githubusercontent.com/SAP-docs/btp-ui-theme-designer/main/docs/cf/About-Themes/overview-of-sap-theming-content-91ebfe2.md, containing Base/; used by all frameworks
$THIS/node_modules/@sap-theming/theming-base-content/content/Base/.theming contains metadata about the Base framework
$THIS/node_modules/@sap-theming/theming-base-content/content/Base/$LIBRARY/.theming contains metadata about libraries
$THIS/node_modules/@sap-theming/theming-base-content/content/Base/$LIBRARY/$THEME/.theming contains metadata about themes
- Metadata includes
sEntity: "Framework", "Library" or "Theme"
sType (for themes): "STANDARD" (= single theme) or "SET" (= no CSS, just references to different themes of sType=STANDARD)
aFiles: LESS source files
aBuildFiles: CSS files built from aFiles
*sBase{Library,Theme,File}Id: ID of the most important library/theme/file
oExtends: the $FRAMEWORK[.$LIBRARY[.$THEME[.$FILE]]] "object path" of the parent entity
sSourcePathPattern: pattern to resolve object paths to file paths
- (optional)
bIgnore=true: entity is ignored from theming
Procedure
- Determine the SAP theme the users question targets, present the available theme IDs from
$THIS/node_modules/@sap-theming/theming-base-content/content/Base/baseLib as select options if unclear, default to sap_horizon
- Determine the framework the user's question targets. Present the frameworks from "Context" as select options if unclear, applying these defaults:
- framework stated: use that
- component stated, no framework:
- search UI5 Web Components for a CSS file for the component; if found use UI5 Web Components as primary source
- additionally search Base for parameters matching
sap$COMPONENT_*: report any such parameters not already referenced in UI5 Web Components as supplementary, labelled "defined in theming-base-content, not yet referenced in UI5 Web Components CSS"
- no component, no framework: use Base
- Read the
.theming file of the framework the users question targets, determine sBaseLibraryId and sSourcePathPattern
- Read the
.theming file of the theme of the sBaseLibrary of the framework the users question targets, based on sSourcePathPattern of the frameworks .theming file
- While there is an
oExtends:
- Read the
.theming file of the theme referenced by oExtends; if you haven't encountered the framework (the first section of the Object Path) before, read the framework .theming first to determine its sSourcePathPattern
- Merge the
.theming JSON with what you already have from the theme .theming files: if a key already exists, leave it untouched; add key+value if the key does not yet exist
- Read the
${sBaseFileId}.less file (sBaseFileId comes from the merged .theming files) of the theme of the sBaseLibrary of the framework the users question targets
- For each LESS
@import statement, recursively:
- Read the referenced LESS file
- Replace the
@import statement with the read content
- In the merged LESS file, map the lines that precede parameter definitions to that parameter: