Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

CSS inside a template ('style' tag) #102

Closed
brunolemos opened this issue Dec 13, 2014 · 5 comments
Closed

CSS inside a template ('style' tag) #102

brunolemos opened this issue Dec 13, 2014 · 5 comments
Labels

Comments

@brunolemos
Copy link

I used to do this to create a reactive CSS:

<style type="text/css">
    #profile-bg {
        background-color: {{themeColor}};
    }
</style>

The closest I got with this package was this:

style
    |    body {
    |        background: red !important;
    |    }

But it's not nice to put a pipe in every line and I couldn't get the {{themeColor}} to work.
What is the suggested way?

Thanks.

@mquandalle
Copy link
Owner

Not sure if this is a recommended organization, but anyway you can try with the “dot notation”:

style.
  body {
    background-color: {{themeColor}};
  }

(Yes, meteor-jade needs some better docs)

@brunolemos
Copy link
Author

Thanks, didn't know about this dot notation. It works!

Actually, as all the content is escaped, the {{themeColor}} don't work.
That's okay for me because I will change the approach, but if there is a way to do it it would be nice to leave here for the next people.

Thanks,
Bruno.

@mquandalle
Copy link
Owner

Thank you for the bug report ! This is fixed in v0.4.3.

@chaturangalagama
Copy link

It worked for me too. Thanks a lot mquandalle..

@thomasreinecke
Copy link

great stuff, worked for me aswell 👍

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

No branches or pull requests

4 participants