CSSType

Strict TypeScript and Flow type definitions for CSS properties and values, generated from MDN data

Library
npm
v3.2.3
1,816 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
42 /100 Fair
Development Activity 4
Maintenance 20
Community 44
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 70
Code Quality 75
Innovation 65
Learning Curve 95

CSSType is a pure type-definitions package that provides strict TypeScript and Flow types for every CSS property and value, generated directly from MDN’s browser-compat-data. Importing CSS.Properties gives autocomplete and compile-time type checking on style objects, catching typos in property names (colour instead of color) and invalid values (middle instead of center for textAlign) before code ever runs.

Because its types are mechanically generated from MDN’s authoritative CSS data rather than hand-maintained, CSSType stays current with the CSS spec and is widely depended upon as the underlying type source for CSS-in-JS libraries, style-object APIs, and any TypeScript/Flow codebase that models CSS properties as typed objects.

What You Get

  • CSS.Properties type covering every standard CSS property with its valid value union
  • At-rule types (AtRule.Viewport, etc.) and pseudo-class/pseudo-element types for advanced selector typing
  • Both TypeScript (index.d.ts) and Flow (index.js.flow) type definitions maintained in lockstep
  • Generic type parameters (e.g. CSS.Properties<TLength>) for customizing how length/numeric values are typed
  • Types generated from and kept in sync with MDN’s browser-compat-data and mdn-data packages rather than hand-authored

Common Use Cases

  • Typing CSS-in-JS style objects in libraries like styled-components or Emotion, which depend on CSSType as their underlying property/value types
  • Catching CSS property name typos and invalid values at compile time in TypeScript or Flow projects that build style objects programmatically
  • Building design-system or component-library APIs that accept typed style props validated against real CSS property/value unions
  • Powering autocomplete for CSS property names and values in editors via TypeScript’s language service

Under The Hood

Architecture CSSType has no runtime code at all — its main field is intentionally empty and the published package consists solely of index.d.ts (TypeScript, ~22,500 lines) and index.js.flow (Flow). The repository’s actual logic lives in its build tooling (build.ts, update.ts, src/), which reads MDN’s browser-compat-data and mdn-data npm packages, maps each CSS property to its accepted value grammar, and mechanically generates the massive type-definition file rather than having a human write or maintain thousands of property/value union types by hand.

Tech Stack The generator toolchain is TypeScript-based, running via tsx, and depends on mdn-data, @mdn/browser-compat-data, and css-tree to parse and interpret CSS grammar data pulled from MDN. Testing runs through Jest across both src (generator logic) and dist (generated output) test suites, and releases are automated via release-it.

Code Quality The __tests__ directory and dual test:src/test:dist Jest scripts indicate the project tests both its generation logic and the correctness of its final generated types against real style objects, which matters a great deal given the definitions file is nearly entirely machine-generated and any generator bug would silently propagate into thousands of type errors (or missed errors) downstream. The generated index.d.ts itself is not hand-reviewable line by line, so quality here is really a function of the generator’s own test coverage and its fidelity to MDN’s compatibility data.

API Design Consumer-facing usage is minimal by design: import type * as CSS from 'csstype' and reference CSS.Properties (optionally parameterized, e.g. CSS.Properties<string | number>, to control how length values are typed) — there is no configuration, no functions to call, and no runtime footprint, making adoption essentially zero-cost for any project that already uses TypeScript or Flow.

Used by 16 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
Java
48%
Apache 2.0

ClearFlask

Community · Product Management

451

Open-source feedback management and roadmap tool that lets product teams collect, prioritize, and respond to user input — with AI-powered summarization and full self-hosting control.

View details
83
Repo Health
73
Technical
62
Dependency
Built with
Java 48%
TypeScript 47%
Updated 6 days ago
TypeScript
48%
AGPL 3.0

Grafana

Analytics · Monitoring

76,962

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript 48%
Go 46%
Updated 4 days ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,301

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 4 days ago
TypeScript
94%
AGPL 3.0

Laudspeaker

Automation · Marketing

2,626

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
51
Repo Health
66
Technical
62
Dependency
Built with
TypeScript 94%
Updated 2 months ago
TypeScript
97%
Other

Lightdash

Analytics · Data Engineering

6,166

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 97%
Updated 4 days ago
TypeScript
93%
AGPL 3.0

Linkwarden

Bookmarks Archiving · Knowledge Management

19,855

Self-hosted collaborative bookmark manager that captures full-page archives, enables annotation, and keeps your knowledge accessible forever.

View details
87
Repo Health
72
Technical
66
Dependency
Built with
TypeScript 93%
Updated 3 weeks ago
Clojure
70%
AGPL 3.0

Logseq

Knowledge Management · Note Taking

45,069

A privacy-first, open-source knowledge graph platform combining Markdown, Org-mode, bidirectional linking, and local-first storage for building your second brain.

View details
92
Repo Health
82
Technical
68
Dependency
Built with
Clojure 70%
OCaml 12%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers