├── .gitignore ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs ├── demo.png └── logo.png ├── package-lock.json ├── package.json └── syntaxes └── es6-inline-css.json /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .history/** 4 | .gitignore 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | # 0.1.0 (2018-08-16) 7 | 8 | 9 | ### Features 10 | 11 | * syntax highlighting for CSS in ES6 template literals ([f566f32](https://github.com/bashmish/es6-string-css/commit/f566f32)) 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Mikhail Bashkirov 4 | 5 | Copyright (c) 2018 Tobimori 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ES6 String CSS 2 | > [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=bashmish.es6-string-css) 3 | 4 | Adds syntax highlight support for code, placed in ES6 template literals: 5 | - CSS 6 | 7 | ## Installation 8 | 9 | - Install `es6-string-css` from extensions (`ctrl + shift + x`) 10 | 11 | ## Example 12 | 13 | ![Example](docs/demo.png) 14 | 15 | ## Usage 16 | 17 | Simply insert `css` or the comment `/*css*/`, `/*inline-css*/` before a template literal. 18 | 19 | > Tip: Comment in the beginning of untagged template literal is required. 20 | 21 | ## Requirements 22 | 23 | - Visual Studio Code v1.19.0 recommended 24 | 25 | ## Credits 26 | 27 | This is a fork of the awesome extension [es6-string-html](https://github.com/mydesireiscoma/es6-string-html/). -------------------------------------------------------------------------------- /docs/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bashmish/es6-string-css/9a145b69b6409905503e9be0193b72992e571011/docs/demo.png -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bashmish/es6-string-css/9a145b69b6409905503e9be0193b72992e571011/docs/logo.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es6-string-css", 3 | "version": "0.1.0", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es6-string-css", 3 | "displayName": "es6-string-css", 4 | "description": "Highlight CSS language in ES6 template literals", 5 | "version": "0.1.0", 6 | "publisher": "bashmish", 7 | "icon": "docs/logo.png", 8 | "engines": { 9 | "vscode": "^1.19.0" 10 | }, 11 | "galleryBanner": { 12 | "color": "#dedede", 13 | "theme": "light" 14 | }, 15 | "repository": { 16 | "url": "https://github.com/bashmish/es6-string-css" 17 | }, 18 | "bugs": { 19 | "url": "https://github.com/bashmish/es6-string-css/issues" 20 | }, 21 | "categories": [ 22 | "Programming Languages" 23 | ], 24 | "keywords": [ 25 | "javascript", 26 | "es6", 27 | "css", 28 | "lit-css", 29 | "lit-html" 30 | ], 31 | "contributes": { 32 | "grammars": [ 33 | { 34 | "injectTo": [ 35 | "source.js", 36 | "source.ts", 37 | "source.jsx", 38 | "source.tsx" 39 | ], 40 | "scopeName": "inline.es6-css", 41 | "path": "./syntaxes/es6-inline-css.json", 42 | "embeddedLanguages": { 43 | "meta.embedded.block.css": "css" 44 | } 45 | } 46 | ] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /syntaxes/es6-inline-css.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [ 3 | "js", 4 | "jsx", 5 | "ts", 6 | "tsx" 7 | ], 8 | "injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string", 9 | "injections": { 10 | "L:source": { 11 | "patterns": [ 12 | { 13 | "match": "<", 14 | "name": "invalid.illegal.bad-angle-bracket.html" 15 | } 16 | ] 17 | } 18 | }, 19 | "patterns": [ 20 | { 21 | "begin": "(.?(css))(`)", 22 | "end": "(`)", 23 | "beginCaptures": { 24 | "1": { 25 | "name": "variable.parameter" 26 | } 27 | }, 28 | "patterns": [ 29 | { 30 | "include": "source.ts#template-substitution-element" 31 | }, 32 | { 33 | "include": "source.css" 34 | } 35 | ] 36 | }, 37 | { 38 | "begin": "(\\s?\\/?\\*?\\s?(css|inline-css)\\s?\\*?\\/?\\s?)(`)", 39 | "beginCaptures": { 40 | "1": { 41 | "name": "comment.block" 42 | } 43 | }, 44 | "end": "(`)", 45 | "patterns": [ 46 | { 47 | "include": "source.ts#template-substitution-element" 48 | }, 49 | { 50 | "include": "source.css" 51 | } 52 | ] 53 | }, 54 | { 55 | "begin": "(?<=\\=|\\:)\\s+(\\/\\/\\s?(css|inline-css)\\s?$)", 56 | "beginCaptures": { 57 | "1": { 58 | "name": "comment.line" 59 | } 60 | }, 61 | "end": "(`)", 62 | "patterns": [ 63 | { 64 | "begin": "(\\G)", 65 | "end": "(`)" 66 | }, 67 | { 68 | "include": "source.ts#template-substitution-element" 69 | }, 70 | { 71 | "include": "source.css" 72 | } 73 | ] 74 | } 75 | ], 76 | "scopeName": "inline.es6-css" 77 | } 78 | --------------------------------------------------------------------------------