-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment: add special syntax for CSS variables (#8)
* Experiment: add special syntax for CSS variables At compile time, keywords with the namespace "var" get transformed to refer to CSS variables. Map keys like `:var/font-size` become `:--font-size` and map values become `:var(font-size)`. This syntax seems nice since, at least in the "resolve" version, it *looks like* the equivalent CSS. However, this syntax means that all vars are global, unnamespaced, which is perhaps not ideal. So, this is sort of a proof of concept. Perhaps a better syntax would be eg `::*font-size*`. This is somewhat familiar due to clojure's use of earmuffs for dynamic vars, and also allows namespacing with native clojure namespaces. "Global" vars if desired could still be created as eg `:global/*font-size*`. * Switch to the proposed :*var* syntax * Handle css vars within forms, eg `[[:*var* :!important]]` * Fill out tests for var transform across all macros * Document earmuff variables in the README * Add a bit more info to the CSS vars documentation * Explicitly call out CSS Custom Property browser support * Restore deleted test cases Don't remember why I removed these, but the tests do pass
- Loading branch information
Showing
5 changed files
with
182 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters