Skip to content
This repository was archived by the owner on Apr 25, 2020. It is now read-only.

Typescript plugin to get intellisense and validation for SCSS imports as CSS Modules

Notifications You must be signed in to change notification settings

GodLesZ/typescript-plugin-css-module-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f380521 · Jul 19, 2019

History

15 Commits
Jul 15, 2019
Jul 19, 2019
Jul 15, 2019
Jul 15, 2019
Jul 15, 2019
Jul 15, 2019
Jul 15, 2019
Jul 15, 2019
Jul 15, 2019
Jul 15, 2019
Jul 19, 2019
Jul 15, 2019
Jul 15, 2019
Jul 19, 2019

Repository files navigation

Build Status codecov

TS Types for CSS Modules

This Typescript plugin hooks itself into the Typescript Language Service to provide intellisense and validation for SCSS imports as CSS Modules.

It supports .module.scss imports containing valid SCSS code.

Features

The following SCSS (and CSS Modules) feature are supported:

// :global and :local identifier and functions
:global .global-class { }
:global(.global-class) { }
:local .local-class { }
:local(.local-class) { }

// Variables
$color: red;
.className {
  color: $color;
}

// Loops
$color: red;
@for $section from 1 to 5 {
    .section-#{$section} {
        color: $color;
    }
}

Also imports are supported.
As of now there's also a limited path-resolution support to allow module imports.

@import "./relative/path/some/file";

@import "absolute/path/some/file";

Thanks

Thanks to Microsoft and their nice Language-Service-Plugin documentation.