From 121f352f6a6e68e98ba4d9e635012bb8a5b2a132 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 20 Dec 2024 03:24:46 -0800 Subject: [PATCH 1/2] Add support for versionremoved directive Note that I added a snippet in the Kitchen Sink to preview the change. I have an open PR in https://github.com/sphinx-themes/sphinx-themes.org/pull/163 to add it upstream. I can remove this snippet, if you prefer, or you can clobber it the next time you run a sync. I'll also attach a screenshot. - Closes #2086 --- docs/examples/kitchen-sink/admonitions.rst | 7 +++++++ .../assets/styles/components/_versionmodified.scss | 11 +++++++---- .../assets/styles/variables/_versionmodified.scss | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/examples/kitchen-sink/admonitions.rst b/docs/examples/kitchen-sink/admonitions.rst index 8789c0d81..3cbabecc2 100644 --- a/docs/examples/kitchen-sink/admonitions.rst +++ b/docs/examples/kitchen-sink/admonitions.rst @@ -121,3 +121,10 @@ Sphinx provides several different types of admonitions. .. deprecated:: v0.1.1 Here's a deprecation message. + +``versionremoved`` +================== + +.. versionremoved:: v0.1.1 + + Here's a version removed message. diff --git a/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss b/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss index 4151482b8..6397cb786 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss @@ -1,6 +1,7 @@ div.versionadded, div.versionchanged, -div.deprecated { +div.deprecated, +div.versionremoved { vertical-align: middle; margin: 1.5625em auto; padding: 0 0.6rem; @@ -34,7 +35,8 @@ div.versionchanged { background-color: var(--pst-color-warning-bg); } -div.deprecated { +div.deprecated, +div.versionremoved { border-color: var(--pst-color-danger); background-color: var(--pst-color-danger-bg); } @@ -64,9 +66,10 @@ span.versionmodified.changed { } } -span.versionmodified.deprecated { +span.versionmodified.deprecated, +span.versionmodified.removed { &::before { color: var(--pst-color-danger); - content: var(--pst-icon-versionmodified-deprecated); + content: var(--pst-icon-versionmodified-removed); } } diff --git a/src/pydata_sphinx_theme/assets/styles/variables/_versionmodified.scss b/src/pydata_sphinx_theme/assets/styles/variables/_versionmodified.scss index 20432fbd1..6dd7754b1 100644 --- a/src/pydata_sphinx_theme/assets/styles/variables/_versionmodified.scss +++ b/src/pydata_sphinx_theme/assets/styles/variables/_versionmodified.scss @@ -7,4 +7,5 @@ html { --pst-icon-versionmodified-added: var(--pst-icon-exclamation-circle); --pst-icon-versionmodified-changed: var(--pst-icon-exclamation-circle); --pst-icon-versionmodified-deprecated: var(--pst-icon-exclamation-circle); + --pst-icon-versionmodified-removed: var(--pst-icon-exclamation-circle); } From 4737ce7b9584cd2c4c00636c2e675c561d2b712b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 20 Dec 2024 03:37:33 -0800 Subject: [PATCH 2/2] Break out possible unique icon --- .../assets/styles/components/_versionmodified.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss b/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss index 6397cb786..2bbf759f3 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_versionmodified.scss @@ -66,7 +66,13 @@ span.versionmodified.changed { } } -span.versionmodified.deprecated, +span.versionmodified.deprecated { + &::before { + color: var(--pst-color-danger); + content: var(--pst-icon-versionmodified-deprecated); + } +} + span.versionmodified.removed { &::before { color: var(--pst-color-danger);