Skip to content

Commit

Permalink
full width styling tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
torbjornbp committed Feb 25, 2025
1 parent 3d0fac2 commit 720a326
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
.site-title {text-align: center; font-size: 1em;}
h1 {font-size: 1.7em;}
hr {height: 1px; background-color: #aaa; border: none; max-width: calc(100% - 10px);}
hr {height: 1px; background-color: #aaa; border: none; width: 100%;}
.posts-list .post-item {margin: 0;}
.posts-list .date {margin-right: 0.5em;}
a {color: royalblue;}
Expand Down
23 changes: 3 additions & 20 deletions layouts/shortcodes/details.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
<details class="custom-details">
<summary class="custom-summary">{{ .Get 0 }}</summary>
<details>
<summary>{{ .Get 0 }}</summary>
{{ .Inner | .Page.RenderString }}
</details>

<style>
.custom-details {
border: 1px solid #aaa;
background: #f9f9f9;
border-left: 4px solid #777;
box-shadow: 2px 2px #ddd;
padding: 5px;
margin: 4px;
}

.custom-summary {
font-weight: bold;
padding: 0.5em;
cursor: pointer;
}
</style>
</details>
5 changes: 2 additions & 3 deletions layouts/shortcodes/toc.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<details class= "toc" style="border: 1px solid #aaa; background: #f9f9f9; border-left: 4px solid #777;box-shadow: 2px 2px #ddd;
padding: 5px; margin: 4px;">
<summary style="font-weight: bold; padding: 0.5em; cursor: pointer;">
<details class="toc">
<summary>
Table of Contents
</summary>
{{ .Page.TableOfContents }}
Expand Down
45 changes: 36 additions & 9 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,40 @@ h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
.menu li { display: inline-block; }
.menu a { text-decoration: none; }

/* Boxed elements */
.article-meta, .menu a, blockquote, table, button.menu, pre {
/* Boxed elements for navigation */
.menu a, button.menu {
background: var(--block-bg);
border: 1px solid var(--border-color);
box-shadow: 2px 2px var(--shadow-color);
padding: 5px;
margin: 4px;
}

/* Full-width boxed elements */
.article-meta, blockquote, pre, details {
background: var(--block-bg);
border: 1px solid var(--border-color);
box-shadow: 2px 2px var(--shadow-color);
padding: 5px;
margin: 0;
width: 100%;
box-sizing: border-box;
}

/* Details element specific styling */
details {
margin-bottom: 1em;
border-left: 4px solid var(--accent-color);
}
details summary {
cursor: pointer;
font-weight: bold;
padding: 0.5em;
}
details > *:not(summary) {
padding: 0.5em;
}

pre {
padding: 1em;
overflow-x: auto;
Expand All @@ -57,7 +82,7 @@ hr {
height: 1px;
background-color: var(--border-color);
border: none;
max-width: calc(100% - 10px);
width: 100%;
}

/* Links */
Expand Down Expand Up @@ -93,9 +118,10 @@ img, figure, iframe, video, .responsive-image {
main { hyphens: auto; }
blockquote {
border-left: 4px solid var(--accent-color);
padding: 3px 1em;
padding: 5px 1em;
font-size: var(--font-size-small);
line-height: var(--line-height-small);
box-sizing: border-box;
}

/* Buttons */
Expand Down Expand Up @@ -164,12 +190,13 @@ figure figcaption, .imgCaption {

/* Tables */
table {
margin: auto;
margin: 0;
border-left: 4px solid var(--accent-color);
background: var(--bg-color);
max-width: calc(100% - 10px);
width: 100%;
border-collapse: collapse;
font-size: var(--font-size-small);
box-sizing: border-box;
}
table thead th {
border-bottom: 1px solid var(--accent-color);
Expand All @@ -187,7 +214,9 @@ thead, tfoot, tr:nth-child(even) { background: #eee; }
background-color: #fff8f8;
color: #822;
padding: 10px;
margin: 10px 0;
margin: 0;
width: 100%;
box-sizing: border-box;
border-radius: 3px;
font-size: var(--font-size-small);
}
Expand All @@ -198,8 +227,6 @@ thead, tfoot, tr:nth-child(even) { background: #eee; }
white-space: nowrap;
overflow-x: auto;
font-size: var(--font-size-small);
content-visibility: auto;
contain-intrinsic-size: 0 500px; /* Estimate of list size */
}
}

Expand Down

0 comments on commit 720a326

Please sign in to comment.