Styles final class
Minn\Blocks\Styles · public/minn/src/Minn/Blocks/Styles.php · 155 lines
The inline style and class names a block's "style" and preset attributes produce at render time, for the dynamic blocks that build their own wrapper (static blocks already carry them in stored markup).
Constants and properties
| private | SIDES = array ( 0 => 'top', 1 => 'right', 2 => 'bottom', 3 => 'left', ) |
Public
| static | value(string $value): string# | var:preset|spacing|40 becomes var(--wp--preset--spacing--40). A value that could close a declaration or a style element, or carry code, is dropped: these values come from stored block attributes. |
| static | slug(string $value): string# | A class-name token from an attribute: letters, digits, dashes, underscores; nothing that ends an attribute. |
| static | inline(array $style): string# | The style attribute's declarations. The reference emits the style groups in a fixed order (border, colour, typography, spacing, dimensions) and most properties in a fixed order within a group, but a spacing box's sides come out as the block stored them. |
| static | classes(array $attrs): array# | The preset classes (font size, text alignment, custom class names) a block's attributes declare. |
| static | align(array $attrs): ?string# | The align class an "align" attribute declares. |
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | borderDeclarations(array $border, array $declarations): void# |
| |||
| private | colorDeclarations(array $color, array $declarations): void# |
| |||
| private | spacingDeclarations(array $spacing, array $declarations): void# |
| |||
| private | typographyDeclarations(array $typography, array $declarations): void# |
| |||
| private | dimensionDeclarations(array $dimensions, array $declarations): void# |
|
Nothing matches.