Skip to content

Commit 8e0c832

Browse files
committed
1.0.1
0 parents  commit 8e0c832

18 files changed

+2854
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = tab
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
12+
13+
[*.{json,md,yml}]
14+
indent_size = 2
15+
indent_style = space

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
package-lock.json
3+
*.vsix
4+
*.log*
5+
.*
6+
!.editorconfig
7+
!.gitignore
8+
!.vscode
9+
!.vscodeignore

.vscode/launch.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Launch Grammar",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceRoot}"
11+
]
12+
}
13+
]
14+
}

.vscodeignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
vsc-extension-quickstart.md

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changes to PostCSS Language Support
2+
3+
## 1.0.1
4+
5+
- Fixed an issue with nested selectors and combinators
6+
7+
## 1.0.0
8+
9+
- Initial release

README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# PostCSS Language Support [<img src="https://github.com/csstools/postcss-language/raw/master/icon.png" alt="PostCSS" width="90" height="90" align="right">][PostCSS Language Support]
2+
3+
[<img height="20" alt="Installs" src="https://img.shields.io/visual-studio-marketplace/i/csstools.postcss">](https://marketplace.visualstudio.com/items?itemName=csstools.postcss)
4+
[<img height="20" alt="Rating" src="https://img.shields.io/visual-studio-marketplace/stars/csstools.postcss">](https://marketplace.visualstudio.com/items?itemName=csstools.postcss)
5+
[<img height="20" alt="Support Chat" src="https://img.shields.io/badge/support-chat-blue.svg">](https://gitter.im/postcss/postcss)
6+
7+
[PostCSS Language Support] adds support for modern and experimental CSS within
8+
**Visual Studio Code**.
9+
10+
<p align="center"><img src="https://raw.githubusercontent.com/csstools/postcss-language/master/preview/custom-rules.png" alt="" width="610"></p>
11+
12+
This syntax is applied to `.css`, `.pcss` and `.postcss` files. It is also
13+
applied to `css` and `pcss` code blocks in Markdown, and also to `<style>` code
14+
blocks in HTML.
15+
16+
## Installation
17+
18+
1. Open the command palette and select **Extensions: Install Extensions**
19+
2. Search for **PostCSS Language Support**
20+
3. Click **Install**
21+
22+
### Adding Support for Emmet
23+
24+
1. Open the command palette and select **Preferences: Open Settings (JSON)**
25+
2. Add the following configuration:
26+
27+
```json
28+
{
29+
"emmet.includeLanguages": {
30+
"postcss": "css"
31+
},
32+
"emmet.syntaxProfiles": {
33+
"postcss": "css"
34+
}
35+
}
36+
```
37+
38+
## Differences from CSS Language Support
39+
40+
**PostCSS Language Support** is derived from the native
41+
**CSS Language Support** built into **Visual Studio Code**, which is itself
42+
derived from the native **CSS Language Support** for **Atom**. This language
43+
support includes the following changes:
44+
45+
### Modern CSS Features
46+
47+
- Support is added for nesting rules, including the nesting selector (`&`), the
48+
nesting at-rule (`@nest`), and `@media` and `@supports` at-rules.
49+
- Support is added for the `:blank` pseudo-class, as well as the `:is()` and
50+
`:where` functional pseudo-classes.
51+
- Support is added for `prefers-color-scheme` and `prefers-reduced-motion`
52+
within media queries.
53+
- Support is added for the `place-self` property.
54+
- Support is added for the `env()` function, as well as the `hwb()`, `lab()`,
55+
and `lch()` color functions.
56+
- Support is added for the `emoji`, `fangsong`, and `system-ui` font families.
57+
- Support is added for the `border-block`, `border-inline`, `margin-block`,
58+
`margin-inline`, `padding-block`, and `padding-inline` logical properties.
59+
- Support is added for `@custom-media` and `@custom-selector` at-rules.
60+
61+
<p align="center"><img src="https://raw.githubusercontent.com/csstools/postcss-language/master/preview/nesting.png" alt="" width="278"></p>
62+
<p align="center"><img src="https://raw.githubusercontent.com/csstools/postcss-language/master/preview/variables.png" alt="" width="402"></p>
63+
64+
### Syntactical Looseness
65+
66+
- Support is added for nesting `@extend` and `@extends` at-rules.
67+
- Support is added for functional selectors (`%placeholder`).
68+
- Support is added for the CSS Modules `:global` rule, as well as the
69+
`composes` declaration, and also `@value` declarations.
70+
- Support is added for sass `$variables`.
71+
- Support is added for single-line comments (`//`).
72+
- Support is added for `@custom-env` at-rules.
73+
- Support is added for unknown nesting at-rules, as well as unknown `@custom-`
74+
prefixed at-rules.
75+
76+
<p align="center"><img src="https://raw.githubusercontent.com/csstools/postcss-language/master/preview/modules.png" alt="" width="518"></p>
77+
<p align="center"><img src="https://raw.githubusercontent.com/csstools/postcss-language/master/preview/sassy.png" alt="" width="333"></p>
78+
79+
[PostCSS Language Support]: https://github.com/csstools/postcss-language

icon.png

9.55 KB
Loading

package.json

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"name": "postcss",
3+
"version": "1.0.1",
4+
"displayName": "PostCSS Language Support",
5+
"description": "Syntax highlighting for modern and experimental CSS in VSCode",
6+
"author": "Jonathan Neal <[email protected]>",
7+
"publisher": "csstools",
8+
"license": "CC0-1.0",
9+
"repository": "csstools/postcss-language",
10+
"homepage": "https://github.com/csstools/postcss-language#readme",
11+
"bugs": "https://github.com/csstools/postcss-language/issues",
12+
"icon": "icon.png",
13+
"galleryBanner": {
14+
"color": "#293845",
15+
"theme": "dark"
16+
},
17+
"engines": {
18+
"vscode": "^1.18.0"
19+
},
20+
"categories": [
21+
"Programming Languages"
22+
],
23+
"contributes": {
24+
"languages": [
25+
{
26+
"id": "postcss",
27+
"configuration": "./postcss.language.configuration.json",
28+
"aliases": [
29+
"PostCSS",
30+
"pcss"
31+
],
32+
"extensions": [
33+
".css",
34+
".pcss",
35+
".postcss"
36+
],
37+
"mimetypes": [
38+
"text/css",
39+
"text/x-pcss",
40+
"text/pcss"
41+
]
42+
}
43+
],
44+
"grammars": [
45+
{
46+
"scopeName": "source.css",
47+
"path": "./syntaxes/source.css.tmLanguage.json",
48+
"language": "postcss"
49+
},
50+
{
51+
"scopeName": "text.html.basic.css",
52+
"path": "./syntaxes/text.html.basic.css.tmLanguage.json",
53+
"injectTo": [
54+
"text.html"
55+
],
56+
"embeddedLanguages": {
57+
"meta.embedded.block.css": "postcss"
58+
}
59+
},
60+
{
61+
"scopeName": "text.html.markdown.css",
62+
"path": "./syntaxes/text.html.markdown.css.tmLanguage.json",
63+
"injectTo": [
64+
"text.html.markdown"
65+
],
66+
"embeddedLanguages": {
67+
"meta.embedded.block.css": "postcss"
68+
}
69+
}
70+
]
71+
},
72+
"keywords": [
73+
"css",
74+
"cssnext",
75+
"csswg",
76+
"experimental",
77+
"future",
78+
"grammar",
79+
"language",
80+
"logical",
81+
"modern",
82+
"next",
83+
"postcss",
84+
"postcss-preset-env",
85+
"spec",
86+
"specification",
87+
"stage",
88+
"syntax",
89+
"vscode",
90+
"w3c"
91+
]
92+
}

postcss.language.configuration.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"comments": {
3+
"blockComment": ["/*", "*/"]
4+
},
5+
"brackets": [
6+
["{", "}"],
7+
["[", "]"],
8+
["(", ")"]
9+
],
10+
"autoClosingPairs": [
11+
{ "open": "{", "close": "}", "notIn": ["string", "comment"] },
12+
{ "open": "[", "close": "]", "notIn": ["string", "comment"] },
13+
{ "open": "(", "close": ")", "notIn": ["string", "comment"] },
14+
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
15+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
16+
],
17+
"surroundingPairs": [
18+
["{", "}"],
19+
["[", "]"],
20+
["(", ")"],
21+
["\"", "\""],
22+
["'", "'"]
23+
],
24+
"indentationRules": {
25+
"increaseIndentPattern": "(^.*\\{[^}]*$)",
26+
"decreaseIndentPattern": "^\\s*\\}"
27+
},
28+
"folding": {
29+
"markers": {
30+
"start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/",
31+
"end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"
32+
}
33+
}
34+
}

preview/custom-rules.png

17.8 KB
Loading

preview/modules.png

11.5 KB
Loading

preview/nesting.png

10.7 KB
Loading

preview/sassy.png

9.13 KB
Loading

preview/variables.png

13.9 KB
Loading

0 commit comments

Comments
 (0)