StylePresets final class
Minn\Theme\StylePresets · public/minn/src/Minn/Theme/StylePresets.php · 148 lines
The preset side of theme.json: the colour, gradient, font-size, font-family, spacing, and shadow lists a theme declares over core's own, as the custom properties on :root and the has-* utility classes the reference prints for them. Pure: settings in, CSS fragments out.
Public
| static | presets(array $settings, ?array $core = NULL): array# | Every preset list the theme declares, over core's own (as given, else data/presets.json), keyed by kind. | ||||||
| static | presetList(mixed $presets): array# | A preset list as theme.json writes it is a plain list; as the site editor saves it, it is keyed by origin (default, theme, custom). The reference prints the origins in that order, so the two shapes flatten to one list here. @return list<array> | ||||||
| static | fontFamilies(array $settings): array# | The font family presets in the settings. @return list<array> | ||||||
| static | presetProperties(array $presets): string# | The presets as custom properties for :root. | ||||||
| static | customProperties(array $custom, string $prefix = '--wp--custom--'): string# | A settings.custom tree as custom properties: --wp--custom-- and the path to each value, every key in kebab case, lists by index; empty values are left out.
| ||||||
| static | presetClasses(array $presets, string $prefix = ''): string# | The has-* utility classes the presets give every colour, gradient, font size, and font family; each under the prefix given (a block's :where(selector)). | ||||||
| static | defaultSlugsFirst(array $presets, array $defaults): array# | A theme size that reuses one of core's slugs prints in core's position; the theme's own slugs follow.
@return list<array> | ||||||
| static | spacingPresets(array $defaults, array $own): array# | The default spacing scale (20 to 80) is always present, whatever defaultSpacingSizes says; a theme size with the same slug replaces the default in place, and the theme's other sizes follow the scale. @return list<array{slug: string, value: string}> | ||||||
| static | fluidFontSize(array $preset, array $settings): string# | A font size preset as the global stylesheet writes it: fluid by the theme's settings (Typography::fontSize). |
Nothing matches.