Add a basic styled-components injection

I've never written this sort of code before but I was able to get this to work
with the help of copy and paste and using nvim-treesitter/playground.

I had a hard time trying to understand how to indent this style of code so I let
vim do it with `=` and 2 spaces seems to match other files I looked at.

This works for a basic example, like this:

```
const Layout = styled.div`
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 100px 1fr 3rem;
`
```
This commit is contained in:
Steve Occhipinti 2021-07-25 15:35:17 +10:00 committed by Stephan Seitz
parent b5d05aaac8
commit 058e050315

View file

@ -2,20 +2,25 @@
(comment) @comment
(call_expression
function: ((identifier) @language)
arguments: ((template_string) @content
(#offset! @content 0 1 0 -1)))
function: ((identifier) @language)
arguments: ((template_string) @content
(#offset! @content 0 1 0 -1)))
(call_expression
function: ((identifier) @_name
(#eq? @_name "gql"))
arguments: ((template_string) @graphql
(#offset! @graphql 0 1 0 -1)))
function: ((identifier) @_name
(#eq? @_name "gql"))
arguments: ((template_string) @graphql
(#offset! @graphql 0 1 0 -1)))
(call_expression
function: ((identifier) @_name
(#eq? @_name "hbs"))
arguments: ((template_string) @glimmer
(#offset! @glimmer 0 1 0 -1)))
function: ((identifier) @_name
(#eq? @_name "hbs"))
arguments: ((template_string) @glimmer
(#offset! @glimmer 0 1 0 -1)))
(call_expression
function: (member_expression
object: (identifier) @_name (#eq? @_name "styled"))
arguments: ((template_string) @css (#offset! @css 0 1 0 -1)))
(regex_pattern) @regex