Skip to content

Theming

Fluix uses CSS custom properties for theming. Override them in your stylesheet to match your brand.

PropertyDefaultDescription
--fluix-height40pxToast collapsed height
--fluix-width350pxToast max width
PropertyDefaultDescription
--fluix-duration600msAnimation duration

All colors use the OKLCH color space for perceptual uniformity.

PropertyDefaultDescription
--fluix-state-successoklch(0.723 0.219 142.136)Success state color (green)
--fluix-state-loadingoklch(0.556 0 0)Loading state color (gray)
--fluix-state-erroroklch(0.637 0.237 25.331)Error state color (red)
--fluix-state-warningoklch(0.795 0.184 86.047)Warning state color (amber)
--fluix-state-infooklch(0.685 0.169 237.323)Info state color (blue)
--fluix-state-actionoklch(0.623 0.214 259.815)Action state color (indigo)
:root {
--fluix-state-success: #22c55e;
--fluix-state-error: #ef4444;
--fluix-state-warning: #f59e0b;
--fluix-state-info: #3b82f6;
}

Override theme and fill per toast via the options:

fluix.success({
title: "Custom toast",
theme: "dark", // "light" or "dark"
fill: "#1a1a2e", // Background color
roundness: 20, // Border radius / blur
});

Add CSS classes to toast sub-elements:

fluix.success({
title: "Styled toast",
styles: {
title: "my-title",
description: "my-desc",
badge: "my-badge",
button: "my-button",
},
});

These classes are additive — they don’t replace the default data-attribute styles.

Fluix respects prefers-reduced-motion: reduce. When enabled, spring animations are replaced with simple opacity transitions.

@media (prefers-reduced-motion: reduce) {
[data-fluix-toast] {
transition-duration: 0ms;
}
}