# vscode-css-languageservice

> Language service for CSS, LESS and SCSS

Latest version **6.3.10** (published 2026-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install vscode-css-languageservice
pnpm add vscode-css-languageservice
yarn add vscode-css-languageservice
bun add vscode-css-languageservice
```

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.3.10 |
| Published | 2026-02-23 |
| First published | 2016-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 385 |
| Author | Microsoft Corporation |
| Maintainers | microsoft1es, microsoft-oss-releases, alexandrudima, joaomoreno.ms, kaimaetzel, sbatten, lszomoru, vscode-bot |

## Links

- npm: https://www.npmjs.com/package/vscode-css-languageservice
- Repository: https://github.com/Microsoft/vscode-css-languageservice
- Homepage: https://github.com/Microsoft/vscode-css-languageservice#readme
- Issues: https://github.com/Microsoft/vscode-css-languageservice
- npm.io page: https://npm.io/package/vscode-css-languageservice

## Dependencies (4)

- [vscode-uri](https://npm.io/package/vscode-uri.md) ^3.1.0
- [@vscode/l10n](https://npm.io/package/@vscode/l10n.md) ^0.0.18
- [vscode-languageserver-types](https://npm.io/package/vscode-languageserver-types.md) 3.17.5
- [vscode-languageserver-textdocument](https://npm.io/package/vscode-languageserver-textdocument.md) ^1.0.12

## Recent versions

- 6.3.10 (latest) — 2026-02-23
- 7.0.0-next.2 (next) — 2026-09-08
- 7.0.0-next.1 — 2026-03-04
- 6.3.9 — 2025-12-01
- 6.3.8 — 2025-09-29
- 6.3.7 — 2025-06-30
- 6.3.6 — 2025-06-02
- 6.3.6-next.0 — 2025-04-25
- 6.3.5 — 2025-04-25
- 6.3.4 — 2025-04-03
- 6.3.4-next.0 — 2025-03-24
- 6.3.3 — 2025-03-24
- 6.3.3-3 — 2025-03-24
- 6.3.3-2 — 2025-03-13
- 6.3.3-1 — 2025-02-18
- … 187 more at https://npm.io/package/vscode-css-languageservice/versions

## README

# vscode-css-languageservice
Language services for CSS, LESS and SCSS

[![npm Package](https://img.shields.io/npm/v/vscode-css-languageservice.svg?style=flat-square)](https://www.npmjs.org/package/vscode-css-languageservice)
[![NPM Downloads](https://img.shields.io/npm/dm/vscode-css-languageservice.svg)](https://npmjs.org/package/vscode-css-languageservice)
[![Build Status](https://github.com/microsoft/vscode-css-languageservice/actions/workflows/node.js.yml/badge.svg)](https://github.com/microsoft/vscode-css-languageservice/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Why?
----
The _vscode-css-languageservice_ contains the language smarts behind the CSS, LESS and SCSS editing experience of Visual Studio Code
and the Monaco editor.
 - *doValidation* analyses an input string and returns syntax and lint errors.
 - *doComplete* provides completion proposals for a given location.
 - *doHover* provides a hover text for a given location.
 - *findDefinition* finds the definition of the symbol at the given location.
 - *findReferences* finds all references to the symbol at the given location.
 - *findDocumentHighlights* finds all symbols connected to the given location.
 - *findDocumentLinks* provides all symbols in the given document
 - *findDocumentSymbols* provides all links for references in the given document
 - *doCodeActions* evaluates code actions for the given location, typically to fix a problem.
 - *findDocumentColors* evaluates all color symbols in the given document
 - *getColorPresentations* lists valid CSS color presentations
 - *doRename* renames all symbols connected to the given location.
 - *prepareRename* the range of the node that can be renamed
 - *getFoldingRanges* returns folding ranges in the given document.
 - *getSelectionRanges* returns selection ranges in the given document.


The _vscode-css-languageservice_ does not cover syntax highlighting. VS Code uses TextMate grammars for that, with a grammar that is maintained in https://github.com/microsoft/vscode-css. 


All CSS entities (properties, at-rules, etc) are sourced from https://github.com/microsoft/vscode-custom-data/tree/master/web-data and transpiled here. For adding new property or fixing existing properties' completion/hover description, please open PR there.

Installation
------------

    npm install --save vscode-css-languageservice


API
---

For the complete API see [cssLanguageService.ts](./src/cssLanguageService.ts) and [cssLanguageTypes.ts](./src/cssLanguageTypes.ts)


Development
-----------

- clone this repo, run `npm install`
- `npm test` to compile and run tests

How can I run and debug the service?

- open the folder in VSCode.
- set breakpoints, e.g. in `cssCompletion.ts`
- run the Unit tests from the run viewlet and wait until a breakpoint is hit:
![image](https://user-images.githubusercontent.com/6461412/94239202-bdad4e80-ff11-11ea-99c3-cb9dbeb1c0b2.png)


How can I run and debug the service inside an instance of VSCode?

- run VSCode out of sources setup as described here: https://github.com/Microsoft/vscode/wiki/How-to-Contribute
- run `npm link` in the folder of `vscode-css-languageservice`
- use `npm link vscode-css-languageservice` in `vscode/extensions/css-language-features/server` to run VSCode with the latest changes from `vscode-css-languageservice`
- run VSCode out of source (`vscode/scripts/code.sh|bat`) and open a `.css` file
- in VSCode window that is open on the `vscode-css-languageservice` sources, run command `Debug: Attach to Node process` and pick the `code-oss` process with the `css-language-features` path
![image](https://user-images.githubusercontent.com/6461412/94242567-842b1200-ff16-11ea-8f85-3ebb72d06ba8.png)
- set breakpoints, e.g. in `cssCompletion.ts`
- in the instance run from sources, invoke code completion in the `.css` file

License
-------

(MIT License)

Copyright 2016, 25 Microsoft

With the exceptions of `build/mdn-documentation.js`, which is built upon content from [Mozilla Developer Network](https://developer.mozilla.org/docs/Web)
and distributed under CC BY-SA 2.5.

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