Browse docs

Enhancements

Progressive enhancement features gated behind @supports. The framework works without them; they add polish where the browser supports them.

Open full example →
On this page
  1. interpolate-size: allow-keywords
  2. Sticky shell shadow
  3. text-box optical alignment
  4. Grid dividers
  5. Typed attr() swatch
  6. Elastic IDE Form Controls (field-sizing: content)
  7. Anchor-Tethered Visibility & Space Maximization (position-visibility & position-try-order)
  8. Pure-CSS Dynamic Stagger (sibling-index() & sibling-count())
  9. Reading Flow Reconciliation (reading-flow)
  10. Intrinsic Math (calc-size())
  11. Batch View Transition Classes (view-transition-class)
  12. Native Grid Masonry (experimental.css)
  13. Checking browser support

Porchlight includes a set of progressive enhancement features that activate only where the browser supports them. Enhancement rules are gated behind @supports. Unsupported browsers skip them; application-owned demo wrappers still need their own base layout and fallback appearance. Browser feature gates do not protect against a bundler that cannot parse the enclosed CSS.

interpolate-size: allow-keywords

Allows height and width to animate to and from auto and content keywords. This enables smooth expand/collapse animations on accordion panels, detail rows, and other auto-sized elements without JavaScript measurement.

The accordion sets this property on its own panel where supported, so it does not change size transitions elsewhere in the host app. Its panel uses a grid-template-rows fallback when unavailable. The accordion enhancement is included in both the full and compatibility bundles.

Sticky shell shadow

The .pl-c-sticky-shell__bar queries its own sticky state and gains a shadow only while stuck. Its decorative pseudo-element responds to the query; the non-sticky wrapper is not the query container. Keep the bar inside a wrapper that also contains enough content to scroll:

<div class="pl-c-sticky-shell">
  <header class="pl-c-sticky-shell__bar">Activity</header>
  <div><!-- Scrollable content --></div>
</div>

The app owns wrapper dimensions, overflow, and bar padding. Set --pl-c-sticky-shell-offset on the bar when another fixed header needs space. For selective imports, load components/scroll-region.css as well as core and enhancements.css; the base component provides sticky positioning and a persistent border even without scroll-state support. compat.css includes this fallback. The full bundle includes both. For overflow-edge indicators and sticky table separators, see Scroll Region.

text-box optical alignment

Buttons, badges, and the dialog close button trim the cap-height half-leading via text-box: trim-both cap alphabetic. This removes the ~1px inline-box overshoot that makes single-line labels appear slightly off-center. The effect is subtle but improves the precision of control alignment.

No action needed from you; this applies automatically to the listed components where supported.

Grid dividers

Draw vertical dividers between grid items, rendered purely within the gap (the gap width is preserved). Enable with data-dividers="true" on any .pl-l-grid:

<div class="pl-l-grid" data-dividers="true">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</div>

Uses the CSS Gap Decorations properties (rule and rule-visibility-items). Unsupported browsers render a normal grid gap with no divider line.

Typed attr() swatch

A color chip that reads its color value directly from a data-color attribute, type-checked as <color>. Eliminates the need for inline style="background: ..." on static color chips:

<span class="pl-c-swatch" data-color="oklch(58% 0.18 260deg)"></span>

Where typed attr() is supported, a missing attribute uses the border color token. Where unsupported, no swatch background is supplied by this rule. Define the swatch’s dimensions/display and an unsupported-browser fallback in your app CSS; the preview’s square geometry is docs-only styling.

Elastic IDE Form Controls (field-sizing: content)

Inputs and query builder tokens automatically expand and shrink to fit their typed content with zero JavaScript measurement. Supported natively on .pl-c-filter-builder__input, .pl-c-tag-input__input, and any input with data-elastic="true".

<input
  type="text"
  class="pl-c-filter-builder__input"
  data-elastic="true"
  value="production-cluster-09"
/>

Anchor-Tethered Visibility & Space Maximization (position-visibility & position-try-order)

Popovers, tooltips, and floating inspection brackets automatically adapt to viewport boundaries using native anchor positioning enhancements:

  • position-visibility: anchor-visible: Automatically conceals the overlay when its anchor element scrolls outside viewport bounds, preventing orphan floating artifacts.
  • position-try-order: most-block-size: Instructs the layout engine to evaluate position fallbacks and pick the one providing the largest vertical block-size, maximizing visible menu rows in cramped viewports.

Chrome 157 renamed the position-visibility values from anchors-visible to anchor-visible (and anchors-valid to anchor-valid). The enhancement layer uses the current value and keeps a gated fallback for Chromium 125-156. Firefox does not implement position-visibility yet, so the block remains opt-in.

Pure-CSS Dynamic Stagger (sibling-index() & sibling-count())

Children of containers marked with [data-stagger] dynamically compute their animation delays using CSS Values & Units Level 5 functions without JavaScript or rigid :nth-child loops:

<div class="pl-l-grid" data-stagger="true">
  <div class="pl-c-card">Card 1</div>
  <div class="pl-c-card">Card 2</div>
  <div class="pl-c-card">Card 3</div>
</div>

The base delay formula calculates: calc(var(--pl-stagger-base, 0ms) + (sibling-index() - 1) * var(--pl-stagger-step, 35ms)). Use data-stagger="reverse" to stagger from bottom to top using sibling-count().

Reading Flow Reconciliation (reading-flow)

Reconciles visual grid or flex layout order with keyboard sequential navigation (Tab order) and assistive technology reading paths:

  • .pl-l-grid[data-reading-flow="rows"] (or [data-reading-flow]): Navigates cell-by-cell along visual horizontal rows.
  • .pl-l-grid[data-reading-flow="columns"]: Navigates column-by-column along visual tracks.
  • .pl-l-cluster[data-reading-flow="visual"]: Navigates in visual order across wrapped flex lines.
  • .pl-c-workflow-board__lanes: Seamlessly aligns navigation direction with horizontal board scrolling vs stacked lane rows.

Intrinsic Math (calc-size())

Enables mathematical expressions on intrinsic sizing keywords alongside interpolate-size: allow-keywords:

<div class="pl-c-banner" data-calc-size="intrinsic">
  <!-- Smoothly interpolates and sizes to content + offset -->
</div>

Batch View Transition Classes (view-transition-class)

Applies uniform view transition motion across multiple elements without per-element name enumeration:

::view-transition-group(*.pl-c-card) {
  animation-duration: var(--pl-duration-enter);
}

Components with [data-transition] (such as .pl-c-card and .pl-c-workflow-card) automatically bind to view-transition-class: pl-c-card.

Native Grid Masonry (experimental.css)

For bleeding-edge runtimes supporting CSS Grid Level 3 Masonry (grid-template-rows: masonry), .pl-l-grid[data-masonry="true"] automatically packs cards into gapless columns without multi-column DOM partitioning.

Checking browser support

Each feature degrades independently. To see which enhancements are active in your browser, open the enhancements preview page. For a full breakdown of which features are required vs progressive vs experimental, see the Browser Support guide.

Search Porchlight