Skip to content

Commit

Permalink
markdown: Modernize presentation of spoiler headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
karlstolley authored and timabbott committed Apr 13, 2024
1 parent f2a1c96 commit e43384b
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions web/styles/rendered_markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,23 @@
margin: 5px 0 15px;

.spoiler-header {
padding: 5px;
/* We use flexbox to display the spoiler message
and button. */
display: flex;
align-items: center;
padding: 8px 5px;
font-weight: bold;

> p {
/* Disallow margin from ordinary rendered-markdown
paragraphs. The header's vertical space is handled
independently by padding on .spoiler-header. */
margin: 0;
/* Message grows to push the arrow to the right,
but shrinks so as to allow long multi-line
spoiler messages to wrap. */
flex: 1 1 auto;
}
}

.spoiler-content {
Expand All @@ -278,9 +293,8 @@
}

.spoiler-button {
float: right;
width: 25px;
height: 25px;
/* Keep the button to a consistent right-hand edge. */
padding-right: 3px;

&:hover .spoiler-arrow {
&::before,
Expand All @@ -292,15 +306,9 @@

.spoiler-arrow {
float: right;
width: 13px;
height: 13px;
position: relative;
bottom: -5px;
left: -10px;
width: 15px;
cursor: pointer;
transition: 0.4s ease;
margin-top: 2px;
text-align: left;
transform: rotate(45deg);

&::before,
Expand Down

0 comments on commit e43384b

Please sign in to comment.