Skip to content

Commit

Permalink
ENH: Adapt target viewcode to tango highlighting style (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Apr 22, 2022
1 parent 2e88b0f commit 281e103
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinxext.rediraffe",
"sphinx.ext.viewcode",
]

# -- Internationalization ------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions src/pydata_sphinx_theme/assets/styles/base/_color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ html[data-theme="light"] {
--pst-color-preformatted-background: var(--pst-color-background-up);
--pst-color-preformatted-shadow: var(--pst-color-shadow);

// targeted viewcode
--pst-color-viewcode-target-border: rgb(170, 204, 153);
--pst-color-viewcode-target-background: rgb(244, 222, 191);

/*****************************************************************************
* layout
*/
Expand Down Expand Up @@ -232,6 +236,10 @@ html[data-theme="dark"] {
--pst-color-preformatted-background: var(--pst-color-background-up);
--pst-color-preformatted-shadow: var(--pst-color-shadow);

// targeted viewcode
--pst-color-viewcode-target-border: rgb(170, 204, 153);
--pst-color-viewcode-target-background: rgb(35, 55, 83);

/*****************************************************************************
* layout
*/
Expand Down
6 changes: 3 additions & 3 deletions src/pydata_sphinx_theme/assets/styles/content/_api.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ span.highlighted {
}

.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
background-color: var(--pst-color-viewcode-target-background);
border-top: 1px solid var(--pst-color-viewcode-target-border);
border-bottom: 1px solid var(--pst-color-viewcode-target-border);
}

0 comments on commit 281e103

Please sign in to comment.