Skip to content

Commit

Permalink
toggle image styles
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimonclark committed Jan 27, 2024
1 parent 74a7f81 commit 3e8ef78
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
22 changes: 20 additions & 2 deletions sphinx/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,29 @@ html[data-theme=dark] table.element-table tr:nth-child(even) td{
body img, body svg {
background-color: transparent;
}
html[data-theme='dark'] img,
html[data-theme='dark'] svg {
html[data-theme='dark'] .bd-content img,
html[data-theme='dark'] .bd-content svg {
background-color: transparent !important;
}

/* Light mode styles */
html:not([data-theme='dark']) img.my-svg,
html:not([data-theme='dark']) svg.my-svg {
/* Define styles for light mode */
color: black; /* or other properties */
fill: black; /* for SVG paths, texts, etc. */
stroke: black; /* for SVG lines, borders, etc. */
}

/* Dark mode styles */
html[data-theme='dark'] img.my-svg,
html[data-theme='dark'] svg.my-svg {
/* Define styles for dark mode */
color: white;
fill: white;
stroke: white;
}




1 change: 1 addition & 0 deletions sphinx/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@ Electrochemical Cell


.. image:: /img/ElectrochemicalCell.svg
:class: my-svg

0 comments on commit 3e8ef78

Please sign in to comment.