Skip to content

Commit 67e93e3

Browse files
committed
introduce firefox-overrides-config
Moved recent Firefox-related styling changes under this special-case config.
1 parent 0881e44 commit 67e93e3

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/lib/devtools/defaults.cljs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@
244244
"padding: 0px 4px 0px 4px;"
245245
"margin: 1px 0px 0px 0px;")
246246

247-
:fn-header-style (css "display: inline-flex;"
248-
"align-items: center;")
247+
:fn-header-style (css)
249248
:fn-prefix-style (css)
250249
:nil-style (css (str "color: " (named-color :nil) ";"))
251250
:keyword-style (css (str "color: " (named-color :keyword) ";"))
@@ -264,14 +263,14 @@
264263
:native-reference-wrapper-style (css "position: relative;"
265264
"display: inline-flex;")
266265
:native-reference-style (css "padding: 0px 3px;"
266+
"margin: -4px 0px -2px;"
267267
"position: relative;"
268268
"top: 1px;")
269269

270270
:type-wrapper-style (css "position: relative;"
271271
"padding-left: 1px;"
272272
"border-radius: 2px;")
273-
:type-ref-style (css (str "background-color:" (named-color :type) ";")
274-
"border-radius: 0 2px 2px 0;")
273+
:type-ref-style (css "position: relative;")
275274
:type-header-style (css (d/get-common-type-header-style)
276275
"border-radius: 2px;")
277276
:type-name-style (css "padding-right: 4px;")
@@ -402,3 +401,16 @@
402401

403402
; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
404403
}))
404+
405+
; this config gets merged over defaults when Firefox is detected
406+
; see https://github.com/binaryage/cljs-devtools/pull/73
407+
(def firefox-overrides-config
408+
(delay
409+
{:fn-header-style (css "display: inline-flex;"
410+
"align-items: center;")
411+
:type-ref-style (css (str "background-color:" (named-color :type) ";")
412+
"border-radius: 0 2px 2px 0;")
413+
:native-reference-style (css "padding: 0px 3px;"
414+
"position: relative;"
415+
"top: 1px;")
416+
}))

src/lib/devtools/prefs.cljs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
(ns devtools.prefs
22
(:require-macros [devtools.prefs :refer [emit-external-config]])
3-
(:require [devtools.defaults :as defaults]))
3+
(:require [goog.labs.userAgent.browser :refer [isFirefox]]
4+
[devtools.defaults :as defaults]))
45

56
; we use delay for DCE, see https://github.com/binaryage/cljs-devtools/issues/37
67
(def default-config (delay @defaults/config))
8+
(def firefox-overrides-config (delay (if (isFirefox) @defaults/firefox-overrides-config)))
79
(def external-config (delay (emit-external-config)))
8-
(def initial-config (delay (merge @default-config @external-config)))
10+
(def initial-config (delay (merge @default-config @firefox-overrides-config @external-config)))
911

1012
(def ^:dynamic *current-config* (delay @initial-config))
1113

0 commit comments

Comments
 (0)