🚀 FSCSS Functions — Make Your CSS Smarter, Faster & Dynamic
What Are FSCSS Functions?
FSCSS (Figured Shorthand CSS) extends normal CSS with powerful function-like abilities. You can reuse values, run calculations, generate random styles, and create dynamic layouts.
1. @fun — Reusable Value Collections
Create grouped reusable values, perfect for themes or design tokens.
@fun(theme){
primary: #3b82f6;
danger: #ef4444;
}
.btn {
background: @fun.theme.primary.value;
}
- @random — Dynamic Variations
Generate different styles per compile — for creative and fun UI effects.
@arr(colors[#3b82f6, #8b5cf6, #10b981]);
.box {
background: @random([@arr.colors(,)]);
}
- num() — Run Math Directly in CSS
Calculate values without switching to JavaScript.
$base: 16;
title {
font-size: num($base! * 1.5)px;
}
- Utility Functions
copy()
color: copy(4, primary-color);
length()
width: num(length("Hello") * 10)px;
count()
@arr(nums[count(5)]); // [1,2,3,4,5]
Why Developers Love FSCSS functions
· Reusable design systems
· Fewer repeated styles
· Dynamic & logic-driven CSS
· Cleaner, more expressive syntax
FSCSS Functions level up your CSS workflow by adding logic and dynamic power. Once you start using them, traditional CSS will feel limited.
Full guide @ https://fscss.devtem.org

