From 168f1e75b31b654b1ea17edd95027a7d1845e3b2 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 14 Oct 2019 08:13:12 -0400 Subject: Annotations and context labels have to co-exist --- coverage/htmlfiles/pyfile.html | 34 ++++++------ coverage/htmlfiles/style.scss | 115 +++++++++++++++++++---------------------- 2 files changed, 70 insertions(+), 79 deletions(-) (limited to 'coverage/htmlfiles') diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html index 85f79f18..01659dd8 100644 --- a/coverage/htmlfiles/pyfile.html +++ b/coverage/htmlfiles/pyfile.html @@ -74,23 +74,25 @@

{#-#} {{line.number}}{#-#} {{line.html}} {#-#} - {% if line.annotate -%} - {{line.annotate}}{#-#} - {{line.annotate_long}}{#-#} + {% if line.context_list -%} + {#-#} {% endif -%} - {% if line.contexts -%} - - {% if line.context_list -%} - - {% endif -%} - {#-#} - {% if line.context_list -%} - - {% for context in line.context_list -%} - {{context}}{#-#} - {% endfor -%} - {#-#} - {% endif -%} + {# Things that should float right in the line. -#} + {#-#} + {% if line.annotate -%} + {{line.annotate}}{#-#} + {{line.annotate_long}}{#-#} + {% endif -%} + {% if line.contexts -%} + {#-#} + {% endif -%} + {#-#} + {# Things that should appear below the line. -#} + {% if line.context_list -%} + {#-#} + {% for context in line.context_list -%} + {{context}}{#-#} + {% endfor -%} {#-#} {% endif -%}

diff --git a/coverage/htmlfiles/style.scss b/coverage/htmlfiles/style.scss index 3e4283e8..24f7d1a1 100644 --- a/coverage/htmlfiles/style.scss +++ b/coverage/htmlfiles/style.scss @@ -368,90 +368,79 @@ $context-panel-color: #aaeeff; } } - span.annotate { - &.short { - display: inline; - position: absolute; - right: 1.5em; - } - - &.long { - @extend %in-text-popup; - max-width: 50%; - width: 30em; - right: 2.5em; - } + .annotate.long { + @extend %in-text-popup; + width: 30em; + right: 2.5em; } - &:hover span.annotate.long { + &:hover .annotate.long { display: block; } } + .r { + position: absolute; + top: 0; + right: 2.5em; + font-family: verdana, sans-serif; + } - span.annotate { + .annotate { font-family: georgia; color: #666; - float: right; padding-right: .5em; } - .ctx { - font-family: verdana, sans-serif; - white-space: nowrap; - - input { - display: none; + input { + display: none; - & ~ label { - cursor: pointer; - border-radius: .25em; - &::before { - content: "▶ "; - } - } - - &:checked ~ label { - background: $context-panel-color; - color: #666; - border-radius: .75em .75em 0 0; - &::before { - content: "▼ "; - } + & ~ .r label.ctx { + cursor: pointer; + border-radius: .25em; + &::before { + content: "▶ "; } + } - & ~ .ctxs { - display: none; + &:checked ~ .r label.ctx { + background: $context-panel-color; + color: #666; + border-radius: .75em .75em 0 0; + padding: .25em .5em; + margin: -.25em 0; + &::before { + content: "▼ "; } + } - &:checked ~ .ctxs { - display: block; - } + &:checked ~ .ctxs { + display: block; } + } - label { - color: #999; - position: absolute; - right: 2.5em; - display: inline-block; - text-align: right; - font-size: .8333em; // 10/12 - padding: .25em .5em; - &:hover { - background: mix($context-panel-color, #fff, 50%); - color: #666; - } + label.ctx { + color: #999; + display: inline-block; + padding: 0 .5em; + font-size: .8333em; // 10/12 + &:hover { + background: mix($context-panel-color, #fff, 50%); + color: #666; } + } - .ctxs { - font-family: verdana, sans-serif; - background: $context-panel-color; - padding: .25em .5em; - border-radius: .25em; - margin-right: 1.75em; - span { - display: block; - } + .ctxs { + display: none; + font-family: verdana, sans-serif; + white-space: nowrap; + background: $context-panel-color; + padding: .25em .5em; + border-radius: .25em; + margin-right: 1.75em; + span { + display: block; + text-align: right; } } } -- cgit v1.2.1