From 33f476da43e10fc2ab88e9d13786a60ad2d9e8d3 Mon Sep 17 00:00:00 2001 From: Daniel Compton Date: Fri, 12 Jan 2018 17:06:22 +1300 Subject: [PATCH] Add SVG reset from Chrome --- src/day8/re_frame/trace/styles.cljs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/day8/re_frame/trace/styles.cljs b/src/day8/re_frame/trace/styles.cljs index fe719b2..a90a3f5 100644 --- a/src/day8/re_frame/trace/styles.cljs +++ b/src/day8/re_frame/trace/styles.cljs @@ -117,7 +117,28 @@ [:thead {:display "table-header-group"}] [:tbody {:display "table-row-group"}] [:th :td {:display "table-cell"}] - [:tr {:display "table-row"}]]) + [:tr {:display "table-row"}] + + ;; SVG Reset + ;; From https://chromium.googlesource.com/chromium/blink/+/master/Source/core/css/svg.css + ["svg:not(:root), symbol, image, marker, pattern, foreignObject" + {:overflow "hidden"}] + ["svg:root" + {:width "100%" + :height "100%"}] + ["text, foreignObject" + {:display "block"}] + ["text" + {:white-space "nowrap"}] + ["tspan, textPath" + {:white-space "inherit"}] + ;; No :focus + ["*" + {:transform-origin "0px 0px 0px"}] + ["html|* > svg" + {:transform-origin "50% 50%"}] + + ]) (def label-mixin {:color text-color :background background-gray-hint