Skip to content

Commit

Permalink
Make heading-style use the font-weight-heading value (#1213)
Browse files Browse the repository at this point in the history
* Make heading-style use the font-weight-heading value

* Separate font-weight setting for content headers and admonitions

* Flip var to be consistent with --pst-font-weight-heading instead
  • Loading branch information
vkbo authored Feb 24, 2023
1 parent 9223e6c commit 157c9ab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pydata_sphinx_theme/assets/styles/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ a {
.heading-style {
margin: 2.75rem 0 1.05rem;
font-family: var(--pst-font-family-heading);
font-weight: 400;
font-weight: var(--pst-font-weight-heading);
line-height: 1.15;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

p.prev-next-title {
color: var(--pst-color-primary);
font-weight: var(--pst-font-weight-heading);
font-weight: var(--pst-admonition-font-weight-heading);
font-size: 1.1em;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
color: var(--pst-color-text-base);
content: "Read The Docs";
font-family: var(--pst-font-family-base);
font-weight: var(--pst-font-weight-heading);
font-weight: var(--pst-admonition-font-weight-heading);
}
}
.fa.fa-caret-down {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ div.admonition,
> .admonition-title {
margin: 0 -0.6rem;
padding: 0.4rem 0.6rem 0.4rem 2rem;
font-weight: var(--pst-font-weight-heading);
font-weight: var(--pst-admonition-font-weight-heading);
position: relative;

&:after {
Expand Down Expand Up @@ -320,7 +320,7 @@ aside.sidebar {
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--pst-color-border);
font-family: var(--pst-font-family-heading);
font-weight: var(--pst-font-weight-heading);
font-weight: var(--pst-admonition-font-weight-heading);
}

// Add margin to the first non-`.sidebar-title` item
Expand Down
5 changes: 4 additions & 1 deletion src/pydata_sphinx_theme/assets/styles/variables/_fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ html {
--pst-sidebar-header-font-size: 1.2rem;
--pst-sidebar-header-font-weight: 600;

// Admonition styles
--pst-admonition-font-weight-heading: 600;

// Font weights
--pst-font-weight-caption: 300;
--pst-font-weight-heading: 600;
--pst-font-weight-heading: 400;

// Font family
// These are adapted from https://systemfontstack.com/ */
Expand Down

0 comments on commit 157c9ab

Please sign in to comment.