Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight support #19

Open
eugeneross opened this issue Jun 9, 2018 · 7 comments
Open

Highlight support #19

eugeneross opened this issue Jun 9, 2018 · 7 comments

Comments

@eugeneross
Copy link

Hey there!

So, I really think I can get some good use out of your library. However, highlighting is unfortunately not supported for your methods (at least in VScode).

Any idea on how to support proper syntax highlighting? I really enjoy having the ability to do:

${is('outline')`
    background: transparent;
    color: ${colors.primary};
    box-shadow: inset 0px 0px 0px 1px;
  `}

instead of:

${props => props.outline && css`
    background: transparent;
    color: ${colors.primary};
    box-shadow: inset 0px 0px 0px 1px;
  `}
@SaraVieira
Copy link
Contributor

Hey!

I get that too, I can try to fork the vscode plugin for styled components and see where that leads me

@eugeneross
Copy link
Author

@SaraVieira Awesome 😃

@VdeVentura
Copy link

Hey @SaraVieira ! did u manage to make any progress on supporting highlighting for this?

@SaraVieira
Copy link
Contributor

I'mma be honest I completly forgot about this but I will now take a look at the vscode plugin for styled components

@SaraVieira
Copy link
Contributor

The main idea would be to pick up this: https://github.com/styled-components/vscode-styled-components and extend it

@luke-john
Copy link

As an alternative you could use typescript-styled-plugin,

by adding to a tsconfig.json with the following contents

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-styled-plugin",
        "tags": ["styled", "css", "sty", "is", "isNot", "isOr", "isSomeNot" ]
      }
    ]
  }
}

This doesn't require the rest of your project to be typescript, and works for javascript files.

@SaraVieira SaraVieira pinned this issue Jan 8, 2019
@eugeneross
Copy link
Author

@luke-john I've added what you suggested in a jsconfig.json file but I still can't seem to see any highlighting when referencing is like so:

 ${is('red')`
    background: red;
  `}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants