Skip to content

Commit

Permalink
Fix 1px gap in admonition design (#624)
Browse files Browse the repository at this point in the history
This has always been a bug that we didn't catch. This PR also fixes that
deprecations had a rounded border.
  • Loading branch information
Eric-Arellano authored Aug 26, 2024
1 parent 2e94899 commit 2ae2909
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/qiskit_sphinx_theme/assets/styles/_admonitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ p.topic-title {
}
}

.admonition p.admonition-title,
p.topic-title {
// We have to add one pixel or else the ::before vertical line has a gap.
margin-left: -0.5625rem;
}

// Admonitions are complex because they use a 3px left border with a different color than the rest
// of the div. If we naively used `border-left`, we'd end up with a weird-looking diagonal, as
// described at
Expand Down Expand Up @@ -149,6 +155,13 @@ div.deprecated {
}
}

div.deprecated,
div.versionadded,
div.versionchanged,
div.versionremoved {
border-radius: 0;
}

div.deprecated::before {
background: var(--qiskit-color-warning-border);
content: "";
Expand All @@ -163,7 +176,7 @@ span.deprecated {
background-color: var(--qiskit-color-warning-background);
font-size: var(--admonition-title-font-size);
line-height: 1.3;
margin: 0 -0.5rem 0.25rem -0.55rem;
margin: 0 -0.5625rem 0.25rem -0.55rem;
padding: 0.4rem;
position: relative;
display: block;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2ae2909

Please sign in to comment.