CSSType

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

Library
npm
v3.2.3
1,813stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
44/100Fair
Development Activity12
Maintenance20
Community44
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture70
Code Quality75
Innovation65
Learning Curve95

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

167

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

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

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

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
Java
48%
Apache 2.0

ClearFlask

Product Management · Community

448

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
63
Dependency
Built with
Java48%
TypeScript47%
Updated 2 weeks ago
TypeScript
48%
AGPL 3.0

Grafana

Monitoring · Analytics

76,300

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
65
Dependency
Built with
TypeScript48%
Go46%
Updated today
TypeScript
97%
Other

Kibana

Analytics · Monitoring

21,251

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
68
Dependency
Built with
TypeScript97%
Updated today
TypeScript
94%
AGPL 3.0

Laudspeaker

Marketing · Automation

2,618

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

View details
53
Repo Health
66
Technical
64
Dependency
Built with
TypeScript94%
Updated 1 months ago
TypeScript
96%
Other

Lightdash

Analytics · Data Engineering

6,056

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
66
Dependency
Built with
TypeScript96%
Updated today
TypeScript
93%
AGPL 3.0

Linkwarden

Bookmarks Archiving · Knowledge Management

19,527

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

View details
90
Repo Health
72
Technical
66
Dependency
Built with
TypeScript93%
Updated today
Clojure
73%
AGPL 3.0

Logseq

Note Taking · Knowledge Management

44,506

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
Clojure73%
OCaml11%
Updated today

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

Search