Patch default cljs-devtools styles to wrap normally

We don't want to hard-code styles to make this future-proof.
This commit is contained in:
Antonin Hildebrand 2017-10-30 19:52:44 +01:00
parent cf81870e13
commit 94b6d64f2b
1 changed files with 14 additions and 2 deletions

View File

@ -21,10 +21,22 @@
(def default-cljs-devtools-prefs @devtools.prefs/default-config)
(defn reset-wrapping [css-string]
(str/replace css-string #"white-space:nowrap;" ""))
(def customized-cljs-devtools-prefs
{:header-style ""
{; Override some cljs-devtools default styles.
; The goal here is to make default styles more flexible and wrap at the edge of our panel (we don't want horizontal
; scrolling). Technically we want to remove all 'white-space:no-wrap'.
; See https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/defaults.cljs
:header-style (reset-wrapping (:header-style default-cljs-devtools-prefs))
:expandable-style (reset-wrapping (:expandable-style default-cljs-devtools-prefs))
:item-style (reset-wrapping (:item-style default-cljs-devtools-prefs))
; Hide the index spans on the left hand of collections. Shows how many elements in a collection.
:none-style "display: none"
:index-tag [:span :none-style] ;;; Hide the index spans on the left hand of collections. Shows how many elements in a collection.
:index-tag [:span :none-style]
; Our JSON renderer does not have hierarchy depth limit,
; See https://github.com/binaryage/cljs-devtools/blob/master/src/lib/devtools/formatters/budgeting.cljs
:initial-hierarchy-depth-budget false})
(def effective-cljs-devtools-prefs (merge default-cljs-devtools-prefs customized-cljs-devtools-prefs))