Skip to content

CSS

Checked against c430ebe on 2026-11-10. The files it covers are unchanged since.

niso’s CSS is the web’s, resolved by Servo’s style engine (stylo) and laid out by blitz and Taffy. What a stylesheet can use is in the support table. This page lists what niso adds.

Custom properties for the platform’s colors, type scale, corner radii and safe areas, each taking the platform’s own value and falling back to a web value. A page gets them with the niso-platform-style meta:

From crates/niso-core/ua/niso.css, read when this site was built.

TokenApple platformsAndroidWeb fallback
--niso-color-text--apple-system-label--md-sys-color-on-surfacelight-dark(#000000, #ffffff)
--niso-color-text-secondary--apple-system-secondary-label--md-sys-color-on-surface-variantlight-dark(#3c3c4399, #ebebf599)
--niso-color-accent--apple-system-tint--md-sys-color-primarylight-dark(#0066cc, #4da3ff)
--niso-color-on-accent--md-sys-color-on-primary#ffffff
--niso-color-link--apple-system-link--md-sys-color-primarylight-dark(#0066cc, #4da3ff)
--niso-color-background--apple-system-background--md-sys-color-surfacelight-dark(#ffffff, #000000)
--niso-color-grouped-background--apple-system-grouped-background--md-sys-color-surface-container-lowlight-dark(#f2f2f7, #000000)
--niso-color-surface--apple-system-secondary-grouped-background--md-sys-color-surface-container-highlight-dark(#ffffff, #1c1c1e)
--niso-color-fill--apple-system-tertiary-fill--md-sys-color-secondary-containerlight-dark(#7676801f, #7676803d)
--niso-color-separator--apple-system-separator--md-sys-color-outline-variantlight-dark(#3c3c434a, #54545899)
--niso-font-large-title--apple-system-large-title--md-sys-typescale-display-small400 34px/41px system-ui
--niso-font-title1--apple-system-title1--md-sys-typescale-headline-small400 28px/34px system-ui
--niso-font-title2--apple-system-title2--md-sys-typescale-title-large400 22px/28px system-ui
--niso-font-title3--apple-system-title3--md-sys-typescale-title-large400 20px/25px system-ui
--niso-font-headline--apple-system-headline--md-sys-typescale-title-medium600 17px/22px system-ui
--niso-font-body--apple-system-body--md-sys-typescale-body-large400 17px/22px system-ui
--niso-font-subheadline--apple-system-subheadline--md-sys-typescale-body-medium400 15px/20px system-ui
--niso-font-footnote--apple-system-footnote--md-sys-typescale-body-small400 13px/18px system-ui
--niso-font-caption--apple-system-caption1--md-sys-typescale-body-small400 12px/16px system-ui
--niso-font-label--apple-system-subheadline--md-sys-typescale-label-large400 15px/20px system-ui
--niso-tracking-large-title--md-sys-typescale-display-small-trackingnormal
--niso-tracking-title1--md-sys-typescale-headline-small-trackingnormal
--niso-tracking-title2--md-sys-typescale-title-large-trackingnormal
--niso-tracking-title3--md-sys-typescale-title-large-trackingnormal
--niso-tracking-headline--md-sys-typescale-title-medium-trackingnormal
--niso-tracking-body--md-sys-typescale-body-large-trackingnormal
--niso-tracking-subheadline--md-sys-typescale-body-medium-trackingnormal
--niso-tracking-footnote--md-sys-typescale-body-small-trackingnormal
--niso-tracking-caption--md-sys-typescale-body-small-trackingnormal
--niso-tracking-label--md-sys-typescale-label-large-trackingnormal
--niso-corner-small--md-sys-shape-corner-small8px
--niso-corner-medium--md-sys-shape-corner-medium12px
--niso-corner-large--md-sys-shape-corner-large16px
--niso-corner-extra-large--md-sys-shape-corner-extra-large28px
--niso-safe-topmax(env(safe-area-inset-top), var(--niso-safe-area-inset-top, 0px))
--niso-safe-rightmax(env(safe-area-inset-right), var(--niso-safe-area-inset-right, 0px))
--niso-safe-bottommax(env(safe-area-inset-bottom), var(--niso-safe-area-inset-bottom, 0px))
--niso-safe-leftmax(env(safe-area-inset-left), var(--niso-safe-area-inset-left, 0px))

Under the tokens, hosts publish the platform’s own values: --apple-system-* on Apple platforms (UIKit’s semantic colors and text styles, named after WebKit’s), --md-sys-* on Android (Material 3’s color and type tokens), and --niso-safe-area-inset-* for the safe area. Use the --niso-* tokens unless you want one platform’s value specifically. Platform style has the details.

A control that niso draws natively (switch, slider, progress bar, button, text field, radio group) is native while appearance is auto, the default. appearance: none makes it a plain CSS box you style yourself (Native controls).

  • No platform media queries (@media (platform: ios) and the like) and no prefixed properties: neither is implemented.
  • env(safe-area-inset-*) is always 0; use --niso-safe-*.
  • prefers-contrast, prefers-reduced-motion and prefers-reduced-transparency never match (System settings).