LiveStyle.ShorthandBehavior.AcceptShorthands (LiveStyle v0.12.0)
View SourceKeeps shorthand properties intact with nil resets for longhands.
This is the default behavior. Shorthand properties are preserved,
but conflicting longhand properties are reset to nil to ensure
deterministic cascade behavior.
How It Works
When you use a shorthand like margin: "10px", this behavior:
- Keeps the shorthand as the main value
- Returns the shorthand without nil resets (nils are filtered out)
This ensures that later longhands properly override earlier shorthands through CSS cascade, while keeping the output minimal.
Example
iex> AcceptShorthands.expand_declaration("margin", "10px")
[{"margin", "10px"}]Data-Driven Expansions
Expansion mappings are loaded at compile time from data/keep_shorthands_expansions.txt.
This data defines which properties are related to each shorthand and need nil resets
for cascade control.