I’ve been working on FSCSS (Figured Shorthand CSS) — an experimental FSCSS preprocessor.
FSCSS tries to reduce boilerplate with compact syntax and helper functions.
I already introduced FSCSS before, but this time I wanted to share a clear list of some core features.
✨ Core Features
Variables (
$var,str()) → reusable valuesStyle Replacement (
%n()) → shorthand for repeated propertiesRepeat Function (
rpt()) → quick repetitionCopy Function (
copy()) → copy part of a valueString Extractor (
@ext()) → extract substringsDrops / Shared Properties → reuse style groups
Attribute Selectors → extended selector logic
Keyframes (
$(@keyframes …)) → shorthand animation blocksVendor Prefixing (
-*) → automatic prefixesFunction-based (
@fun) → reusable function-like blocksArray Methods (
@arr) → define and loop arrays🎲 Random Function (
@random()) → runtime randomness➕ Number Calculation (
num()) → math in styles🔗 Import (
@import) → include external FSCSS files@event→ event-based styling logicexec()→ debugging and runtime helpers
⚡ Example
/* CSS */
.box, .card {
animation: trans 3s ease-in infinite;
}
@keyframes trans {
from {
width: 0;
height: 0;
background: red;
}
to {
width: 200px;
height: 200px;
background: blue;
}
}
/* FSCSS */
$(@keyframes trans, .box .card &[3s ease-in infinite]) {
from {
%2(width, height [: 0;])
background: red;
}
to {
%2(width, height [: 200px;])
background: blue;
}
}
🔗 Try It
👉 Features
👉 CodePen Demo
👉 GitHub Repo
💬 Feedback
This is still experimental — I’d love to hear your thoughts:
Does FSCSS make sense, or is it harder to read?
Which of the features above feels most useful to you?
Would you try this for prototyping or animation-heavy projects?
Thanks for reading 🙏
Top comments (0)