Release 0.1.0 - Advanced Anchor Positioning & Fallbacks
This release introduces support for several advanced CSS Anchor Positioning properties, enabling conditional visibility, fallback strategies, and anchor-based alignment. It also includes an important fix for positional utilities.
✨ New Features
-
Anchor Center Utilities
*-anchor→[property]: anchor-center- Added utilities for centering elements relative to their anchor using
anchor-center. - Includes:
justify-self-anchor(justify-self: anchor-center)self-anchor(align-self: anchor-center)justify-items-anchor(justify-items: anchor-center)items-anchor(align-items: anchor-center)place-items-anchor(place-items: anchor-center)place-self-anchor(place-self: anchor-center)
- Added utilities for centering elements relative to their anchor using
-
Position Visibility
anchored-visible-*→position-visibility: [value]- Control element rendering based on anchor visibility or overflow state (
position-visibility). - Keywords:
anchored-visible-always(position-visibility: always): Element is always visible.anchored-visible-anchor(position-visibility: anchors-visible): Visible only when the anchor element is at least partially visible.anchored-visible-no-overflow(position-visibility: no-overflow): Visible only when the element itself does not overflow the viewport.
- Supports arbitrary values:
anchored-visible-[value]. - (Note:
anchors-validis part of the spec but not yet widely supported or included).
- Control element rendering based on anchor visibility or overflow state (
-
Position Try Order
try-order-*→position-try-order: [value]- Define the order in which fallback positions are attempted (
position-try-order). - Keywords:
try-order-normal(position-try-order: normal): Default order.try-order-w(position-try-order: most-width): Prioritize fallbacks maximizing width.try-order-h(position-try-order: most-height): Prioritize fallbacks maximizing height.
- Supports arbitrary values:
try-order-[value].
- Define the order in which fallback positions are attempted (
-
Position Try Fallbacks
try-*→position-try-fallbacks: [value]:- Define a sequence of fallback positions or strategies (
position-try-fallbacks). - Keywords:
try-none(position-try-fallbacks: none): No fallbacks.try-flip-x(position-try-fallbacks: flip-inline): Flip horizontally.try-flip-y(position-try-fallbacks: flip-block): Flip vertically.try-flip-s(position-try-fallbacks: flip-start): Flip along the writing mode's start direction.
- Supports standard
position-areakeywords (e.g.,try-topappliesposition-try-fallbacks: top,try-bottom-leftappliesposition-try-fallbacks: bottom left) - Supports arbitrary values:
try-[value].
- Define a sequence of fallback positions or strategies (
🐛 Bug Fixes
- Positional Anchor Utilities: Fixed an issue where utilities like
{top|right|bottom|left|inset}-anchor-{side}-{offset?}(e.g.,top-anchor-bottom-4) were incorrectly configured. The offset value is now correctly optional, and the utilities properly map to the theme'sinsetscale values. Usingtop-anchor-bottomnow correctly appliestop: anchor(bottom)without requiring an explicit offset.