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

Support Simpler Syntax #15

Closed
arunoda opened this issue Dec 6, 2016 · 3 comments
Closed

Support Simpler Syntax #15

arunoda opened this issue Dec 6, 2016 · 3 comments

Comments

@arunoda
Copy link
Contributor

arunoda commented Dec 6, 2016

Why don't we use the familiar syntax like this:

 <style jsx>
      p {
        color: red;
      }
 </style>

But this:

 <style jsx>{`
      p {
        color: red;
      }
 `}</style>
@bogas04
Copy link

bogas04 commented Dec 6, 2016

Wouldn't JSX compiler freak out seeing {} inside a JSX tag ? And what if I want to use

p {
  color: {`theme().color`}
}

how will your change support that ?

I personally feel that using template string is the right way as it allows you to extract it to variable(s), which would likely be the case if you have more than 4-5 style rules. The above convenience doesn't serve much purpose and would require a lot of change to the babel plugin IMO.

@rauchg
Copy link
Member

rauchg commented Dec 6, 2016

@bogas04 is right. I, too, wanted that to be possible, but we got pretty close!

@rauchg rauchg closed this as completed Dec 6, 2016
@arunoda
Copy link
Contributor Author

arunoda commented Dec 6, 2016

Yep. Makes sense.

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

3 participants