Skip to content

Commit fb27d01

Browse files
authored
Rollup merge of rust-lang#102799 - rol1510:issue-100421-fix, r=notriddle
rustdoc: remove hover gap in file picker Fixes rust-lang#100421 Before: <img width="385" alt="image" src="https://user-images.githubusercontent.com/29011024/194677087-fda2db3e-126d-47cf-8152-c554e3c25a54.png"> After: <img width="388" alt="image" src="https://user-images.githubusercontent.com/29011024/194676774-7a50ace9-4060-492e-849a-ad85d9132630.png"> longe module names also wrap nicely: <img width="389" alt="image" src="https://user-images.githubusercontent.com/29011024/194678516-f2497b3a-8d50-439b-9d69-3fa9fb43b84d.png"> Also if you zoom out very far, the arrows did move to the left, in relation to the text below. This is now also fixed. <img width="818" alt="image" src="https://user-images.githubusercontent.com/29011024/194677652-cfdf129d-f5db-4f26-ac3c-3d0853e89619.png"> CSS doesn't have a lot of controll over the `::marker` element, so now the `::after` element is used to draw the arrows. Now the whole line is clickable wihtout gaps.
2 parents 38db483 + 7fdce64 commit fb27d01

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

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

+22-1
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,31 @@ details.dir-entry {
14941494
padding-left: 4px;
14951495
}
14961496

1497+
details.dir-entry > summary::after {
1498+
content: " ►";
1499+
position: absolute;
1500+
left: -15px;
1501+
top: 0px;
1502+
font-size: 80%;
1503+
padding: 2px 0px;
1504+
/* set width to cover gap between arrow and text */
1505+
width: 25px;
1506+
}
1507+
1508+
details[open].dir-entry > summary::after {
1509+
content: " ▼";
1510+
}
1511+
1512+
details.dir-entry > summary::-webkit-details-marker,
1513+
details.dir-entry > summary::marker {
1514+
display: none;
1515+
}
1516+
14971517
details.dir-entry > summary {
14981518
margin: 0 0 0 13px;
1499-
list-style-position: outside;
1519+
list-style: none;
15001520
cursor: pointer;
1521+
position: relative;
15011522
}
15021523

15031524
details.dir-entry div.folders, details.dir-entry div.files {

0 commit comments

Comments
 (0)