-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce defrules, defprop, defutil
- Loading branch information
Showing
5 changed files
with
291 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{:deps | ||
{lambdaisland/open-source {:git/url "https://github.com/lambdaisland/open-source" | ||
:git/sha "2dc2a8ef9978a3fc45e8f524b0e46253caa40fe2"}}} | ||
:git/sha "4cb6231e7df947ee8f5434e7ad48ffd8e273bcf5"}}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,71 @@ | ||
(ns poke | ||
(:require [lambdaisland.ornament :as o])) | ||
(:require | ||
[lambdaisland.ornament :as o] | ||
[lambdaisland.hiccup :as hiccup])) | ||
|
||
(set! *print-namespace-maps* false) | ||
|
||
(o/defstyled freebies-link :a | ||
{:font-size "1rem" | ||
:color "#cff9cf" | ||
:text-decoration "underline"}) | ||
|
||
(o/rules freebies-link) | ||
|
||
(freebies-link {:href "/episodes/interceptors-concepts"} "hello") | ||
|
||
[:a {:class ["poke__freebies_link"] | ||
:href "/episodes/interceptors-concepts"} "hello"] | ||
|
||
(o/defstyled foo :div | ||
{:margin size-2}) | ||
(o/css foo) | ||
(o/defprop size-2 "2rem") | ||
(o/defrules main-styles | ||
"Main application styles" | ||
[:.link {:color "blue"}] | ||
[:.link:visited {:color "purple"}] | ||
[:main | ||
[:.container {:width size-2}]]) | ||
|
||
(garden.compiler/expand size-2) | ||
main-styles | ||
(o/defutil square {:aspect-ratio 1}) | ||
o/props-registry | ||
(o/defined-garden) | ||
(o/defined-styles) | ||
(o/defstyled avatar :img | ||
{size-2 size-2} | ||
#_#_(garden.stylesheet/at-media {"print" true} [:& {:color "blue"}]) | ||
(garden.stylesheet/at-keyframes "myanim" [:100% {:height "10px"}]) | ||
) | ||
(#'garden.compiler/expand-stylesheet {size-2 size-2}) | ||
(garden.compiler/compile-css [:& {size-2 size-2}]) | ||
|
||
(hiccup/render [avatar {:style {size-2 "3rem"}}]) | ||
(map class (o/process-rules | ||
(o/rules avatar))) | ||
duration | | ||
easing-function | | ||
delay | | ||
iteration-count | | ||
direction | | ||
fill-mode | | ||
play-state | | ||
name | ||
|
||
(o/defanimation pulse | ||
:duration | ||
"2s" | ||
:keyframes | ||
["0%" "100%" {:opacity 1}] | ||
["50%" {:opacity 0.5}]) | ||
|
||
(o/css avatar) | ||
|
||
*e | ||
(o/defined-styles) | ||
|
||
(hiccup/render [:div {:class [square]}]) | ||
|
||
() |
Oops, something went wrong.