Monsoon v0.2.0
Made by Alexandre Kohler Star

Getting started

Browser support

Monsoon targets the current versions of Chrome, Edge, Firefox and Safari. The full seed theme needs OKLCH relative color syntax, available in Chrome and Edge 119, Firefox 128 and Safari 18 or newer. Older browsers still get a readable page.

3 min read

The short version

  • Current browsers: everything works, including seed theming, dark mode, container queries and the components.
  • Browsers without relative color syntax: a static theme computed from the default seed, with primary and ring set to your seed. Light and dark mode still switch.
  • Browsers without container queries: the @xs: to @xl: classes are ignored and the unprefixed layout is used.
  • No JavaScript, no polyfills: Monsoon is plain CSS, so there is nothing to load or patch at runtime.

Features the utilities rely on

These are the modern CSS features found in the utility and theme rules, with the first browser versions that support them:

FeatureUsed forChrome / EdgeFirefoxSafari
Relative colors, oklch(from ...)deriving every token from --seed11912818
oklch() colorsthe palette and the tokens11111315.4
color-mix()opacity modifiers such as bg-primary/9011111316.2
Container queries@container and @xs: to @xl:10511016
Cascade layers, @layerthe reset, so your CSS wins without tricks999715.4
:is() and :where()the dark: variant, space-*, divide-*, section paint887814
Logical propertiespx-*, py-*, mx-auto, space-y-*876614.1
Individual transformsscale-*, rotate-*, translate-* as separate properties1047214.1
dvh and svh unitsh-dvh, min-h-dvh and friends10810115.4
text-wrap: balancetext-balance11412117.5

Utilities that use a newer property, such as text-balance, simply have no effect in a browser that does not know it. The rest of the rule set is unaffected.

Progressive enhancements

Some rules improve the result where a browser supports them and fall back to a plain but correct result elsewhere:

FeatureUsed forWithout it
@scopean exact dark: variant at any nesting depth (Chrome and Edge 118, Safari 17.4, recent Firefox)dark: uses selectors only. Exact except for dark inside light inside dark.
:has()component states such as rating stars, checkbox cards and field validation (Chrome 105, Firefox 121, Safari 15.4)Those components lose the state styling that depends on it.
The popover attributepopovers and dropdowns that open with popover (Chrome 114, Firefox 125, Safari 17)Use the dropdown built on details or focus instead, which works everywhere.
@starting-styleentry animations of popovers, modals, drawers and sheetsThey open without the animation.
Anchor positioningplacing popovers next to their trigger, inside @supportsPopovers are centered in the viewport.
Scroll driven animationsrevealing the back to top button, inside @supportsThe button is always visible.
field-sizing: contenttextarea-autosizeA regular resizable textarea.
::details-content and interpolate-sizeanimated collapse and accordion panelsPanels open instantly.

Check the page of each component for its own notes.

Without relative color syntax

Seed theming computes colors in the browser, which needs relative color syntax. For browsers without it, the stylesheet ships a static theme inside @supports not (color: oklch(from red l c h)):

  • every token gets a fixed value computed from the default seed,
  • primary and ring use your --seed directly, so your brand color still shows,
  • tokens whose lightness only depends on the scheme (background, foreground, surfaces, muted, border, secondary and the status colors) still switch between light and dark,
  • foregrounds are fixed for the default seed, so primary-foreground stays white.

With a dark or saturated seed that is fine. With a very light seed, such as yellow, white text on the primary color would be hard to read, so set a foreground for those browsers yourself:

theme.css
@supports not (color: oklch(from red l c h)) {
  :root {
    --primary-foreground: #1c1917;
  }
}

How to check

Paste this into the console of any browser to see which features it has:

console
console.table({
  'relative colors': CSS.supports('color', 'oklch(from red l c h)'),
  'oklch': CSS.supports('color', 'oklch(0.5 0.1 200)'),
  'color-mix': CSS.supports('color', 'color-mix(in oklab, red, blue)'),
  'container queries': CSS.supports('container-type', 'inline-size'),
  ':has()': CSS.supports('selector(:has(a))'),
  '@layer': typeof CSSLayerBlockRule !== 'undefined',
  '@scope': typeof CSSScopeRule !== 'undefined',
});
  1. Open the page in the oldest browser you support and confirm that text, buttons and forms are readable.
  2. In the developer tools, emulate prefers-color-scheme: dark and prefers-reduced-motion: reduce to test the scheme and the motion variants without changing system settings.
  3. Inspect an element and look at the computed value of --primary to see what the browser derived from your seed.
  4. Open the playground in each browser you support and paste a representative piece of your markup to compare the results.

Frequently asked questions

Does Monsoon work in Internet Explorer?

No. It relies on custom properties, modern color functions and cascade layers that Internet Explorer never supported.

What is the minimum for the full seed theme?

Relative color syntax: Chrome and Edge 119, Firefox 128 and Safari 18 or newer.

Is there a JavaScript polyfill?

No, and none is needed for a readable page. Older browsers get the static fallback theme.

No recent searches

Try , , or .

Recent

Loading the search index

No results for ""

Check the spelling, or search a class name such as px-4.