FSCSS tutorialThere was a time when CSS felt… predictable. Every color was chosen. Every position was fixed. Every...
There was a time when CSS felt… predictable.
Every color was chosen.
Every position was fixed.
Every animation behaved exactly the same—every single time.
Then came FSCSS… and suddenly, randomness became a design tool.
@random() in FSCSS?
The @random() function in Figured Shorthand Cascading Style Sheets (FSCSS) allows you to generate dynamic, non-deterministic values at runtime.
Instead of hardcoding styles, you let the browser decide—from a list you provide.
color: @random([red, blue, green]);
Each render can produce a different result. Same code, different vibe.
@random() accepts an Array of values and randomly selects one.
Numbers
width: @random([100, 200, 300])px;
Colors
background: @random([lightgreen, yellow, orange]);
Transforms
transform: translateX(@random([10, 30, 40, -60])px);
Traditional CSS is static.
FSCSS introduces controlled randomness.
Procedural UI design
Organic-looking animations
Dynamic backgrounds (stars, particles, noise)
Unique user experiences on every load
.star{
left: @random([10,20,30,40,50,60,70,80,90])%;
top: @random([10,20,30,40,50,60,70,80,90])%;
}
.btn{
background: @random([#ff6b6b, #6bcB77, #4d96ff, #ffd93d]);
}
@keyframes float{
to{
transform: translateY(@random([-20, -40, -60])px);
}
}
Use CDN runtime when working with @random() (it runs in the browser).
Combine with:
@arr → reusable value sets
@define → reusable logic blocks
@event → conditional styling
Avoid overusing randomness in critical UI elements (keep UX predictable where needed).
Random doesn’t mean chaos.
Good design still needs constraints.
Think of @random() as guided creativity, not pure unpredictability.
@random() is one of those features that quietly changes how you think about CSS.
It’s no longer just styling it’s behavior.
And once you start using it…
you’ll wonder why CSS was ever fully static.