# @codemirror/lang-css

> CSS language support for the CodeMirror code editor

Latest version **6.3.1** (published 2024-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codemirror/lang-css
pnpm add @codemirror/lang-css
yarn add @codemirror/lang-css
bun add @codemirror/lang-css
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 6.3.1 |
| Published | 2024-11-26 |
| First published | 2020-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 40.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Marijn Haverbeke |
| Maintainers | adrianheine, marijn |
| Keywords | editor, code |

## Links

- npm: https://www.npmjs.com/package/@codemirror/lang-css
- Repository: https://github.com/codemirror/lang-css
- Homepage: https://github.com/codemirror/lang-css#readme
- Issues: https://github.com/codemirror/lang-css/issues
- npm.io page: https://npm.io/package/@codemirror/lang-css

## Dependencies (5)

- [@lezer/css](https://npm.io/package/@lezer/css.md) ^1.1.7
- [@lezer/common](https://npm.io/package/@lezer/common.md) ^1.0.2
- [@codemirror/state](https://npm.io/package/@codemirror/state.md) ^6.0.0
- [@codemirror/language](https://npm.io/package/@codemirror/language.md) ^6.0.0
- [@codemirror/autocomplete](https://npm.io/package/@codemirror/autocomplete.md) ^6.0.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 6.3.1 (latest) — 2024-11-26
- 6.3.0 — 2024-09-07
- 6.2.1 — 2023-08-04
- 6.2.0 — 2023-04-26
- 6.1.1 — 2023-03-08
- 6.1.0 — 2023-03-06
- 6.0.2 — 2023-01-28
- 6.0.1 — 2022-10-24
- 6.0.0 — 2022-06-08
- 0.20.0 — 2022-04-20
- 0.19.3 — 2021-09-24
- 0.19.2 — 2021-09-22
- 0.19.1 — 2021-08-11
- 0.19.0 — 2021-08-11
- 0.18.0 — 2021-03-03
- … 2 more at https://npm.io/package/@codemirror/lang-css/versions

## README

<!-- NOTE: README.md is generated from src/README.md -->

# @codemirror/lang-css [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-css.svg)](https://www.npmjs.org/package/@codemirror/lang-css)

[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-css/blob/main/CHANGELOG.md) ]

This package implements CSS language support for the
[CodeMirror](https://codemirror.net/) code editor.

The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).

This code is released under an
[MIT license](https://github.com/codemirror/lang-css/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## API Reference

<dl>
<dt id="user-content-css">
  <code><strong><a href="#user-content-css">css</a></strong>() → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>

<dd><p>Language support for CSS.</p>
</dd>
<dt id="user-content-csslanguage">
  <code><strong><a href="#user-content-csslanguage">cssLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>

<dd><p>A language provider based on the <a href="https://github.com/lezer-parser/css">Lezer CSS
parser</a>, extended with
highlighting and indentation information.</p>
</dd>
<dt id="user-content-csscompletionsource">
  <code><strong><a href="#user-content-csscompletionsource">cssCompletionSource</a></strong>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionSource">CompletionSource</a></code></dt>

<dd><p>CSS property, variable, and value keyword completion source.</p>
</dd>
<dt id="user-content-definecsscompletionsource">
  <code><strong><a href="#user-content-definecsscompletionsource">defineCSSCompletionSource</a></strong>(<a id="user-content-definecsscompletionsource^isvariable" href="#user-content-definecsscompletionsource^isvariable">isVariable</a>: fn(<a id="user-content-definecsscompletionsource^isvariable^node" href="#user-content-definecsscompletionsource^isvariable^node">node</a>: <a href="https://lezer.codemirror.net/docs/ref/#common.SyntaxNodeRef">SyntaxNodeRef</a>) → <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionSource">CompletionSource</a></code></dt>

<dd><p>Create a completion source for a CSS dialect, providing a
predicate for determining what kind of syntax node can act as a
completable variable. This is used by language modes like Sass and
Less to reuse this package's completion logic.</p>
</dd>
</dl>

---
_Source: https://npm.io/package/@codemirror/lang-css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
