DEV Community

Omonire Oghene-Ovie Great
Omonire Oghene-Ovie Great

Posted on

Tailwind without utility soup: semantic CSS for Python web apps

I maintain fscss, a Python wrapper around FSCSS, and we just shipped 0.2.0 on PyPI and GitHub.

The idea is simple: keep semantic CSS, but remove the repetitive parts.

The problem

Most Python web projects end up in one of two places:

  • Hand-written CSS that grows into a wall of repeated spacing, colors, and mixin-like patterns.
  • A utility-class framework that moves styling into templates and adds a frontend build pipeline.

Neither feels great when the app is Flask, Django, or FastAPI + HTMX and you want plain CSS out.

What FSCSS looks like

$accent: #8f6bff;
$ink: #0b0a13;

@define panel(sel:.panel){`
  @use(sel) {
    px: 24px;
    py: 20px;
    rounded: 16px;
    shadow: 0 18px 50px rgba(0,0,0,.35);
    stack: 14px;
  }
`}

body {
  bg: $ink!;
  ff: system-ui, sans-serif;
}

@panel(.feature)
Enter fullscreen mode Exit fullscreen mode

That compiles to ordinary CSS before the server starts. No runtime styles, no class-name generator, no injected <style> tags.

The Python part

pip install fscss
fscss init
Enter fullscreen mode Exit fullscreen mode
import fscss
from flask import Flask

app = Flask(__name__)
fscss.init_flask(app)
Enter fullscreen mode Exit fullscreen mode

fscss vendors the official Node compiler (xfscss 1.2.6) and runs it for you. Node.js 20+ is still required today, but Python is the public API: compile files, compile directories, watch for changes, and check drift in CI.

The CLI also has doctor, env, build --check, clean, report, shell completion, and init that can install Node through your platform package manager.

Why 0.2.0 matters

This release focused on trust and operability:

  • meaningful exit codes
  • --check and --strict for CI
  • environment diagnostics
  • Flask/Django helpers
  • UTF-16 input handling
  • CI on Python 3.8-3.12 across Ubuntu and Windows
  • trusted publishing to PyPI with no token stored in the repo

There is also a Flask starter, a cookbook, a shorthand cheat sheet, and VS Code support from Figsh's extension.

Where it fits

FSCSS is not trying to replace Tailwind for every team. It is for developers who want:

  • semantic class names
  • design tokens and mixins
  • plain CSS output
  • a Python-first workflow
  • zero runtime cost

If that sounds like your kind of project, try the starter and tell me what breaks. Real-world .fscss files are the most useful feedback.

Top comments (1)

Collapse
 
userxnom profile image
Abdullah Naseer •

This is the exact tension I keep running into with Flask + HTMX apps — hand-written CSS turns into a wall of repeated spacing, and pulling in a utility framework drags a whole frontend build pipeline into a project that never asked for one. Compiling to plain CSS before the server starts, with zero runtime cost, is the part that sells it to me: the browser never knows FSCSS existed.

The 0.2.0 focus is telling too — meaningful exit codes and --check / --strict for CI is the kind of unglamorous trust work that decides whether a tool survives in a real pipeline. The honest caveat that Node 20+ is still required is the one thing I would watch: for a Python-first team, is that the main adoption friction, or does the vendored compiler make it invisible enough that nobody notices? And when a real-world .fscss file gets big, what breaks first — the token system or the @define panels?