@codemirror/lang-css

CSS language support for the CodeMirror 6 code editor, with highlighting, indentation, and autocompletion

Library
npm
v6.3.1
18 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
23 /100 Needs Attention
Development Activity 4
Maintenance 0
Community 16
Maturity 60
Momentum 12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
73 /100 Good
Architecture 78
Code Quality 74
Innovation 60
Learning Curve 80

@codemirror/lang-css implements CSS language support for the CodeMirror code editor. It is built on the Lezer CSS parser and extends it with syntax highlighting, indentation rules, and a completion source for CSS properties, variables, and value keywords.

Beyond plain CSS, the package exposes defineCSSCompletionSource, letting related CodeMirror language modes (such as Sass and Less) reuse its completion logic by supplying their own predicate for what counts as a completable variable in their dialect.

What You Get

  • A css() extension that adds full CSS LanguageSupport to a CodeMirror editor instance
  • A cssLanguage provider built on the Lezer CSS parser with highlighting and indentation baked in
  • A cssCompletionSource for autocompleting CSS properties, variables, and value keywords
  • A reusable defineCSSCompletionSource factory that CSS-dialect packages (Sass, Less) build their own completion sources on top of

Common Use Cases

  • Adding CSS syntax highlighting and autocomplete to an in-browser code editor built on CodeMirror 6
  • Building a live CSS playground or style editor with real-time property/value suggestions
  • Powering CSS-in-JS or theme editors that need a lightweight, embeddable CSS editing surface
  • Serving as the base completion logic for other CodeMirror CSS-dialect language packages (Sass, Less)

Under The Hood

Architecture - The package is intentionally small: src/css.ts (31 lines) wires the Lezer CSS parser into a CodeMirror LRLanguage and exposes the css() LanguageSupport extension, while src/complete.ts (229 lines) implements the completion logic, including the generic defineCSSCompletionSource factory that parameterizes what counts as a completable variable so other CSS-dialect packages can reuse it. Tech Stack - TypeScript, built against @codemirror/language, @codemirror/autocomplete, @codemirror/state, and @lezer/css/@lezer/common as peer building blocks, compiled via the shared @codemirror/buildhelper tooling used across the CodeMirror 6 package family. Code Quality - tests run through the shared cm-runtests CodeMirror test runner rather than an in-repo test suite; the code is compact and narrowly scoped, which limits surface area for bugs, but the low development_activity and maintenance_consistency health signals reflect that active development has moved to the project’s own Forgejo instance rather than GitHub. API Design - the public surface is minimal and composable: a single css() call for editor consumers, plus cssLanguage and cssCompletionSource as named exports for anyone customizing behavior, following the same small-surface convention as the rest of the @codemirror/lang-* package family.

Used by 21 apps in this directory

TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
Go
67%
MIT

nginx ignition

Developer Tools · Devops

2,141

A modern web UI for nginx that eliminates config file editing with visual virtual hosts, SSL automation, Docker integrations, and real-time traffic analytics.

View details
74
Repo Health
80
Technical
67
Dependency
Built with
Go 67%
TypeScript 28%
Updated 2 weeks ago
Go
63%
MIT

Obot

AI Agents · Mcp

1,120

An open-source MCP platform for organizations — host MCP servers, run MCP registries, monitor usage, and build agents and chatbots on top of the Model Context Protocol from one self-hosted deployment.

View details
88
Repo Health
70
Technical
70
Dependency
Built with
Go 63%
Svelte 21%
TypeScript 15%
Updated 1 weeks ago
TypeScript
99%
Apache 2.0

Onlook

AI Design Tools · Design Tools

26,996

An open-source, AI-first visual editor that lets designers and developers build, style, and deploy React apps directly in code — no handoff required.

View details
63
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
TypeScript
97%
GPL 3.0

OpenKnowledge

Code Editors · Knowledge Management · Note Taking

4,674

A beautiful, local-first markdown IDE that turns any git repo into a live collaborative workspace for humans and AI coding agents like Claude, Codex, and OpenCode.

View details
80
Repo Health
89
Technical
64
Dependency
Built with
TypeScript 97%
Updated 6 days ago
Python
73%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

40,705

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 73%
TypeScript 12%
Rust 11%
Updated 6 days ago
JavaScript
59%
Apache 2.0

peerd

AI Agents

421

The first AI agent harness native to the browser — a Chrome/Firefox extension that drives your tabs, spins up sandboxed compute (JS notebooks, WASM Linux VMs), and shares what it builds peer-to-peer, with no backend, no telemetry, and BYOK.

View details
78
Repo Health
70
Technical
0
Dependency
Built with
JavaScript 59%
TypeScript 39%
Updated 1 weeks ago
Go
64%
MIT

sandboxd

Developer Tools · Devops

971

Self-hosted engine for AI app-builder products: give every user an isolated sandbox, a built-in coding agent, and a live preview URL — one command, no Kubernetes.

View details
77
Repo Health
83
Technical
68
Dependency
Built with
Go 64%
TypeScript 25%
Updated 1 weeks ago
TypeScript
67%
MIT

Scalar

Developer Tools

16,313

Beautiful, interactive OpenAPI documentation with a built-in offline-first API client and multi-language code generation — all in one open-source platform.

View details
90
Repo Health
89
Technical
65
Dependency
Built with
TypeScript 67%
Vue 29%
Updated 6 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