Align top bar with main horizontal margin

- Use a variable to make sure that top bar and body margins stay equal
- Lower side margins to 16px so that the gap in navbar-items fits right
This commit is contained in:
2025-08-08 01:02:04 -05:00
parent 5d335647d0
commit 4e753395ba
2 changed files with 30 additions and 19 deletions

View File

@@ -158,6 +158,14 @@ pre > code {
/* }}} */ /* }}} */
/* Common distances/sizes {{{ */
:root {
--page-margin: 16px;
}
/* }}} */
/* Basic elements {{{ */ /* Basic elements {{{ */
html { html {
@@ -178,13 +186,14 @@ body {
} }
.main-container { .main-container {
margin: 20px auto; margin: var(--page-margin) auto;
padding: 0 20px; /* use padding because otherwise there's no way to have margin be both auto, and a minimum value */
max-width: 760px; /* 720px + 20px for left & right padding */ padding: 0 var(--page-margin);
max-width: calc(720px + 2 * var(--page-margin)); /* padding is included in the element's width */
} }
footer { footer {
margin: 20px 0; margin: var(--page-margin) 0;
text-align: center; text-align: center;
font-size: smaller; font-size: smaller;
} }
@@ -326,11 +335,13 @@ table.simple tbody tr:nth-child(even) {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
background-color: var(--background-1); background-color: var(--background-1);
/* padding can't be here because then the first navbar element will be shifted too far over,
* or it will need its hover background to be chopped off on the left */
} }
.header { .header {
flex-grow: 1; flex-grow: 1;
margin: 8px 16px; margin: 8px var(--page-margin);
font-size: 1.25em; font-size: 1.25em;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -342,7 +353,7 @@ table.simple tbody tr:nth-child(even) {
} }
.navbar-item { .navbar-item {
padding: 12px 16px; padding: 12px var(--page-margin);
white-space: nowrap; white-space: nowrap;
} }
@@ -376,7 +387,7 @@ table.simple tbody tr:nth-child(even) {
/* Breadcrumb navigation {{{ */ /* Breadcrumb navigation {{{ */
.breadcrumb { .breadcrumb {
margin: 20px 0; margin: var(--page-margin) 0;
} }
.breadcrumb ul { .breadcrumb ul {

View File

@@ -18,11 +18,6 @@
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it) THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
{{ end }} {{ end }}
</main> </main>
</div>
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
{{ if or .Site.Copyright .Site.Params.footer }} {{ if or .Site.Copyright .Site.Params.footer }}
<footer> <footer>
@@ -35,6 +30,11 @@
{{ end }} {{ end }}
</footer> </footer>
{{ end }} {{ end }}
</div>
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
</body> </body>
</html> </html>