Compatibility

Hygular uses modern CSS and browser APIs. Test the compiled stylesheet and the components you use in your application's target browsers. The beta test suite exercises Chromium, Firefox, and WebKit; it does not establish a minimum supported version for every browser or device.

CSS requirements

The stylesheet uses cascade layers, custom properties, logical properties, Grid, Flexbox, :has(), OKLCH colors, relative color syntax, and color-mix(). Support for a basic OKLCH value does not imply support for relative colors such as oklch(from var(--primary) calc(l - 0.04) c h).

Use the distributed CSS through the package export:

import '@hygular/core/css';

@hygular/core/css/source exports the unminified distributed stylesheet. Neither export is a general-purpose compatibility layer.

Runtime requirements

The runtime uses browser APIs including CustomEvent, MutationObserver, IntersectionObserver, and component-specific layout observers. Components that submit forms also use fetch. Check the features needed by the components you enable, particularly in embedded browsers.

Server rendering

The module entry points can be imported without browser globals. DOM initialization belongs on the client, after the markup is mounted. React hooks perform DOM setup in effects and release their listeners or instances during cleanup.

Import React hooks from @hygular/core/react. In an application that distinguishes server and client components, place interactive hook usage in a client component.

Fallbacks

Build-time transformations cannot guarantee that every dynamic color expression or selector works in an older browser. Inspect the resulting CSS and test the actual interaction before adding that browser to your support policy.

When a token needs a fallback, use a feature query rather than assuming that two custom-property declarations will detect support for the color stored inside them:

:root {
  --selection: rgba(37, 99, 235, 0.24);
}

@supports (color: oklch(from red l c h)) {
  :root {
    --selection: oklch(from var(--primary) 0.88 calc(c * 0.85) h / 0.24);
  }
}

Load application overrides after the framework stylesheet. This example addresses one token; it does not provide compatibility for the rest of the framework.

Hygular