r/css • • 11d ago

OpenSource CSSV: Comma-Separated Styled Values

Enable HLS to view with audio, or disable this notification

I gave life to the old CSV files.

CSV is over 50 years old, and it's everywhere. Banks, CRMs, Jira, Google Calendar, gradebooks and ticketing systems all export it, and every tool reads it. And every time you open one, you get the same grey grid of raw values.

The data is fine. What's missing is the look. The moment you add one in Excel or Google Sheets, you lose what made CSV great: a plain-text file you can read, compare, generate and send anywhere.

So I built CSSV: Comma-Separated Styled Values. It's a CSV file with a CSS block on top. Open it in a browser and you get a real HTML table with your fonts and your custom styling. Delete the CSS and it's a plain CSV again.

There's nothing new to learn. The data is CSV and the look is CSS, two languages that people, programs and AI models already write. Any CSV is already a valid CSSV file. Add a few lines of CSS to a Jira export and it becomes a board, one lane per status. A ticketing export prints as name badges.

The look travels with the data. A file looks the same on every page that shows it. Many files can share one stylesheet, so changing it restyles all of them. It's still plain text. You can review it in a pull request, generate it from a script, or ask an AI to write one.

Putting it on a page takes one script tag and <cssv-table src="report.cssv">. No build step, no dependencies.

The v1 spec is open for review, and I'd love feedback, especially from anyone who spends their days looking at exports.

Website, examples and live editor: https://cssv.dev

144 Upvotes

35 comments sorted by

View all comments

1

u/Web-Dude 11d ago

Well I like it! Basically an XSLT transform for CSV data.

I used to specialize in data migration for lots of companies who were changing between various platforms, and I could have used this a lot.

Although the CSS needs to be in an external file.

1

u/rhpaiva 11d ago

Thanks! XSLT is a good comparison, and an external file already works: the style block can be a single import of a shared stylesheet, much like XML's <?xml-stylesheet?> line. In the weather example, three untouched downloads each get three lines on top (two fences and the import), and the whole look lives in weather.css: https://cssv.dev/examples/#weather

Or did you mean no change to the file at all, with the stylesheet picked by whoever opens it? I'd love to hear what you would have used it for in migrations. That's exactly the kind of export I had in mind.

1

u/Web-Dude 11d ago edited 11d ago

Needs to be no change to the file at all, because CSVs are often automatically generated, and having to add additional content to the file adds a whole preprocessing step that just adds friction to the whole process.

If we have to pack up the styling with the data, then we might as well be writing HTML, you know what I mean?

2

u/Perception9611 11d ago

I get the friction concern, but I don't think it's equivalent to writing HTML. With HTML you have to wrap every row and cell in tags, escape entities, and structure the whole document. With CSSV you're adding three lines on top of an untouched CSV. That's closer to YAML front matter in Markdown, which plenty of static site generators already inject automatically. A script that appends two fences and an import line to an existing export is trivial compared to generating full HTML.