Skip to content

Commit e022ba5

Browse files
committed
Remove the language/copy-button bar above a code block
The copy button is still there; it now overlaps the right-top corner of the code. This is only a problem if the first line of the code block is longer than the screen is wide, but: 1. This is not super common; 2. It's still mostly readable; 3. We're not the only ones with this unfortunate css; 4. I have no idea how to do it better.
1 parent a693a2e commit e022ba5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sass/_extra.scss

+16
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,19 @@ blockquote > p:first-child {
3636
code {
3737
font-size: 1rem;
3838
}
39+
40+
/* Remove the padding at the top of a code block to make space for the
41+
* language/copybutton bar. */
42+
pre {
43+
padding-top: .3rem;
44+
/* To ensure that top and bottom padding are definitely the same, even if
45+
* abridge updates its styles, let's set the padding-bottom to this value
46+
* too. At the time of writing (2024-09-15), this is the same as abridge's
47+
* value (and hence doesn't change anything). */
48+
padding-bottom: .3rem;
49+
}
50+
51+
/* Actually remove the language/copybutton bar at the top of a code block. */
52+
pre code[data-lang]::before {
53+
display: none;
54+
}

0 commit comments

Comments
 (0)