FSCSS (Figured Shorthand Cascading Style Sheets) is a lightweight CSS preprocessor: shorter syntax, @arr arrays, @define helpers, and modules — still outputs normal CSS.
Needs Node for the CLI, or just a browser for the runtime.
1. Install
npm install -g fscss@1.2.6
2. Three-minute runtime demo
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/fscss@1.2.6/runtime.min.js" defer></script>
<style>
@import((flex-x) from flex-control)
body {
bg: #0e0d14;
color: #e8e3ff;
ff: system-ui, sans-serif;
padding: 2rem;
}
.row {
@flex-x()
gap: 12px;
}
.card {
bg: #1c1a2e;
padding: 16px 20px;
rounded: 12px;
}
</style>
</head>
<body>
<div class="row">
<div class="card">A</div>
<div class="card">B</div>
<div class="card">C</div>
</div>
</body>
</html>
Open the file. The runtime expands FSCSS inside <style> into real CSS.
3. CLI (production)
npm install -g fscss
# or locally
npm install fscss
# styles.fscss
.box {
p: 16px; /* padding shorthand (1.2.5+) */
rounded: 12px;
bg: #12121a;
}
fscss styles.fscss styles.css
Link the compiled file only:
<link rel="stylesheet" href="styles.css" />
No runtime script required.
4. Core ideas (minimal)
| Idea | Example |
|---|---|
| Import helpers | @import((*) from st-core@v2) |
| Call them |
@st-root() / @ai-shell(.ai-shell)
|
| Arrays | @arr scores[40, 70, 90] |
| Shorthands |
p: 16px, rounded: 12px, stack: 12px
|
Import registers. Calling a helper emits CSS. What you don’t call doesn’t show up in the output.
5. Next
- Docs fscss.devtem.org
- Modules: fscss.devtem.org/libraries
- npm: fscss
MIT · fscss-ttr
Top comments (0)