DEV Community

Cover image for Free visual builder for pure CSS charts — st-core.fscss
FSCSS tutorial for FSCSS tutorial

Posted on Originally published at hub.devtem.org

Free visual builder for pure CSS charts — st-core.fscss

You can design a line or area chart, toggle grid and dots, pick an accent, and leave with FSCSS, HTML, and CSS—without wiring Chart.js or an SVG library.

st-core Visual Chart Builder is free and open-source. It sits on st-core@v2: charts as CSS custom properties and clip-path polygons, driven by FSCSS arrays.

Module: github.com/fscss-ttr/st-core.fscss


Why this matters

Most “chart builders” emit React, canvas, or heavy chart SDKs. This one is aimed at lightweight, pre-designed, modern charts that ship as CSS:

  • No SVG / canvas requirement for the core series
  • Any length dataset (@arr), not a fixed 8 points
  • X spacing from array.length
  • Y as normalized --st-p1 … --st-pN (100 − value)
  • Optional JS only when you want to live-update those variables

The builder is a front door: tune data and layers, preview, copy code.


What the builder gives you

Control Effect
Data list Comma / space separated values 0–100
Presets Rising, Decline, Volatile, Flat, Climb, Peaks
Layers Fill, line, grid, dots
Height / radius Chart box
Accent --st-accent
Grid rows / cols Background grid density
Array & class names Generated selectors

Outputs

  1. FSCSS — @import st-core@v2, @arr, @st-chart-*
  2. HTML — full minimal page with runtime script
  3. CSS — approximate or runtime-expanded rules

Preview uses the FSCSS ESM API with stable version, with a polygon fallback so the chart still paints if compile fails.


The chart model (what you’re designing)

Minimal mental model:

@import((*) from st-core@v2)
@st-root()

@arr myData[56, 67, 70, 43, 67, 80, 55]

@st-chart-fill(.chart-fill, myData)
@st-chart-line(.chart-line, myData)

.chart {
  @st-chart-points(myData)
  position: relative;
  height: 220px;
  width: 100%;
  max-width: 520px;
  background: var(--st-surface);
  border-radius: 12px;
  overflow: hidden;
}
Enter fullscreen mode Exit fullscreen mode
<div class="chart">
  <div class="chart-fill"></div>
  <div class="chart-line"></div>
</div>
Enter fullscreen mode Exit fullscreen mode
  • @st-chart-fill / @st-chart-line — renderer for a selector (how many points the polygon expects).
  • @st-chart-points — writes --st-pN on the element (the actual Y values).
  • Children can inherit points from a parent, or set their own for multi-series.

Runtime / CDN:

<script src="https://cdn.jsdelivr.net/npm/fscss@1.2.5/runtime.min.js" defer></script>
Enter fullscreen mode Exit fullscreen mode

Live updates (optional JS)

Same variables the builder sets on the preview:

function updatePoints(el, values) {
  el.style.cssText = values
    .map((v, i) => `--st-p${i + 1}: ${100 - v}%;`)
    .join(" ");
}

updatePoints(document.querySelector(".chart"), [40, 60, 20, 80, 50]);
Enter fullscreen mode Exit fullscreen mode

Pair with transition on clip-path for soft redraws—exactly what the generated snippets include.


Who it’s for

  • Dashboards that should stay CSS-first and cacheable
  • Design / content people who want a chart without a JS chart stack
  • dev who need a correct @arr + mixin skeleton before pasting into a larger layout (phone shell, stat cards, multi-series)

v2 is the path for new work: dynamic length, even X spacing, dual-edge line polygons. Details live in the module README and EXPLAINED.md.


Try

  1. Open Visual Chart Builder
  2. Enter points or click a preset
  3. Toggle fill / line / grid / dots
  4. Copy CSS, FSCSS or HTML
  5. Ship with CLI compile when you want:
npm install -g fscss@latest
fscss chart.fscss chart.css
Enter fullscreen mode Exit fullscreen mode

Links

Pre-designed doesn’t have to mean heavy. With st-core, the “design” is tokens and polygons—and the builder is there so you can see it before you commit a single line to production.

Top comments (0)