From c60ae4dcf255fe6f82525b4b496244bdfeec97d6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 27 Jan 2026 22:41:35 +0100 Subject: [PATCH] Add code comment explaining how the CSS selector works for deprecated items --- src/librustdoc/html/static/css/rustdoc.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index b62d6b15cf36..df92938ec820 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -2656,6 +2656,10 @@ However, it's not needed with smaller screen width because the doc/code block is .deprecated-count { display: none; } +/* +The `:not(:empty)` is a little trick to not have to add conditions in JS to hide/show the marker. +It's entirely based on whether it has content and if the setting is enabled. +*/ .hide-deprecated-items .deprecated-count:not(:empty) { display: block; margin: 10px 0;