update docset and support indentType

master
宇天 2021-10-14 09:36:37 +08:00
parent e64dd05e4c
commit 6c822d9a9d
2 changed files with 18 additions and 4 deletions

View File

@ -18,6 +18,8 @@ let prefixer
let options = { let options = {
compileOnSave: true, compileOnSave: true,
autoPrefixer: true, autoPrefixer: true,
indentType: 'space',
indentWidth: 1,
output: 'compressed', output: 'compressed',
exclude: '' exclude: ''
} }
@ -32,7 +34,9 @@ function render(style, file) {
return ( return (
scss.renderSync({ scss.renderSync({
file, file,
outputStyle: style outputStyle: style,
indentType: options.indentType,
indentWidth: options.indentWidth
}).css + '' }).css + ''
).trim() ).trim()
} catch (err) { } catch (err) {

View File

@ -2,7 +2,7 @@
"name": "scss-to-css", "name": "scss-to-css",
"displayName": "scss-to-css", "displayName": "scss-to-css",
"description": "🔥 The easiest way to compile scss file to css. And autoprefixer at the same time.", "description": "🔥 The easiest way to compile scss file to css. And autoprefixer at the same time.",
"version": "3.1.1", "version": "3.2.0",
"publisher": "yutent", "publisher": "yutent",
"author": "Yutent [@yutent]", "author": "Yutent [@yutent]",
"icon": "logo.png", "icon": "logo.png",
@ -46,17 +46,27 @@
"Scss2css.autoPrefixer": { "Scss2css.autoPrefixer": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,
"description": "will autoprefixer ?(You can add .browserslistrc file to the workspace root path)" "description": "Will autoprefixer ?(You can add .browserslistrc file to the workspace root path)"
}, },
"Scss2css.output": { "Scss2css.output": {
"type": "string", "type": "string",
"default": "compressed", "default": "compressed",
"description": "css file output style. It can be one of these [nested, expanded, compact or compressed] .\n Also can be one more styles set (split with '|'), eg. compact | compressed \n Notice: It will auto rename the result css file" "description": "Css file output style. Dart Sass supports two output styles (expanded, compressed) .\n You can set one or two styles (split with '|'), eg. expanded | compressed \n Notice: It will auto rename the result css file"
}, },
"Scss2css.exclude": { "Scss2css.exclude": {
"type": "string", "type": "string",
"default": "", "default": "",
"description": "The RegExp of path what you can to ignore(the `var.scss file` will never be compiled)。" "description": "The RegExp of path what you can to ignore(the `var.scss file` will never be compiled)。"
},
"Scss2css.indentType": {
"type": "string",
"default": "space",
"description": "Whether the generated CSS should use spaces or tabs for indentation. \n The default value is space."
},
"Scss2css.indentWidth": {
"type": "number",
"default": "2",
"description": "How many spaces or tabs (depending on indentType) should be used per indentation level in the generated CSS. It must be between 0 and 10 (inclusive)."
} }
} }
} }