(css-custom-property-value nm)
(css-custom-property-value el nm)
Gets computed style for css custom property. First checks for the computed sytle on the element, if supplied. If element is not supplied, checks for the computed style on the root html. Returns a string.
Gets computed style for css custom property. First checks for the computed sytle on the element, if supplied. If element is not supplied, checks for the computed style on the root html. Returns a string.
(css-custom-property-value-data nm)
(css-custom-property-value-data el nm)
Gets computed style for css custom property. First checks for the computed style on the element, if supplied. If element is not supplied, checks for the computed style on the root html. Returns a map of values.
Gets computed style for css custom property. First checks for the computed style on the element, if supplied. If element is not supplied, checks for the computed style on the root html. Returns a map of values.
(el-idx el)
Get index of element, relative to its parent
Get index of element, relative to its parent
(mouse-down-a11y f & args)
Sets up a partial attributes map for using on-mouse-down
instead of on-click
.
Intended for buttons, switches, checkboxes, radios, etc.
The function passed in may accept any number of args, but the last arg needs to be the event.
Contrived example with reagent:
(defn sidenav-item-handler [label modal? e] (domo/scroll-into-view! (domo/qs-data= "foo-bar" label)) (domo/scroll-by! {:y -50}) (when modal? (dismiss-popover! e)))
(defn my-reagent-component [{:keys [coll modal?]}] (into [:ul] (for [{:keys [label]} coll] [:li [button (merge-attrs (sx :.pill ...) (mouse-down-a11y sidenav-item-handler label modal?)) label]])))
Sets up a partial attributes map for using `on-mouse-down` instead of `on-click`. Intended for buttons, switches, checkboxes, radios, etc. The function passed in may accept any number of args, but the last arg needs to be the event. Contrived example with reagent: (defn sidenav-item-handler [label modal? e] (domo/scroll-into-view! (domo/qs-data= "foo-bar" label)) (domo/scroll-by! {:y -50}) (when modal? (dismiss-popover! e))) (defn my-reagent-component [{:keys [coll modal?]}] (into [:ul] (for [{:keys [label]} coll] [:li [button (merge-attrs (sx :.pill ...) (mouse-down-a11y sidenav-item-handler label modal?)) label]])))
(observe-intersection {:keys [element intersecting not-intersecting f threshold
root-margin]
:or {threshold 0.1 root-margin "0px"}})
(on-key-down-tab-navigation e)
If arrow keys are pressed when an element is focused, this will properly
handle tab navigation. The element which has focus, and all of its siblings
elements, must have a role
of tab
. All the siblings must be direct
children of an element with a role
of tablist
.
If arrow keys are pressed when an element is focused, this will properly handle tab navigation. The element which has focus, and all of its siblings elements, must have a `role` of `tab`. All the siblings must be direct children of an element with a `role` of `tablist`.
(raf f)
Sugar for (js/requestAnimationFrame f)
Sugar for (js/requestAnimationFrame f)
(screen-quadrant node)
Pass a dom node and get a tuple back reprenting the quadrant in which the center of the node lives. (screen-quadrant (js/document.getElementById "my-id")) => [:top :left]
Pass a dom node and get a tuple back reprenting the quadrant in which the center of the node lives. (screen-quadrant (js/document.getElementById "my-id")) => [:top :left]
(screen-quadrant-from-point x y)
Pass an x and y val and get a tuple back reprenting the quadrant in which the point lives. (screen-quadrant 10 20) => [:top :left]
Pass an x and y val and get a tuple back reprenting the quadrant in which the point lives. (screen-quadrant 10 20) => [:top :left]
(scroll-into-view! el)
(scroll-into-view! el
{:keys [inline block behavior]
:or {block "start" inline "nearest" behavior "auto"}})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close