Skip to content

Commit

Permalink
Fix CSS styling for warning admonitions
Browse files Browse the repository at this point in the history
Now that warnings are wrapped in blockquotes, the CSS needs to be
adjusted for that.

This also includes a minor fix for the `::before` rule so that it only
applies to the first paragraph in a multi-paragraph warning.
  • Loading branch information
ehuss committed Aug 29, 2024
1 parent 5cbf08b commit 4b0cb6c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions theme/reference.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,40 @@ Warnings are defined using admonitions in blockquotes:
> This is bad!
*/
main .warning p {
padding: 10px 20px;
margin: 20px 0;
main .warning blockquote {
padding: 0px;
}

main .warning p::before {
main .warning blockquote p {
padding: 0px 20px;
margin: 10px 0;
}

main .warning blockquote p:first-child::before {
content: "⚠️ ";
}

.light main .warning p,
.rust main .warning p {
.light main .warning blockquote,
.rust main .warning blockquote {
border: 2px solid red;
background: #ffcece;
}

.rust main .warning p {
.rust main .warning blockquote {
/* overrides previous declaration */
border-color: #961717;
}

.coal main .warning p,
.navy main .warning p,
.ayu main .warning p {
.coal main .warning blockquote,
.navy main .warning blockquote,
.ayu main .warning blockquote {
background: #542626;
}

/* Make the links higher contrast on dark themes */
.coal main .warning p a,
.navy main .warning p a,
.ayu main .warning p a {
.coal main .warning blockquote p a,
.navy main .warning blockquote p a,
.ayu main .warning blockquote p a {
color: #80d0d0;
}

Expand Down

0 comments on commit 4b0cb6c

Please sign in to comment.