Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
November 9, 2022 09:19
November 3, 2022 17:09
February 1, 2019 09:23
September 16, 2020 10:08
September 16, 2020 10:08
June 23, 2016 11:24
February 22, 2023 12:46
May 26, 2023 19:34
May 26, 2023 19:34


Language services for CSS, LESS and SCSS

npm Package NPM Downloads Build Status License: MIT


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.
  • findDocumentSymbols provides all symbols in the given document
  • doCodeActions evaluates code actions for the given location, typically to fix a problem.
  • findColorSymbols evaluates all color symbols in the given document
  • 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.


npm install --save vscode-css-languageservice


For the complete API see cssLanguageService.ts and cssLanguageTypes.ts


  • clone this repo, run yarn
  • yarn 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

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

  • run VSCode out of sources setup as described here:
  • run yarn link in the folder of vscode-css-languageservice
  • use yarn 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/|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
  • set breakpoints, e.g. in cssCompletion.ts
  • in the instance run from sources, invoke code completion in the .css file

Note: All CSS entities (properties, at-rules, etc) are sourced from and transpiled here. For adding new property or fixing existing properties' completion/hover description, please open PR there).


(MIT License)

Copyright 2016, 20 Microsoft

With the exceptions of build/mdn-documentation.js, which is built upon content from Mozilla Developer Network and distributed under CC BY-SA 2.5.


CSS, LESS & SCSS language service extracted from VSCode to be reused, e.g in the Monaco editor.



Code of conduct

Security policy





No packages published