Skip to content

Commit 369be71

Browse files
committed
feat: add content-width meta option
1 parent 72f63ef commit 369be71

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

src/sphinx_breeze_theme/assets/styles/sections/content.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.bz-content {
66
min-height: calc(100vh - var(--bz-header-height) - var(--bz-header-tabs-height) - var(--bz-footer-height));
7-
padding-inline: calc(var(--bz-page-width) + clamp(1.5rem, 1.375rem + 0.625vw, 2rem));
7+
padding-inline: calc(var(--bz-page-padding) + clamp(1.5rem, 1.375rem + 0.625vw, 2rem));
88

99
@media (width > 52rem) {
1010
display: flex;

src/sphinx_breeze_theme/assets/styles/sections/footer.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
column-gap: 1.5rem;
77
min-height: var(--bz-footer-height);
88
padding-block: .5rem;
9-
padding-inline: calc(var(--bz-page-width) + clamp(1.25rem, 1rem + 1.25vw, 2rem));
9+
padding-inline: calc(var(--bz-page-padding) + clamp(1.25rem, 1rem + 1.25vw, 2rem));
1010
color: var(--bz-footer-color);
1111
font-size: var(--bz-footer-font-size);
1212
font-family: var(--bz-footer-font-family);

src/sphinx_breeze_theme/assets/styles/sections/header-main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
font-size: var(--bz-header-font-size);
1111
font-family: var(--bz-header-font-family);
1212
background-color: var(--bz-header-background-color);
13-
padding-inline: calc(var(--bz-page-width) + clamp(1rem, 0.826rem + 0.87vw, 1.5rem));
13+
padding-inline: calc(var(--bz-page-padding) + clamp(1rem, 0.826rem + 0.87vw, 1.5rem));
1414

1515
&:not(:has(+ .bz-header-tabs)) {
1616
border-bottom: 1px solid var(--bz-header-border-color);

src/sphinx_breeze_theme/assets/styles/sections/header-tabs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
font-family: var(--bz-header-font-family);
1212
background-color: var(--bz-header-background-color);
1313
border-bottom: 1px solid var(--bz-header-border-color);
14-
padding-inline: calc(var(--bz-page-width) + clamp(0.75rem, 0.45rem + 1.5vw, 1.5rem));
14+
padding-inline: calc(var(--bz-page-padding) + clamp(0.75rem, 0.45rem + 1.5vw, 1.5rem));
1515
box-shadow:
1616
0 1px 1px var(--bz-color-shadow),
1717
0 2px 2px var(--bz-color-shadow),

src/sphinx_breeze_theme/assets/styles/variables/content.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
--bz-page-background-color: var(--bz-color-surface-3);
4747
--bz-page-font-size: var(--bz-size-md);
4848
--bz-page-font-family: var(--bz-font-sans);
49-
--bz-page-width: calc((100vw - clamp(17.5rem, 100vw, 94rem)) / 2);
49+
--bz-page-padding: calc((100vw - clamp(17.5rem, 100vw, var(--bz-page-width))) / 2);
50+
--bz-page-width: 94rem;
5051

5152
--bz-sidebar-primary-border-color: color-mix(in oklab, var(--bz-color-outline) 75%, transparent);
5253
--bz-sidebar-primary-drawer-background-color: var(--bz-color-surface-3);

src/sphinx_breeze_theme/theme/breeze/layout.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
.bz-js-only { display: none !important; }
88
</style>
99
</noscript>
10+
{% if meta and "content-width" in meta %}
11+
<style>
12+
#bz-main-content { max-width: {{ meta["content-width"] }}; }
13+
</style>
14+
{%- endif -%}
1015
{%- endblock css -%}
1116

1217
{%- block scripts -%}

0 commit comments

Comments
 (0)