# @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

  css() → LanguageSupport (https://codemirror.net/docs/ref#language.LanguageSupport)

Language support for CSS.

  cssLanguage: LRLanguage (https://codemirror.net/docs/ref#language.LRLanguage)

A language provider based on the Lezer CSS
parser (https://github.com/lezer-parser/css), extended with
highlighting and indentation information.

  cssCompletionSource: CompletionSource (https://codemirror.net/docs/ref#autocomplete.CompletionSource)

CSS property, variable, and value keyword completion source.

  defineCSSCompletionSource(isVariable: fn(node: SyntaxNodeRef (https://lezer.codemirror.net/docs/ref/#common.SyntaxNodeRef)) → boolean (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)) → CompletionSource (https://codemirror.net/docs/ref#autocomplete.CompletionSource)

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.

