Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 127 additions & 14 deletions astropy_sphinx_theme/astropy-unified/static/css/astropy.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
========================================================================= */

:root {
--sst-accent-color-bright: #ff5000;
--pst-font-size-h1: 2rem;
--pst-font-size-h2: 1.6rem;
--pst-font-size-h3: 1.35rem;
--pst-font-size-h4: 1.15rem;
--pst-font-size-h5: 1rem;
--pst-font-size-h6: 0.9rem;

--sst-accent-color-bright: #ff9a6c;
--sst-accent-color-muted: #ff9a6c;
}

Expand All @@ -25,20 +32,38 @@ html[data-theme="light"] {
--pst-color-secondary-text: #ffffff;
--pst-color-secondary-highlight-text: #ffffff;

--pst-color-inline-code: #912583;
--pst-color-inline-code: #913f08;
--pst-color-inline-code-links: var(--pst-color-link);
--pst-color-link-higher-contrast: var(--pst-color-link);

--pst-color-target: #f3cf95;

--sst-footer-background-color: #f6f6f6;

/* Swap the zebra row colors so the first table row differs from the
header background */
--pst-color-table-row-zebra-low-bg: var(--pst-color-on-background);
--pst-color-table-row-zebra-high-bg: var(--pst-color-surface);
}

html[data-theme="dark"] {
/* Darker page background than the sunpy theme's #222222 */
--sst-darkest-color: #151515;

--pst-color-text-base: #d6d6d6;
--pst-color-text-muted: #a8a8a8;
--pst-color-danger-bg: #5c2a31;

/* Neutral gray borders and backgrounds */
--pst-color-border: #555555;
--pst-color-border-muted: #303030;
--pst-color-on-background: #2a2a2a;
--pst-color-table-inner-border: #404040;

/* Steel blue link/card colors */
--pst-color-link: #5b9fd6;
--pst-color-link-hover: #4a85bc;
--pst-color-primary: #5b9fd6;
--pst-color-link: #6aaee0;
--pst-color-link-hover: #8dbfe7;
--pst-color-primary: #6aaee0;
--pst-color-primary-highlight: #4a85bc;
--sd-color-primary-highlight: #4a85bc;

Expand All @@ -48,21 +73,27 @@ html[data-theme="dark"] {
--pst-color-secondary--text: #14181e;
--pst-color-secondary-highlight-text: #14181e;

--pst-color-inline-code: #f3c7ee;
--pst-color-inline-code-links: #5b9fd6;
--pst-color-link-higher-contrast: #5b9fd6;
--pst-color-inline-code: #fbaa74;
--pst-color-inline-code-links: #6aaee0;
--pst-color-link-higher-contrast: #6aaee0;

--pst-color-target: #5a3c19;
--pst-color-target: #54311c;

--sst-footer-background-color: #282828;
--sst-footer-background-color: #2a2a2a;

/* Swap the zebra row colors so the first table row differs from the
header background. The odd rows are darker than the on-background
color to widen the stripe contrast. */
--pst-color-table-row-zebra-low-bg: #262626;
--pst-color-table-row-zebra-high-bg: var(--pst-color-surface);
}

/* =========================================================================
Header / Navigation
========================================================================= */
/* Ensure header bar hover color doesn't use blue links*/
.bd-header a.navbar-brand {
color: var(--sst-accent-color-muted);
color: var(--sst-accent-color-muted) !important;
}

.navbar-brand:hover,
Expand All @@ -75,7 +106,11 @@ html[data-theme="dark"] {
}

.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover {
color: var(--sst-accent-color-muted);
color: var(--sst-accent-color-muted) !important;
}

.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover:before {
border-bottom-color: var(--sst-accent-color-muted) !important;
}

.concertina-toggle.dropdown-item:hover,
Expand All @@ -90,6 +125,11 @@ html[data-theme="dark"] {
color: var(--sst-accent-color-muted);
}

/* Theme toggle and GitHub icon hover color */
html .pst-navbar-icon:hover {
color: var(--sst-accent-color-muted) !important;
}

/* Selected theme in the light/dark mode dropdown */
html[data-theme="light"] .theme-switch-button + .dropdown-menu {
--bs-dropdown-link-active-color: var(--pst-color-link);
Expand All @@ -106,6 +146,31 @@ html[data-theme="dark"] .bd-sidebar-primary {
border-right-color: #666666;
}

/* =========================================================================
Layout
========================================================================= */

.bd-article {
padding-top: 0.75rem;
}

.section {
margin-bottom: 1.6rem;
}

p {
margin-bottom: 0.7rem;
}

div.sidebar-primary-item > a.logo {
display: flex;
flex-direction: column;
}

img.index-logo {
margin-bottom: 1rem;
}

/* =========================================================================
Footer
========================================================================= */
Expand All @@ -118,19 +183,32 @@ html[data-theme="dark"] .bd-footer {
border-top: 1px solid #666666;
}

/* =========================================================================
Headings
========================================================================= */

.bd-content h1 {
margin-top: 0;
}

.bd-content h2 {
border-bottom: 1px solid var(--pst-color-border);
padding-bottom: 0.3rem;
}

/* =========================================================================
Admonitions (dark mode)
========================================================================= */

/* Muted slate blue for general admonitions (note, important, etc.) */
html[data-theme="dark"] .admonition {
border-color: var(--pst-color-link);
border-color: #2e6da4;
}
html[data-theme="dark"] .admonition > .admonition-title {
background-color: #1c4378;
}
html[data-theme="dark"] .admonition > .admonition-title:after {
color: #5b9fd6;
color: #6aaee0;
}

/* Orange theming for warning admonitions */
Expand All @@ -148,13 +226,48 @@ html[data-theme="dark"] .admonition.warning > .admonition-title:after {
Typography / Code
========================================================================= */

/* Give dark-mode text selections an explicit translucent steel blue.
Without it, the browser's inactive selection color for a dark color
scheme is nearly black, so a selection almost vanishes once the
window loses focus. */
html[data-theme="dark"] ::selection {
background-color: rgba(106, 174, 224, 0.35);
}

.field-list ul {
padding-left: 2em;
}

code.literal {
background-color: var(--pst-color-surface);
border: 1px solid var(--pst-color-border);
border-radius: 0.25rem;
padding: 0.1rem 0.25rem;
}

/* Brighten the Nord comment, prompt, and number colors in dark mode
for contrast against the code block background */
html[data-theme="dark"] .highlight .c,
html[data-theme="dark"] .highlight .ch,
html[data-theme="dark"] .highlight .cm,
html[data-theme="dark"] .highlight .cpf,
html[data-theme="dark"] .highlight .c1,
html[data-theme="dark"] .highlight .cs,
html[data-theme="dark"] .highlight .sd,
html[data-theme="dark"] .highlight .gp {
color: #929cb0;
}

html[data-theme="dark"] .highlight .m,
html[data-theme="dark"] .highlight .mb,
html[data-theme="dark"] .highlight .mf,
html[data-theme="dark"] .highlight .mh,
html[data-theme="dark"] .highlight .mi,
html[data-theme="dark"] .highlight .mo,
html[data-theme="dark"] .highlight .il {
color: #bd9ab7;
}

/* Prevent unnecessary vertical scrollbars for MathJax equations */
mjx-container {
overflow: visible !important;
Expand Down
1 change: 1 addition & 0 deletions astropy_sphinx_theme/astropy-unified/theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ inherit = "sunpy"
sst_project_name = "Astropy"
sst_site_root = "https://astropy.org"
goatcounter_analytics_url = "https://astropy.goatcounter.com/count"
pygments_dark_style = "nord"
navbar_links = [
["About",
[
Expand Down
Loading