Skip to main content

Overview

Uniwind provides device-specific CSS functions that automatically adapt to platform characteristics. These functions help you create responsive styles that work seamlessly across different devices and screen densities.
CSS functions must be defined as utilities in your global.css file before use. You cannot use them directly in className props with arbitrary values.

Available Functions

hairlineWidth()

Returns the thinnest line width that can be displayed on the device. Perfect for creating subtle borders and dividers. Define in global.css
Usage Example

fontScale()

Multiplies a base font size by the device’s font scale setting (accessibility setting). This ensures your text respects user preferences for larger or smaller text. Define in global.css
You can pass a numeric argument directly to fontScale() instead of wrapping it in calc():
Usage Example

pixelRatio()

Multiplies a value by the device’s pixel ratio. Useful for creating pixel-perfect designs that scale appropriately across different screen densities. Define in global.css
You can pass a numeric argument directly to pixelRatio() instead of wrapping it in calc():
Usage Example

light-dark()

Returns different values based on the current theme mode (light or dark). This function automatically adapts when the theme changes, making it perfect for creating theme-aware styles without manual theme switching logic. Define in global.css
Usage Example
The light-dark() function is particularly useful for maintaining color consistency across themes without needing separate CSS variables for each theme.

CSS Parser

Learn about CSS variable support and custom CSS classes

Theming

Combine with themes for powerful styling