Skip to content

Commit

Permalink
Merge pull request #48 from plone/versionremoved
Browse files Browse the repository at this point in the history
Add support for versionremoved directive
  • Loading branch information
stevepiercy authored Dec 20, 2024
2 parents 82550ca + 7445580 commit 500bb05
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 227 deletions.
9 changes: 9 additions & 0 deletions docs/reference/special-theme-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ Wow, a note with an image in a margin!
````
`````
``````


## `versionremoved`

```{versionremoved} v0.1.1
Here's a version removed message.
We also support *italic*, **bold**, `code`, [links](https://www.sphinx-doc.org/), and more.
```
1 change: 1 addition & 0 deletions news/48.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for `versionremoved` directive. @stevepiercy
21 changes: 4 additions & 17 deletions src/plone_sphinx_theme/assets/styles/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
/* Snippets from:
src/pydata_sphinx_theme/assets/styles/abstracts/_mixins.scss
*/
/*********************************************
* SASS Mixins
*********************************************/
/**
* Hide the scrollbar until the element is hovered, so keep the page clean
* Use this sparingly because it's not a great UX pattern.
*/
@mixin scrollbar-on-hover() {
&:not(:hover) {
&::-webkit-scrollbar-thumb {
visibility: hidden;
}
}
}

/**
* The PyData Sphinx Theme box shadow rule
* Copied here in csae we need to re-use.
*/
@mixin pst-box-shadow() {
@mixin box-shadow() {
box-shadow:
0 0.2rem 0.5rem var(--pst-color-shadow),
0 0 0.0625rem var(--pst-color-shadow) !important;
Expand Down
69 changes: 0 additions & 69 deletions src/plone_sphinx_theme/assets/styles/abstracts/_variables.scss

This file was deleted.

45 changes: 0 additions & 45 deletions src/plone_sphinx_theme/assets/styles/base/_base.scss

This file was deleted.

95 changes: 0 additions & 95 deletions src/plone_sphinx_theme/assets/styles/base/_print.scss

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@import "../abstracts/mixins";
@import "../variables/layout";
@import "../variables/versionmodified";

div.versionremoved {
vertical-align: middle;
margin: 1.5625em auto;
padding: 0 0.6rem;
overflow: hidden;

/* break-inside has replaced page-break-inside and is widely usable since 2019 */
page-break-inside: avoid;
break-inside: avoid;
border-left: 0.2rem solid;
border-color: var(--pst-color-info);
border-radius: $admonition-border-radius;
background-color: var(--pst-color-on-background);

@include box-shadow;

position: relative;

> p {
margin-bottom: 0.6rem;
margin-top: 0.6rem;
}
}

div.versionremoved {
border-color: var(--pst-color-danger);
background-color: var(--pst-color-danger-bg);
}

span.versionmodified.removed {
&::before {
color: var(--pst-color-danger);
content: var(--pst-icon-versionmodified-removed);
}
}
1 change: 1 addition & 0 deletions src/plone_sphinx_theme/assets/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// Re-usable components across the theme
@use "components/icon-links";
@use "components/title";
@use "components/versionmodified";

@use "content/code";
@use "content/lists";
Expand Down
5 changes: 5 additions & 0 deletions src/plone_sphinx_theme/assets/styles/variables/_layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Snippets from src/pydata_sphinx_theme/assets/styles/variables/_layout.scss */
/*******************************************************************************
* UI shaping and padding
*/
$admonition-border-radius: 0.25rem;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Snippets from src/pydata_sphinx_theme/assets/styles/variables/_versionmodified.scss */
html {
/*****************************************************************************
* versionmodified
**/
--pst-icon-versionmodified-removed: var(--pst-icon-exclamation-circle);
}

Large diffs are not rendered by default.

0 comments on commit 500bb05

Please sign in to comment.