Skip to content

Commit 5c59f46

Browse files
committed
Add some documentation
1 parent c8ee31a commit 5c59f46

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
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)
23

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+
```
444

545
# Thanks
646

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "typescript-plugin-css-module-types",
3+
"description": "CSS modules (based on scss) support for TypeScript",
34
"version": "0.1.0",
4-
"main": "build/index.js",
55
"author": "GodLesZ <[email protected]>",
66
"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",
810
"keywords": [
911
"css",
1012
"scss",
@@ -13,6 +15,8 @@
1315
"plugin",
1416
"typescript"
1517
],
18+
"main": "build/index.js",
19+
"types": "build/index.d.ts",
1620
"files": [
1721
"build"
1822
],

0 commit comments

Comments
 (0)