Skip to content

Commit

Permalink
More work towards a sunpy colour scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Sep 18, 2023
1 parent 87bd3d6 commit 2cfc2ac
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
41 changes: 36 additions & 5 deletions src/sunpy_sphinx_theme/theme/sunpy/static/sunpy_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* SunPy Variables */

/* SunPy Logo Colors */
/* SunPy Colors */
/* These should not be directly used */
--sst-sunpy-logo-primary-color: #fe7900;
--sst-sunpy-logo-secondary-color: #fed20b;
Expand Down Expand Up @@ -37,20 +37,51 @@
}

html[data-theme="light"] {
/* A lot of these colors we have inherited from pst however, I have copied them all */
/* in here to make it obvious which colors are in use, and to shield us from any */
/* upstream changes. */
--pst-color-primary: var(--sst-darker-color);
--pst-color-secondary: var(--sst-accent-color-muted);
--pst-color-accent: var(--sst-sunpy-logo-secondary-color);
--pst-color-success: rgb(0, 132, 63);
--pst-color-info: rgb(39, 107, 233);
--pst-color-warning: rgb(246, 106, 10);
--pst-color-danger: rgb(215, 45, 71);
--pst-color-background: var(--sst-lightest-color);
--pst-color-on-background: var(--sst-lightest-color);
--pst-color-surface: var(--sst-lighter-color);
--pst-color-on-surface: var(--sst-darkest-color);
--pst-color-target: rgb(243, 207, 149);
--pst-color-link: var(--sst-accent-color-muted);
--pst-color-inline-code: rgb(145, 37, 131);
--pst-color-inline-code-links: rgb(8, 93, 108);
--pst-color-text-base: var(--sst-darkest-color);
--pst-color-text-muted: var(--sst-darker-color);

--sst-footer-background-color: var(--sst-lightest-color);
}

html[data-theme="dark"] {
/* Swap primary and secondary for dark theme */
--pst-color-secondary: var(--sst-darker-color);
/* A lot of these colors we have inherited from pst however, I have copied them all */
/* in here to make it obvious which colors are in use, and to shield us from any */
/* upstream changes. */
--pst-color-primary: var(--sst-accent-color-bright);
--pst-color-secondary: var(--sst-darker-color);
--pst-color-accent: var(--sst-sunpy-logo-secondary-color);
--pst-color-success: rgb(95, 180, 136);
--pst-color-info: rgb(121, 163, 242);
--pst-color-warning: rgb(255, 146, 69);
--pst-color-danger: rgb(231, 136, 148);
--pst-color-background: var(--sst-darkest-color);
/* Make the text colours slightly lighter than default as we are using a lighter background */
--pst-color-on-background: var(--sst-darker-color);
--pst-color-surface: var(--sst-dark-color);
--pst-color-on-surface: var(--sst-lighter-color);
--pst-color-target: rgb(103, 92, 4);
--pst-color-link: var(--sst-accent-color-muted);
--pst-color-inline-code: rgb(243, 199, 238);
--pst-color-inline-code-links: rgb(63, 177, 197);
--pst-color-text-base: var(--sst-lighter-color);
--pst-color-text-muted: var(--sst-lighter-color);
--pst-color-text-muted: var(--sst-light-color);

--sst-header-background: var(--sst-darker-color);
--sst-footer-background-color: var(--sst-darker-color);
Expand Down
12 changes: 8 additions & 4 deletions test_package/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ These colors change between the dark and light themes.
span.pst-on-surface {background-color: var(--pst-color-on-surface);}
span.pst-target {background-color: var(--pst-color-target);}
span.pst-link {background-color: var(--pst-color-link);}
span.pst-code {background-color: var(--pst-color-code);}
span.pst-inline-code {background-color: var(--pst-color-inline-code);}
span.pst-inline-code-links {background-color: var(--pst-color-inline-code-links);}
span.pst-text {background-color: var(--pst-color-text-base); color: white;}
span.pst-text-muted {background-color: var(--pst-color-text-muted);}
</style>
<p>
<span class="sd-sphinx-override sd-badge pst-badge pst-primary sd-bg-text-primary">primary</span>
Expand All @@ -89,8 +91,10 @@ These colors change between the dark and light themes.
<span class="sd-sphinx-override sd-badge pst-badge pst-on-surface sd-bg-text-primary">on-surface</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-target">target</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-link">link</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-code">code</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-inline-code">inline code</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-inline-code-links">inline code links</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-text">text base</span>
<span class="sd-sphinx-override sd-badge pst-badge pst-text-muted">text muted</span>
</p>

Testing
Expand Down Expand Up @@ -120,7 +124,7 @@ Normal
Normal
`numpy.ndarray.mean`

Sometimes you need a URL: `bbc.com <https://www.bbc.co.com>`__
Sometimes you need a URL: `bbc.com <https://www.bbc.com>`__

Contributing to ``sunraster``

Expand All @@ -129,7 +133,7 @@ Admonitions

.. admonition:: Generic Admonition

You can make up your own admonition too.
Generic admnition needs content apparently

.. attention:: attention
.. caution:: caution
Expand Down

0 comments on commit 2cfc2ac

Please sign in to comment.