Skip to content

Commit

Permalink
Assorted CSS fixes (#220)
Browse files Browse the repository at this point in the history
* Fix maths alignment

* Fix some CSS for hover borders
  • Loading branch information
Cadair authored Sep 8, 2023
1 parent a6c5dbb commit 82b1d1f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sunpy_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def setup(app: Sphinx):
# Register theme
theme_dir = get_html_theme_path()
app.add_html_theme("sunpy", theme_dir)
app.add_css_file("sunpy_style.css")
app.add_css_file("sunpy_style.css", priority=600)

app.connect("builder-inited", update_config)
app.connect("html-page-context", update_html_context)
Expand Down
11 changes: 10 additions & 1 deletion src/sunpy_sphinx_theme/theme/sunpy/static/sunpy_style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,900");

html {
:root {
--pst-font-size-base: 17px;
--pst-sidebar-font-size: 1em;
--pst-font-family-base: "Source Sans Pro", var(--pst-font-family-base-system);
Expand Down Expand Up @@ -31,6 +31,9 @@ html {
--sst-header-background: var(--sst-dark-color);
--sst-header-text: var(--sst-lighter-color);
--sst-sidebar-background-color: var(--pst-color-background);

/* sphinx-design themeing */
--sd-color-card-border-hover: var(--sst-accent-color-bright);
}

html[data-theme="light"] {
Expand Down Expand Up @@ -66,6 +69,7 @@ body {
--sg-download-a-hover-background-color: var(--sg-download-a-background-color);
--sg-download-a-hover-box-shadow-1: none;
--sg-download-a-hover-box-shadow-2: none;
--sg-thumb-hover-border: var(--sst-accent-color-bright);
}

/* Global Styling */
Expand All @@ -82,6 +86,11 @@ code.literal {
color: var(--sst-darker-color) !important;
}

div.math {
flex-direction: row;
justify-content: center;
}

.modal {
--bs-modal-bg: var(--pst-color-background);
}
Expand Down
2 changes: 2 additions & 0 deletions test_package/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Documentation :any:`index <genindex>` and :any:`Module <modindex>` index.

.. grid-item-card::
:class-card: card
:link: subsections
:link-type: ref

Conventions
^^^^^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions test_package/docs/subsections.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _subsections:

###########
subsections
###########
Expand Down

0 comments on commit 82b1d1f

Please sign in to comment.