File tree 2 files changed +48
-4
lines changed
2 files changed +48
-4
lines changed Original file line number Diff line number Diff line change 1
- # typescript-plugin-css-module-types
1
+ [ ![ Build Status] ( https://travis-ci.com/GodLesZ/typescript-plugin-css-module-types.svg?branch=master )] ( https://travis-ci.com/GodLesZ/typescript-plugin-css-module-types )
2
+ [ ![ codecov] ( https://codecov.io/gh/GodLesZ/typescript-plugin-css-module-types/branch/master/graph/badge.svg )] ( https://codecov.io/gh/GodLesZ/typescript-plugin-css-module-types )
2
3
3
- Typescript plugin to get intellisense and validation for SCSS imports as [ CSS Modules] ( https://github.com/css-modules/css-modules ) .
4
+ # TS Types for CSS Modules
5
+
6
+ This Typescript plugin hooks itself into the Typescript Language Service
7
+ to provide intellisense and validation for SCSS imports as [ CSS Modules] ( https://github.com/css-modules/css-modules ) .
8
+
9
+ It supports ` .module.scss ` imports containing valid SCSS code.
10
+
11
+ ## Features
12
+ The following SCSS (and CSS Modules) feature are supported:
13
+
14
+ ``` scss
15
+ // :global and :local identifier and functions
16
+ :global .global-class { }
17
+ :global(.global-class ) { }
18
+ :local .local-class { }
19
+ :local(.local-class ) { }
20
+
21
+ // Variables
22
+ $color : red ;
23
+ .className {
24
+ color : $color ;
25
+ }
26
+
27
+ // Loops
28
+ $color : red ;
29
+ @for $section from 1 to 5 {
30
+ .section-#{$section } {
31
+ color : $color ;
32
+ }
33
+ }
34
+ ```
35
+
36
+ Also ** imports** are supported.\
37
+ As of now there's also a limited path-resolution support to allow ** module imports** .
38
+
39
+ ``` scss
40
+ @import " ./relative/path/some/file" ;
41
+
42
+ @import " absolute/path/some/file" ;
43
+ ```
4
44
5
45
# Thanks
6
46
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " typescript-plugin-css-module-types" ,
3
+ "description" : " CSS modules (based on scss) support for TypeScript" ,
3
4
"version" : " 0.1.0" ,
4
- "main" : " build/index.js" ,
5
5
"author" :
" GodLesZ <[email protected] >" ,
6
6
"license" : " MIT" ,
7
- "description" : " CSS modules (based on scss) support for TypeScript" ,
7
+ "bugs" : " https://github.com/GodLesZ/typescript-plugin-css-module-types/issues" ,
8
+ "homepage" : " https://github.com/GodLesZ/typescript-plugin-css-module-types" ,
9
+ "repository" : " https://github.com/GodLesZ/typescript-plugin-css-module-types" ,
8
10
"keywords" : [
9
11
" css" ,
10
12
" scss" ,
13
15
" plugin" ,
14
16
" typescript"
15
17
],
18
+ "main" : " build/index.js" ,
19
+ "types" : " build/index.d.ts" ,
16
20
"files" : [
17
21
" build"
18
22
],
You can’t perform that action at this time.
0 commit comments