From 299d15b3ccb924d5198b94cda14dca2eafb2309f Mon Sep 17 00:00:00 2001 From: gabalafou Date: Fri, 13 Sep 2024 08:52:40 -0500 Subject: [PATCH 1/4] Make hover effect on dropdown admonitions more prominent --- .../styles/extensions/_sphinx_design.scss | 6 ++++ .../styles/extensions/_togglebutton.scss | 33 ++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_design.scss b/src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_design.scss index 67ad2ebaa..1820911b9 100644 --- a/src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_design.scss +++ b/src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_design.scss @@ -370,4 +370,10 @@ html { } } } + + .sd-summary-title:hover { + // Use text underlining to make the hover effect more perceivable and + // therefore more accessible. + text-decoration: underline; + } } diff --git a/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss b/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss index 1d0f87cc4..3b3152d9d 100644 --- a/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss +++ b/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss @@ -17,8 +17,32 @@ } } + // Apply this mixin to the element that will be hovered. These styles are + // intended to match what sphinx-design does for its dropdown admonitions. + @mixin icon-hover-effects { + &:hover .tb-icon { + opacity: 1; + scale: 1.1; + } + + .tb-icon { + opacity: 0.6; + } + } + // Admonition toggles .admonition { + .admonition-title { + @include icon-hover-effects; + + &:hover, + &:hover button.toggle-button { + // Use text underlining to make the hover effect more perceivable and + // therefore more accessible. + text-decoration: underline; + } + } + button.toggle-button { color: inherit; @@ -50,7 +74,7 @@ // the left border on the container's children). This makes it complicated // to get the focus ring to simultaneously cover the left border in the // header and align perfectly on the right with the body. - .admonition-title:focus-within::before { + .admonition-title:focus-within:has(:focus-visible)::before { content: ""; transform: translateX( -$admonition-left-border-width @@ -77,6 +101,13 @@ border-left: 3px solid var(--pst-color-primary); @include chevron-down; + @include icon-hover-effects; + + &:hover { + // Use text underlining to make the hover effect more perceivable and + // therefore more accessible. + text-decoration: underline; + } } // When expanded, sharpen the bottom left and right corners of the focus ring From fbf7cb6f8b62e2e3993c649b1427d299254535fd Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:40:19 +0100 Subject: [PATCH 2/4] Updates for file src/pydata_sphinx_theme/locale/en/LC_MESSAGES/sphinx.po in ja (#1979) Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> From 03872186a0c1c6560c8b572c62bb9cee3db890a3 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:41:15 +0100 Subject: [PATCH 3/4] Updates for file src/pydata_sphinx_theme/locale/en/LC_MESSAGES/sphinx.po in fr (#2000) Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> From 4fd3533e206e097e1f12452357cc967c411818c3 Mon Sep 17 00:00:00 2001 From: gabalafou Date: Sun, 6 Oct 2024 23:15:53 +0200 Subject: [PATCH 4/4] make sphinx-togglebutton selector more specific --- .../assets/styles/extensions/_togglebutton.scss | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss b/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss index 3b3152d9d..3837746fb 100644 --- a/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss +++ b/src/pydata_sphinx_theme/assets/styles/extensions/_togglebutton.scss @@ -1,5 +1,7 @@ /** * Sphinx togglebutton + * + * https://sphinx-togglebutton.readthedocs.io/en/latest/index.html */ .bd-content { @@ -30,8 +32,8 @@ } } - // Admonition toggles - .admonition { + // Collapsible admonition, implemented as
+