Skip to content

Commit d5f4532

Browse files
patrickhlaukemdo
andauthored
Docs: fix overflow:auto horizontal scrollbars covering last line of code blocks (twbs#37694)
* Add dirty hack for Firefox * Disable stylelint check for function-url-quotes to make the hack go through unchallenged * Make the fix across all browsers It's not just Firefox - same issue can be seen (though slightly less horrible looking) on macOS / Chrome etc * Tweak padding, move clipboard button down slightly * Further CSS tweaks Forcing `overflow: overlay` should normalise behaviour between Chrome/Win and other implementations. While visually the Chrome/Win scrollbar still looks big and ugly, its height/spacing is now taken into account as being part of the content, so styles can be applied consistently with extra padding at the bottom * Linting fixes * Linting fixes * Apply suggestions from code review --------- Co-authored-by: Mark Otto <markd.otto@gmail.com>
1 parent ea19c3d commit d5f4532

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

site/assets/scss/_clipboard-js.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
.btn-clipboard {
4040
position: relative;
4141
z-index: 2;
42-
margin-top: .75rem;
42+
margin-top: 1.25rem;
4343
margin-right: .75rem;
4444
}

site/assets/scss/_component-examples.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,11 @@
359359
}
360360

361361
pre {
362-
padding: 0;
363-
margin-top: .625rem;
362+
padding: .25rem 0 .875rem;
363+
margin-top: .8125rem;
364364
margin-right: 1.875rem;
365-
margin-bottom: .625rem;
365+
margin-bottom: 0;
366+
overflow: overlay;
366367
white-space: pre;
367368
background-color: transparent;
368369
border: 0;

site/assets/scss/_masthead.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@
3636
@include media-breakpoint-up(lg) {
3737
padding-right: 4rem;
3838
}
39+
40+
pre {
41+
padding: 0;
42+
margin-top: .625rem;
43+
margin-right: 1.875rem;
44+
margin-bottom: .625rem;
45+
overflow: hidden;
46+
}
3947
}
4048
.btn-clipboard {
4149
position: absolute;
42-
top: -.125rem;
50+
top: -.625rem;
4351
right: 0;
4452
background-color: transparent;
4553
}

0 commit comments

Comments
 (0)