From 586de698942ca90d60dfc5d848fd304c8add1a5f Mon Sep 17 00:00:00 2001 From: Daniel Compton Date: Thu, 19 Oct 2017 16:14:19 +1300 Subject: [PATCH] Use CSS pseudo-selectors for odd/even instead of calculating an index --- resources/day8/re_frame/trace/main.css | 3 +-- resources/day8/re_frame/trace/main.less | 3 +-- src/day8/re_frame/trace.cljs | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/day8/re_frame/trace/main.css b/resources/day8/re_frame/trace/main.css index 1824e41..0bbd9d8 100644 --- a/resources/day8/re_frame/trace/main.css +++ b/resources/day8/re_frame/trace/main.css @@ -192,8 +192,7 @@ #--re-frame-trace-- tr th:first-child { text-align: right; } -#--re-frame-trace-- tr.trace--trace-even, -#--re-frame-trace-- tr.trace--trace-even + .trace--details { +#--re-frame-trace-- tr:nth-child(even) { background: #fafafa; } #--re-frame-trace-- tr.trace--sub-create .trace--op { diff --git a/resources/day8/re_frame/trace/main.less b/resources/day8/re_frame/trace/main.less index 2a5c593..571e513 100644 --- a/resources/day8/re_frame/trace/main.less +++ b/resources/day8/re_frame/trace/main.less @@ -258,8 +258,7 @@ &.trace--trace { } - &.trace--trace-even, - &.trace--trace-even + .trace--details { + &:nth-child(even) { background: @background-gray-hint; } diff --git a/src/day8/re_frame/trace.cljs b/src/day8/re_frame/trace.cljs index 3c7efa4..cb9ad0f 100644 --- a/src/day8/re_frame/trace.cljs +++ b/src/day8/re_frame/trace.cljs @@ -183,10 +183,7 @@ :event "trace--event" :render "trace--render" :re-frame.router/fsm-trigger "trace--fsm-trigger" - nil) - (if (even? index) - "trace--trace-even" - "trace--trace-odd")])} + nil)])} [:td.trace--toggle [:button (if show-row? "▼" "▶")]]