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

Utility macro for CSS maps #56

Closed
cigitia opened this issue Mar 7, 2015 · 2 comments
Closed

Utility macro for CSS maps #56

cigitia opened this issue Mar 7, 2015 · 2 comments

Comments

@cigitia
Copy link

cigitia commented Mar 7, 2015

The sablono.core/html macro internally uses sablono.compiler/compile-map-attr and sablono.util/camel-case-keys to convert ClojureScript maps containing CSS attributes to JavaScript maps usable by React, at compile time.

It would be convenient if a similar sablono.core/css macro or some such were created that did the same conversion at compile time by itself, so that style maps could be conveniently be created in other places, and without having to convert ClojureScript map to JavaScript object at every component render:

(css {:font-family "Comic Sans"})
; would expand to #js {:fontFamily "Comic Sans"} at compile time
@r0man
Copy link
Owner

r0man commented Feb 14, 2016

@cigitia This should now be possible in master with the attrs macro. #108

@r0man r0man closed this as completed Feb 14, 2016
@cigitia
Copy link
Author

cigitia commented Feb 14, 2016

Thanks!

r0man added a commit that referenced this issue Feb 14, 2016
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

2 participants