Skip to content
phantom-ui v0.10.1

CSS Custom Properties

You can override the shimmer appearance globally or per-instance using CSS custom properties. These work in addition to (or instead of) the HTML attributes.

PropertyDefaultDescription
--shimmer-colorrgba(128, 128, 128, 0.3)Gradient sweep color
--shimmer-duration1.5sAnimation cycle
--shimmer-bgrgba(128, 128, 128, 0.2)Block background
--reveal-duration0sFade-out transition when loading ends
phantom-ui {
--shimmer-color: rgba(100, 200, 255, 0.3);
--shimmer-duration: 2s;
--shimmer-bg: rgba(100, 200, 255, 0.08);
}
.hero-section phantom-ui {
--shimmer-duration: 2.5s;
}
.sidebar phantom-ui {
--shimmer-bg: rgba(255, 255, 255, 0.12);
}

The defaults use neutral grays that work on both light and dark backgrounds. Override them to match your design system:

/* Dark theme */
.dark phantom-ui {
--shimmer-color: rgba(255, 255, 255, 0.3);
--shimmer-bg: rgba(255, 255, 255, 0.08);
}
/* Light theme */
.light phantom-ui {
--shimmer-color: rgba(0, 0, 0, 0.08);
--shimmer-bg: rgba(0, 0, 0, 0.06);
}