about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-10-10 00:09:41 +0900
committerGitHub <noreply@github.com>2022-10-10 00:09:41 +0900
commitfb27d01922a5d7401959b95ce2c16cd02b7fac28 (patch)
treec9aecf63d858266497925683f69dc63bcf098dbe /src/librustdoc/html/static/css/rustdoc.css
parent38db483af750535774616810f1f8a4e6bdc17260 (diff)
parent7fdce6498adf1bc337f6ab259af4aa9201dbc4a5 (diff)
downloadrust-fb27d01922a5d7401959b95ce2c16cd02b7fac28.tar.gz
rust-fb27d01922a5d7401959b95ce2c16cd02b7fac28.zip
Rollup merge of #102799 - rol1510:issue-100421-fix, r=notriddle
rustdoc: remove hover gap in file picker

Fixes #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.
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 4678c4856f7..eb64147d906 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1494,10 +1494,31 @@ details.dir-entry {
 	padding-left: 4px;
 }
 
+details.dir-entry > summary::after {
+	content: " ►";
+	position: absolute;
+	left: -15px;
+	top: 0px;
+	font-size: 80%;
+	padding: 2px 0px;
+	/* set width to cover gap between arrow and text */
+	width: 25px;
+}
+
+details[open].dir-entry > summary::after {
+	content: " ▼";
+}
+
+details.dir-entry > summary::-webkit-details-marker,
+details.dir-entry > summary::marker {
+	display: none;
+}
+
 details.dir-entry > summary {
 	margin: 0 0 0 13px;
-	list-style-position: outside;
+	list-style: none;
 	cursor: pointer;
+	position: relative;
 }
 
 details.dir-entry div.folders, details.dir-entry div.files {