Skip to content

Commit df307d0

Browse files
committed
rustdoc: tweak spacing in toolbar
1 parent 5b1b2e9 commit df307d0

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

src/librustdoc/html/static/css/rustdoc.css

+9-3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ xmlns="http://www.w3.org/2000/svg" fill="black" height="18px">\
3434
</g></svg>');
3535
--button-left-margin: 4px;
3636
--button-border-radius: 2px;
37+
--toolbar-button-border-radius: 6px;
38+
--code-block-border-radius: 6px;
3739
}
3840

3941
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
@@ -183,7 +185,7 @@ h1, h2, h3, h4 {
183185
grid-template-columns: 1fr max-content;
184186
grid-template-rows: 25px min-content min-content;
185187
padding-bottom: 6px;
186-
margin-bottom: 15px;
188+
margin-bottom: 11px;
187189
}
188190
.rustdoc-breadcrumbs {
189191
grid-area: main-heading-breadcrumbs;
@@ -904,6 +906,7 @@ both the code example and the line numbers, so we need to remove the radius in t
904906
flex-grow: 0;
905907
grid-area: main-heading-sub-heading;
906908
line-height: 1.25;
909+
padding-bottom: 4px;
907910
}
908911

909912
.main-heading rustdoc-toolbar, .main-heading .out-of-band {
@@ -918,6 +921,7 @@ rustdoc-toolbar {
918921
.docblock code, .docblock-short code,
919922
pre, .rustdoc.src .example-wrap {
920923
background-color: var(--code-block-background-color);
924+
border-radius: var(--code-block-border-radius);
921925
}
922926

923927
#main-content {
@@ -1315,14 +1319,14 @@ so that we can apply CSS-filters to change the arrow color in themes */
13151319

13161320
#settings.popover {
13171321
--popover-arrow-offset: 202px;
1318-
top: calc(100% - 12px);
1322+
top: calc(100% - 16px);
13191323
}
13201324

13211325
/* use larger max-width for help popover, but not for help.html */
13221326
#help.popover {
13231327
max-width: 600px;
13241328
--popover-arrow-offset: 118px;
1325-
top: calc(100% - 12px);
1329+
top: calc(100% - 16px);
13261330
}
13271331

13281332
#help dt {
@@ -1838,6 +1842,7 @@ a.tooltip:hover::after {
18381842
}
18391843
#settings-menu > a, #help-button > a, button#toggle-all-docs {
18401844
width: 80px;
1845+
border-radius: var(--toolbar-button-border-radius);
18411846
}
18421847
#sidebar-button > a {
18431848
background-color: var(--button-background-color);
@@ -1924,6 +1929,7 @@ button[disabled]#toggle-all-docs:hover {
19241929
rustdoc-toolbar span.label {
19251930
font-size: 1rem;
19261931
flex-grow: 1;
1932+
padding-bottom: 4px;
19271933
}
19281934

19291935
#sidebar-button > a:before {

tests/rustdoc-gui/item-info.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ store-position: (
2020
{"x": second_line_x, "y": second_line_y},
2121
)
2222
assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272
23-
assert: |first_line_y| != |second_line_y| && |first_line_y| == 710 && |second_line_y| == 733
23+
assert: |first_line_y| != |second_line_y| && |first_line_y| == 714 && |second_line_y| == 737
2424

2525
// Now we ensure that they're not rendered on the same line.
2626
set-window-size: (1100, 800)

tests/rustdoc-gui/scrape-examples-layout.goml

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ click: ".scraped-example .button-holder .expand"
7272
store-value: (offset_y, 4)
7373

7474
// First with desktop
75-
assert-position: (".scraped-example", {"y": 248})
76-
assert-position: (".scraped-example .prev", {"y": 248 + |offset_y|})
75+
assert-position: (".scraped-example", {"y": 252})
76+
assert-position: (".scraped-example .prev", {"y": 252 + |offset_y|})
7777

7878
// Gradient background should be at the top of the code block.
7979
assert-css: (".scraped-example .example-wrap::before", {"top": "0px"})
@@ -82,8 +82,8 @@ assert-css: (".scraped-example .example-wrap::after", {"bottom": "0px"})
8282
// Then with mobile
8383
set-window-size: (600, 600)
8484
store-size: (".scraped-example .scraped-example-title", {"height": title_height})
85-
assert-position: (".scraped-example", {"y": 277})
86-
assert-position: (".scraped-example .prev", {"y": 277 + |offset_y| + |title_height|})
85+
assert-position: (".scraped-example", {"y": 281})
86+
assert-position: (".scraped-example .prev", {"y": 281 + |offset_y| + |title_height|})
8787

8888
define-function: (
8989
"check_title_and_code_position",

0 commit comments

Comments
 (0)