3 Css language server extension for [coc.nvim](https://github.com/neoclide/coc.nvim).
5 Uses [vscode-css-languageservice](https://github.com/Microsoft/vscode-css-languageservice) inside.
9 In your vim/neovim, run the command:
17 Coc has support for all features that [vscode-css-languageservice](https://www.npmjs.com/package/vscode-css-languageservice) has.
19 - `doValidation` analyzes an input string and returns syntax and lint errros.
20 - `doComplete` provides completion proposals for a given location.
21 - `doHover` provides a hover text for a given location.
22 - `findDefinition` finds the definition of the symbol at the given location.
23 - `findReferences` finds all references to the symbol at the given location.
24 - `findDocumentHighlights` finds all symbols connected to the given location.
25 - `findDocumentSymbols` provides all symbols in the given document
26 - `doCodeActions` evaluates code actions for the given location, typically to fix a problem.
27 - `findColorSymbols` evaluates all color symbols in the given document
28 - `doRename` renames all symbols connected to the given location.
29 - `getFoldingRanges` returns folding ranges in the given document.
31 ## Configuration options
37 - **css.trace.server**:
41 Valid options: ["off","messages","verbose"]
47 - **css.completion.triggerPropertyValueCompletion**:
49 By default, coc.nvim triggers property value completion after selecting a CSS property. Use this setting to disable this behavior., default: `true`
51 - **css.completion.completePropertyWithSemicolon**:
53 Insert semicolon at end of line when completing CSS properties, default: `true`
59 - **css.colorDecorators.enable**:
63 - **css.lint.compatibleVendorPrefixes**:
65 When using a vendor-specific prefix make sure to also include all other vendor-specific properties, default: `"ignore"`
67 Valid options: ["ignore","warning","error"]
69 - **css.lint.vendorPrefix**:
71 When using a vendor-specific prefix also include the standard property, default: `"warning"`
73 Valid options: ["ignore","warning","error"]
75 - **css.lint.duplicateProperties**:
77 Do not use duplicate style definitions, default: `"ignore"`
79 Valid options: ["ignore","warning","error"]
81 - **css.lint.emptyRules**:
83 Do not use empty rulesets, default: `"warning"`
85 Valid options: ["ignore","warning","error"]
87 - **css.lint.importStatement**:
89 Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored., default: `"ignore"`
91 Valid options: ["ignore","warning","error"]
93 - **css.lint.boxModel**:
97 Valid options: ["ignore","warning","error"]
99 - **css.lint.universalSelector**:
101 The universal selector (*) is known to be slow, default: `"ignore"`
103 Valid options: ["ignore","warning","error"]
105 - **css.lint.zeroUnits**:
109 Valid options: ["ignore","warning","error"]
111 - **css.lint.fontFaceProperties**:
113 @font-face rule must define 'src' and 'font-family' properties, default: `"warning"`
115 Valid options: ["ignore","warning","error"]
117 - **css.lint.hexColorLength**:
119 Hex colors must consist of three or six hex numbers, default: `"error"`
121 Valid options: ["ignore","warning","error"]
123 - **css.lint.argumentsInColorFunction**:
125 Invalid number of parameters, default: `"error"`
127 Valid options: ["ignore","warning","error"]
129 - **css.lint.unknownProperties**:
131 Unknown property., default: `"warning"`
133 Valid options: ["ignore","warning","error"]
135 - **css.lint.ieHack**:
139 Valid options: ["ignore","warning","error"]
141 - **css.lint.unknownVendorSpecificProperties**:
143 Unknown vendor specific property., default: `"ignore"`
145 Valid options: ["ignore","warning","error"]
147 - **css.lint.propertyIgnoredDueToDisplay**:
149 Property is ignored due to the display. E.g. with 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect, default: `"warning"`
151 Valid options: ["ignore","warning","error"]
153 - **css.lint.important**:
155 Import statements do not load in parallel, default: `"ignore"`
157 Valid options: ["ignore","warning","error"]
159 - **css.lint.float**:
161 Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes., default: `"ignore"`
163 Valid options: ["ignore","warning","error"]
165 - **css.lint.idSelector**:
167 Selectors should not contain IDs because these rules are too tightly coupled with the HTML., default: `"ignore"`
169 Valid options: ["ignore","warning","error"]
171 - **css.lint.unknownAtRules**:
173 Unknown at-rule., default: `"warning"`
175 Valid options: ["ignore","warning","error"]
177 - **less.completion.triggerPropertyValueCompletion**:
179 By default, coc.nvim triggers property value completion after selecting a CSS property. Use this setting to disable this behavior., default: `true`
181 - **less.completion.completePropertyWithSemicolon**:
183 Insert semicolon at end of line when completing CSS properties, default: `true`
189 - **less.colorDecorators.enable**:
193 - **less.lint.compatibleVendorPrefixes**:
195 When using a vendor-specific prefix make sure to also include all other vendor-specific properties, default: `"ignore"`
197 Valid options: ["ignore","warning","error"]
199 - **less.lint.vendorPrefix**:
201 When using a vendor-specific prefix also include the standard property, default: `"warning"`
203 Valid options: ["ignore","warning","error"]
205 - **less.lint.duplicateProperties**:
207 Do not use duplicate style definitions, default: `"ignore"`
209 Valid options: ["ignore","warning","error"]
211 - **less.lint.emptyRules**:
213 Do not use empty rulesets, default: `"warning"`
215 Valid options: ["ignore","warning","error"]
217 - **less.lint.importStatement**:
219 Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored., default: `"ignore"`
221 Valid options: ["ignore","warning","error"]
223 - **less.lint.boxModel**:
227 Valid options: ["ignore","warning","error"]
229 - **less.lint.universalSelector**:
231 The universal selector (*) is known to be slow, default: `"ignore"`
233 Valid options: ["ignore","warning","error"]
235 - **less.lint.zeroUnits**:
239 Valid options: ["ignore","warning","error"]
241 - **less.lint.fontFaceProperties**:
243 @font-face rule must define 'src' and 'font-family' properties, default: `"warning"`
245 Valid options: ["ignore","warning","error"]
247 - **less.lint.hexColorLength**:
249 Hex colors must consist of three or six hex numbers, default: `"error"`
251 Valid options: ["ignore","warning","error"]
253 - **less.lint.argumentsInColorFunction**:
255 Invalid number of parameters, default: `"error"`
257 Valid options: ["ignore","warning","error"]
259 - **less.lint.unknownProperties**:
261 Unknown property., default: `"warning"`
263 Valid options: ["ignore","warning","error"]
265 - **less.lint.ieHack**:
269 Valid options: ["ignore","warning","error"]
271 - **less.lint.unknownVendorSpecificProperties**:
273 Unknown vendor specific property., default: `"ignore"`
275 Valid options: ["ignore","warning","error"]
277 - **less.lint.propertyIgnoredDueToDisplay**:
279 Property is ignored due to the display. E.g. with 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect, default: `"warning"`
281 Valid options: ["ignore","warning","error"]
283 - **less.lint.important**:
285 Import statements do not load in parallel, default: `"ignore"`
287 Valid options: ["ignore","warning","error"]
289 - **less.lint.float**:
291 Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes., default: `"ignore"`
293 Valid options: ["ignore","warning","error"]
295 - **less.lint.idSelector**:
297 Selectors should not contain IDs because these rules are too tightly coupled with the HTML., default: `"ignore"`
299 Valid options: ["ignore","warning","error"]
301 - **less.lint.unknownAtRules**:
303 Unknown at-rule., default: `"warning"`
305 Valid options: ["ignore","warning","error"]
307 - **scss.completion.triggerPropertyValueCompletion**:
309 By default, coc.nvim triggers property value completion after selecting a CSS property. Use this setting to disable this behavior., default: `true`
311 - **scss.completion.completePropertyWithSemicolon**:
313 Insert semicolon at end of line when completing CSS properties, default: `true`
319 - **scss.colorDecorators.enable**:
323 - **scss.lint.compatibleVendorPrefixes**:
327 Valid options: ["ignore","warning","error"]
329 - **scss.lint.vendorPrefix**:
333 Valid options: ["ignore","warning","error"]
335 - **scss.lint.duplicateProperties**:
339 Valid options: ["ignore","warning","error"]
341 - **scss.lint.emptyRules**:
345 Valid options: ["ignore","warning","error"]
347 - **scss.lint.importStatement**:
351 Valid options: ["ignore","warning","error"]
353 - **scss.lint.boxModel**:
355 Do not use width or height when using padding or border, default: `"ignore"`
357 Valid options: ["ignore","warning","error"]
359 - **scss.lint.universalSelector**:
363 Valid options: ["ignore","warning","error"]
365 - **scss.lint.zeroUnits**:
369 Valid options: ["ignore","warning","error"]
371 - **scss.lint.fontFaceProperties**:
375 Valid options: ["ignore","warning","error"]
377 - **scss.lint.hexColorLength**:
381 Valid options: ["ignore","warning","error"]
383 - **scss.lint.argumentsInColorFunction**:
387 Valid options: ["ignore","warning","error"]
389 - **scss.lint.unknownProperties**:
393 Valid options: ["ignore","warning","error"]
395 - **scss.lint.ieHack**:
397 IE hacks are only necessary when supporting IE7 and older, default: `"ignore"`
399 Valid options: ["ignore","warning","error"]
401 - **scss.lint.unknownVendorSpecificProperties**:
405 Valid options: ["ignore","warning","error"]
407 - **scss.lint.propertyIgnoredDueToDisplay**:
411 Valid options: ["ignore","warning","error"]
413 - **scss.lint.important**:
417 Valid options: ["ignore","warning","error"]
419 - **scss.lint.float**:
423 Valid options: ["ignore","warning","error"]
425 - **scss.lint.idSelector**:
429 Valid options: ["ignore","warning","error"]
435 - **wxss.colorDecorators.enable**:
439 - **wxss.lint.compatibleVendorPrefixes**:
443 Valid options: ["ignore","warning","error"]
445 - **wxss.lint.vendorPrefix**:
449 Valid options: ["ignore","warning","error"]
451 - **wxss.lint.duplicateProperties**:
455 Valid options: ["ignore","warning","error"]
457 - **wxss.lint.emptyRules**:
461 Valid options: ["ignore","warning","error"]
463 - **wxss.lint.importStatement**:
467 Valid options: ["ignore","warning","error"]
469 - **wxss.lint.boxModel**:
473 Valid options: ["ignore","warning","error"]
475 - **wxss.lint.universalSelector**:
479 Valid options: ["ignore","warning","error"]
481 - **wxss.lint.zeroUnits**:
485 Valid options: ["ignore","warning","error"]
487 - **wxss.lint.fontFaceProperties**:
491 Valid options: ["ignore","warning","error"]
493 - **wxss.lint.hexColorLength**:
497 Valid options: ["ignore","warning","error"]
499 - **wxss.lint.argumentsInColorFunction**:
503 Valid options: ["ignore","warning","error"]
505 - **wxss.lint.unknownProperties**:
509 Valid options: ["ignore","warning","error"]
511 - **wxss.lint.ieHack**:
515 Valid options: ["ignore","warning","error"]
517 - **wxss.lint.unknownVendorSpecificProperties**:
521 Valid options: ["ignore","warning","error"]
523 - **wxss.lint.propertyIgnoredDueToDisplay**:
527 Valid options: ["ignore","warning","error"]
529 - **wxss.lint.important**:
533 Valid options: ["ignore","warning","error"]
535 - **wxss.lint.float**:
539 Valid options: ["ignore","warning","error"]
541 - **wxss.lint.idSelector**:
545 Valid options: ["ignore","warning","error"]