Skip to content

Commit

Permalink
Branding updates to support light and dark themes (NCAR#192)
Browse files Browse the repository at this point in the history
* update NSF NCAR logos to work in light and dark modes

* streamline custom css

* adjust custom colors to work a bit better in light and dark modes
  • Loading branch information
kafitzgerald authored Jan 31, 2024
1 parent 0b68e5e commit 98edf75
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 35 deletions.
1 change: 1 addition & 0 deletions docs/_static/images/logos/NSF_NCAR_light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 0 additions & 27 deletions docs/_static/style.css

This file was deleted.

28 changes: 24 additions & 4 deletions docs/_static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@
max-width: none !important;
}

.custom-title {
font-weight: bold;
color: #012169;
text-align: left;
/* override the default image top css */
.sd-card-img-top {
width: 15% !important;
position: absolute !important;
padding-left: 10px;
min-width: 50px;
top: 50%;
transform: translateY(-50%);

}

/* override the default background image behavior */
.sd-card-img {
height: auto;
}

.custom-body {
text-align: left;
margin-left: max(45px, 15%);
}

html[data-theme="light"] {
--pst-color-primary: #012169;
--pst-color-secondary: #1A658F;
}

html[data-theme="dark"] {
--pst-color-primary: #53565A;
--pst-color-secondary: #1A658F;
}
10 changes: 7 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ def __getattr__(cls, name):

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '_static/images/logos/NSFNCAR_lockup_light.svg'
html_theme_options = {
"logo": {
"image_light": '_static/images/logos/NSF_NCAR_light.svg',
"image_dark": '_static/images/logos/NSF_NCAR_dark.svg',
}
}

# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand All @@ -250,7 +255,7 @@ def __getattr__(cls, name):
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ["style.css"]
html_css_files = ["theme_overrides.css"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -367,5 +372,4 @@ def update_gallery(app: Sphinx):

# Allow for changes to be made to the css in the theme_overrides file
def setup(app):
app.add_css_file('theme_overrides.css')
app.connect("builder-inited", update_gallery)
2 changes: 1 addition & 1 deletion docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Documentation
* Remove reference to old ncar conda channel from installation docs by `Katelyn FitzGerald`_ in (:pr:`190`)
* Additional examples published for the `TaylorDiagram` class and `get_skewt_vars()` function by `Julia Kent`_ in (:pr:`186`) and (:pr:`188`)
* `TaylorDiagram` class docstring is clarified by `Julia Kent`_ in (:pr:`182`)
* NSF NCAR branding updates by `Katelyn FitzGerald`_ in (:pr:`191`)
* NSF NCAR branding updates by `Katelyn FitzGerald`_ in (:pr:`191`) and (:pr:`192`)

Bug Fixes
^^^^^^^^^
Expand Down

0 comments on commit 98edf75

Please sign in to comment.