Skip to content
Projets

styled-components/vscode-styled-components

Voir sur GitHub

À propos

Coloration syntaxique pour styled-components

Outils de développement

Comment ces chiffres sont mesurés

What you can do

  • Syntax highlighting for styled components in JavaScript and TypeScript.
  • Detailed CSS IntelliSense while working in styled strings.
  • Syntax error reporting.

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

vscode-styled-components

Discord

Syntax highlighting and IntelliSense for styled-components.

Syntax highlighting in action

Uses a CSS grammar built on top of language-sass and language-css.

Install

Inside VSCode, press Ctrl+P, and enter:

ext install vscode-styled-components

It should be the top result.

[Source]

Features

  • Syntax highlighting for styled components in JavaScript and TypeScript.
  • Detailed CSS IntelliSense while working in styled strings.
  • Syntax error reporting.

Usage

The styled-components extension adds highlighting and IntelliSense for styled-component template strings in JavaScript and TypeScript. See plugin configuration for information on configuring the linter and other language features.

Raising an issue

Please check the issues list to see if it has already been raised. If it has you can vote on it with a thumbsUp emoji. Issues with the most votes tend to be prioritised.

Contributing

see Contributing

Troubleshooting

There's no syntax highlighting?

Syntax Highlighting is specifically made to work with styled so make sure your default import is styled and nothing else.

See: https://github.com/styled-components/vscode-styled-components/issues/118#issuecomment-833007295

Highlighting works in files whose language mode is JavaScript, TypeScript, JavaScript React, TypeScript React, Vue, or Svelte (shown in the status bar). Color swatches and the backtick snippet work only in saved files in the two React modes (javascriptreact and typescriptreact, which the .jsx and .tsx extensions set).

Emmet tab completion isn't working

Be sure to include "emmet.triggerExpansionOnTab": true in your VSCode settings to enable tab completion.** More settings and instructions can be found here.

Emmet is auto completing HTML tags instead of CSS

This is an upstream issue in VSCode unfortunately. The root cause is here: https://github.com/microsoft/vscode/issues/119736 which itself was raised from https://github.com/microsoft/vscode/issues/51537. There was an issue raised in this repo but there's nothing that can be done on our end.

I get "unknown property: X" on a property I know is valid

Property look up comes from the css language service which in turn comes from MDN Data. If its a custom property, or something that is not in MDN you can add your own property like so: https://github.com/microsoft/typescript-styled-plugin/issues/58#issuecomment-444733368

If however you believe this property is standard and thus missing you can raise this issue with either one of the above projects; please check for any raised issue first.

Intellisense is not working!

See these issues:

Explorer des projets similaires

Chargement…