States final class
Minn\Blocks\States · public/minn/src/Minn/Blocks/States.php · 160 lines
Block state styles (a block's style[":hover"] and the like, probe block-supports): the selector arithmetic and the fallbacks the reference applies when it writes a state's rules. Pure: styles and selectors in, styles, groups and declarations out.
Constants and properties
| private | SIDES = array ( 0 => 'top', 1 => 'right', 2 => 'bottom', 3 => 'left', ) |
Public
| static | split(string $selector): array# | A selector list split at its top-level commas (none inside parentheses counts), each part as written. @return list<string> | ||||||
| static | selector(string $base, string $selectors, string $state): string# | A state on each selector of a block's list, its leading compound selector swapped for the base; the base alone for an empty list. | ||||||
| static | presetVars(mixed $value): mixed# | Presets (var:preset|{kind}|{slug}) as their custom properties, through arrays; anything else as it is. | ||||||
| static | backgroundResets(array $declarations): array# | Declarations with a background image unset under a background colour that sets neither a background nor an image of its own.
@return array<string, string> | ||||||
| static | borderFallbacks(array $declarations): array# | Declarations with a solid border style for a border (or a side of one) given a width or a colour and no style.
@return array<string, string> | ||||||
| static | dimensionFallbacks(array $style): array# | A state's style with an explicit aspect ratio unsetting the height and minimum height, or a height or minimum height unsetting the aspect ratio.
@return array<string, mixed> | ||||||
| static | groups(array $style, array $selectors): array# | A state's style split by the selectors a block gives its features: a feature (or one of its properties) with a selector of its own goes there, a feature's other properties to its root selector, the rest to the block's root. Groups keep the order they are first met in.
@return list<array{selector: ?string, style: array<string, mixed>}> | ||||||
| static | addGroup(array $groups, ?string $selector, array $style): void# | Adds a style to the group of a selector, merged into what it holds.
|
Nothing matches.