Skip to content

Commit

Permalink
fix: HTML report makes room for 4-digit line numbers #1124
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Feb 27, 2021
1 parent dc9b842 commit 83f619b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ Unreleased
they have been combined. This was requested in `issue 1108`_ and implemented
in `pull request 1110`_. Thanks, Éric Larivière.

- The HTML report has a little more room for line numbers so that 4-digit
numbers work well, fixing `issue 1124`_.

.. _issue 1108: https://github.com/nedbat/coveragepy/issues/1108
.. _pull request 1110: https://github.com/nedbat/coveragepy/pull/1110
.. _issue 1124: https://github.com/nedbat/coveragepy/issues/1124

.. _changes_54:

Expand Down
10 changes: 5 additions & 5 deletions coverage/htmlfiles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ a.nav:hover { text-decoration: underline; color: inherit; }

@media (prefers-color-scheme: dark) { #header { border-color: #333; } }

.indexfile #footer { margin: 1rem 3rem; }
.indexfile #footer { margin: 1rem 3.5rem; }

.pyfile #footer { margin: 1rem 1rem; }

#footer .content { padding: 0; color: #666; font-style: italic; }

@media (prefers-color-scheme: dark) { #footer .content { color: #aaa; } }

#index { margin: 1rem 0 0 3rem; }
#index { margin: 1rem 0 0 3.5rem; }

#header .content { padding: 1rem 3rem; }
#header .content { padding: 1rem 3.5rem; }

h1 { font-size: 1.25em; display: inline-block; }

Expand Down Expand Up @@ -122,13 +122,13 @@ h2.stats { margin-top: .5em; font-size: 1em; }

.keyhelp .key { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; }

#source { padding: 1em 0 1em 3rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

#source p { position: relative; white-space: pre; }

#source p * { box-sizing: border-box; }

#source p .n { float: left; text-align: right; width: 3rem; box-sizing: border-box; margin-left: -3rem; padding-right: 1em; color: #999; }
#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; }

@media (prefers-color-scheme: dark) { #source p .n { color: #777; } }

Expand Down
6 changes: 3 additions & 3 deletions coverage/htmlfiles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/* Don't edit this .css file. Edit the .scss file instead! */

// Dimensions
$left-gutter: 3rem;
$left-gutter: 3.5rem;


//
Expand Down Expand Up @@ -166,7 +166,7 @@ a.nav {
}

.indexfile #footer {
margin: 1rem 3rem;
margin: 1rem $left-gutter;
}

.pyfile #footer {
Expand All @@ -181,7 +181,7 @@ a.nav {
}

#index {
margin: 1rem 0 0 3rem;
margin: 1rem 0 0 $left-gutter;
}

// Header styles
Expand Down
10 changes: 5 additions & 5 deletions tests/gold/html/styled/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ a.nav:hover { text-decoration: underline; color: inherit; }

@media (prefers-color-scheme: dark) { #header { border-color: #333; } }

.indexfile #footer { margin: 1rem 3rem; }
.indexfile #footer { margin: 1rem 3.5rem; }

.pyfile #footer { margin: 1rem 1rem; }

#footer .content { padding: 0; color: #666; font-style: italic; }

@media (prefers-color-scheme: dark) { #footer .content { color: #aaa; } }

#index { margin: 1rem 0 0 3rem; }
#index { margin: 1rem 0 0 3.5rem; }

#header .content { padding: 1rem 3rem; }
#header .content { padding: 1rem 3.5rem; }

h1 { font-size: 1.25em; display: inline-block; }

Expand Down Expand Up @@ -122,13 +122,13 @@ h2.stats { margin-top: .5em; font-size: 1em; }

.keyhelp .key { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; }

#source { padding: 1em 0 1em 3rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

#source p { position: relative; white-space: pre; }

#source p * { box-sizing: border-box; }

#source p .n { float: left; text-align: right; width: 3rem; box-sizing: border-box; margin-left: -3rem; padding-right: 1em; color: #999; }
#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; }

@media (prefers-color-scheme: dark) { #source p .n { color: #777; } }

Expand Down

0 comments on commit 83f619b

Please sign in to comment.