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

String interpolation based styles #49

Open
roman01la opened this issue Jul 19, 2018 · 0 comments
Open

String interpolation based styles #49

roman01la opened this issue Jul 19, 2018 · 0 comments

Comments

@roman01la
Copy link
Collaborator

Perhaps this could help someone who wants to transition from plain CSS into CLJSS. The idea is to be able to paste in existing CSS such that it would still work.

Cuerdas library has a nice macro for string interpolation which can be used in this case. It could look like this:

(deftyles button [font-size]
  "border: none;
   font-size: ~{font-size}px;
   color: #fff;
   background-color: blue;")

Or maybe we could do just fine with this

(defn button [font-size]
  "border: none;
   font-size: " font-size "px;
   color: #fff;
   background-color: blue;")

The latter would preserve syntax highlighting.

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

1 participant