BlimpKit UI primer
The IDE chrome - sidebars, dialogs, tabs, menus, toolbars, forms - renders through BlimpKit, a thin AngularJS-on-Fundamental-Styles component library. Module name blimpKit (camelCase). Bundle path: /webjars/blimpkit__blimpkit/dist/blimpkit.min.js.
Read this once before writing a custom perspective, view, or editor.
The five immutable rules
Perspective icons have no internal padding. The SVG content extends to the edges of the
viewBox. The BlimpKit icon slot draws its own spacing.No em-dashes. Use the standard hyphen-minus only. Sweep copied text before saving.
Custom CSS classes only when there is no other option. Reach for, in order:
- A BlimpKit utility class (
bk-text--subtitle,bk-font--small,bk-vbox,bk-box--gap,bk-padding--tiny). - A Fundamental-Styles class (
fd-*). - A custom class scoped to the view - only if 1 and 2 don't express what you need.
- A BlimpKit utility class (
Never hard-code colors. Prefer BlimpKit variables over SAP-legacy ones. Lookup order:
- A BlimpKit utility class that maps to a theme variable (
bk-color--negative,bk-color--positive,bk-color--critical,bk-color--informative). - A BlimpKit theme variable (
var(--negative),var(--positive),var(--warning),var(--information),var(--background),var(--foreground),var(--muted),var(--accent),var(--border),var(--card),var(--font-sans),var(--font-mono), ...). - A
--sap*legacy variable, only when nothing above matches. These are being phased out.
- A BlimpKit utility class that maps to a theme variable (
Use BlimpKit components instead of building view-local equivalents. A
<div class="my-tile">shell with custom CSS is the canonical anti-pattern -bk-card,bk-object-status,bk-progress-indicator,bk-list,bk-message-page,bk-popoveralmost certainly already cover the need.For dialogs, use
DialogHub. Never put<bk-dialog>markup in a view. Every view holds anew DialogHub()instance and callsDialogs.showAlert(...)/Dialogs.showDialog(...)/Dialogs.showFormDialog(...)/Dialogs.showWindow(...)/Dialogs.showBusyDialog(...).
Gotchas
<bk-checkbox>is invisible without<bk-checkbox-label>. Pair them:<bk-checkbox id="x" ng-model="...">followed by<bk-checkbox-label for="x" empty="true">...</bk-checkbox-label>.<bk-dialog>has an isolate scope. Can't putng-controller=on the dialog element. Wrap with a thin<div ng-controller="...">and put<bk-dialog visible="...">inside.<bk-select>doesn't supportng-options. Use<bk-option ng-repeat>. For selects in dialogs / sidebars adddropdown-fixed="true"so the menu floats viaposition:fixed.<bk-option>textis interpolation ('@'),valueis one-way ('<'). Usetextwith double-curly interpolation around an expression (e.g. opt.name) andvalue="opt.id". Mixing them up is the canonical bug for this directive.Perspective SVG icons inherit
fillfrom CSS - don't hard-codefillon the path. Strip thefillattribute or usefill="currentColor".<bk-input>/<bk-textarea>/<bk-button>usereplace:true. The attributes you write on the directive (ng-model,ng-blur, custom directives) end up on the underlying native element.Don't put
ng-classon areplace:truedirective element that already has its ownng-class. Angular string-concatenates them and the parser throws. Push the conditional class onto a child element instead.<meta name="platform-links" category="...">auto-injects scripts + stylesheets. Categories:ng-view,ng-perspective,ng-editor(defined incomponents/engine/engine-web/src/main/resources/platform-links.json). Add platform-wide UI dependencies there, not to every perspective HTML.SAP-icons + the 72 body font live in platform-core's
fonts.css. Every BlimpKit-using page needs<link rel="stylesheet" href="/services/web/platform-core/ui/styles/fonts.css">. The shell loads it automatically; standalone iframes need to add it.<bk-dialog>toggles visibility via thevisiblebinding. Flipscope.modal.visible = falseinside an$apply. Allow ~300 ms for the close animation before tearing down the scope.