vscode-css-languageservice

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
v

vscode-css-languageservice

Language service for CSS, LESS and SCSS

6.3.6
100

Supply Chain Security

100

Vulnerability

95

Quality

93

Maintenance

100

License

Version published
Weekly downloads
777K
-7.81%
Maintainers
7
Weekly downloads
 
Created
Issues
66

What is vscode-css-languageservice?

The vscode-css-languageservice package provides a set of tools and services for working with CSS in a way that integrates seamlessly with Visual Studio Code. It offers features like CSS validation, completion, hover information, and more, making it easier for developers to write and maintain CSS code.

What are vscode-css-languageservice's main functionalities?

CSS Validation

This feature allows you to validate CSS code and get diagnostics information. The code sample demonstrates how to create a CSS language service, parse a stylesheet, and perform validation to get diagnostics.

const cssService = require('vscode-css-languageservice').getCSSLanguageService();
const document = { uri: 'test.css', languageId: 'css', version: 1, getText: () => 'body { color: red; }' };
const stylesheet = cssService.parseStylesheet(document);
const diagnostics = cssService.doValidation(document, stylesheet);
console.log(diagnostics);

CSS Completion

This feature provides code completion suggestions for CSS. The code sample shows how to get completion items for a given position in a CSS document.

const cssService = require('vscode-css-languageservice').getCSSLanguageService();
const document = { uri: 'test.css', languageId: 'css', version: 1, getText: () => 'body { col' } };
const position = { line: 0, character: 10 };
const stylesheet = cssService.parseStylesheet(document);
const completions = cssService.doComplete(document, position, stylesheet);
console.log(completions);

CSS Hover Information

This feature provides hover information for CSS code. The code sample demonstrates how to get hover information for a specific position in a CSS document.

const cssService = require('vscode-css-languageservice').getCSSLanguageService();
const document = { uri: 'test.css', languageId: 'css', version: 1, getText: () => 'body { color: red; }' };
const position = { line: 0, character: 7 };
const stylesheet = cssService.parseStylesheet(document);
const hover = cssService.doHover(document, position, stylesheet);
console.log(hover);

Other packages similar to vscode-css-languageservice

FAQs

Package last updated on 02 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts