UI kit
In Frame, a UI kit is everything the editor offers that comes from your theme: the design tokens, the components, the features editors may use on them, and the widths of the page. Frame has no look of its own. Bring a kit, and editors build pages from it; change the kit, and every page follows.
A kit lives in a subtheme of the Frame theme. Frame reads it from the active theme and its base themes, so a subtheme changes only what differs.
| Part | Where | Is |
|---|---|---|
| Tokens | frame_editor: uikit: in the theme's .info.yml | the spacing scale, type scale, sizes, palette, border widths, radii, image styles: the only values editors can pick |
| Layout widths | frame_editor: uikit: layout: | the content width of a page and the wide width, for the Width feature |
| Features | frame_editor: features:, and thirdPartySettings.frame_editor.features of a component | which sections of Layout and style editors get, per theme and per component |
| Components | components/ of the theme | Single Directory Components: each is a block of the editor, its props are fields, its slots take other components |
| Breakpoints | <theme>.breakpoints.yml | the widths of the preview, and the breakpoints at which layout and style can differ |
| CSS | the theme's libraries and the CSS of each component | the look; the same on the page and on the canvas |
The pages of this section
| Page | About |
|---|---|
| Design tokens | map the tokens of your design to Frame, and use them in SCSS |
| Icons | icon packs of Drupal's Icon API (<theme>.icons.yml) and icon fonts for icon props |
| Your components | bring your own components: groups, replacing the base theme's, features per component |
| Settings reference | every key of frame_editor in the .info.yml, with its default |
| A CSS framework | wire components built on Bootstrap, Tailwind or another framework |
| Scripts, web components and theme files | behaviors for scripts that run at page load, custom elements in a template, files of the theme in Twig, the prop variant, rich text and its text format |
| Test your kit | check that the kit works in the editor and on the page |
The details behind them: Tokens, features and styling and Components for the editor.
In short
- Make a subtheme of the Frame theme (Create a subtheme). The starterkit writes a
frame_editor:block with default tokens into its.info.yml. - Put the values of your design into that block: spacing, type scale, palette, sizes, borders, radii.
- Add your components to
components/of the theme. A component prints{{ attributes }}on its root element, so the features reach it. - Switch off features where a component draws its own:
thirdPartySettings.frame_editor.features. drush cr, open a page in the editor, and test.
Limitations
- Only components of the active theme and its base themes are offered. Components of modules are not: wrap one in a component of your theme if editors need it.
- Components with
status: obsoleteare not offered;noUi: truehides one entirely. - A scale or a palette is replaced as a whole by a subtheme, not merged by name.
- Editors cannot type a colour or CSS: what the kit does not declare cannot be chosen.
- The editor runs in a page of your theme, so very broad global rules (
button,label,*) also reach its controls.