Skip to content

Commit 0507e25

Browse files
authored
Changed min width of parent grid to be smaller (#338)
* Grid: Changed min width of parent grid to be smaller * Grid: Removed overflow on callouts + codeblocks + set min width to zero * Grid: Fixed sidebar width * Grid: Added breadcrumb line overflow fully
1 parent 3be7562 commit 0507e25

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

assets/css/v2/style.css

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ textarea:not([rows]) {
173173

174174
/* Codeblock */
175175

176-
--margin-codeblock: 1.5rem -1rem;
176+
--margin-codeblock: 1.5rem var(--overflow-gutter-extension);
177177
--color-inline_codeblock-border: 0.85 0 0;
178178
--color-inline_codeblock-background: 0.98 0 0;
179179
--color-codeblock-border: 0.63 0 0;
@@ -189,7 +189,7 @@ textarea:not([rows]) {
189189
--codeblock-line-box-side-length: 4px;
190190

191191
/* Callout */
192-
--margin-callout: 1rem -1rem;
192+
--margin-callout: 1rem var(--overflow-gutter-extension);
193193
--color-callout-warning: 0.65 0.188 24;
194194
--color-callout-warning-shadow: 0.65 0.188 24 / 20%;
195195
--color-callout-caution: 0.8 0.1613 71.21;
@@ -216,7 +216,7 @@ textarea:not([rows]) {
216216
/* Tab Group */
217217
--margin-tab-group: 1rem -1rem 0 -1rem;
218218

219-
--overflow-gutter-extension: 1rem;
219+
--overflow-gutter-extension: -1rem;
220220

221221
/* vars for the primary grid setup */
222222
--grid-content: minmax(34rem, 50rem);
@@ -275,13 +275,13 @@ textarea:not([rows]) {
275275

276276
/* @link https://utopia.fyi/grid/calculator?c=320,16,1.2,1240,18,1.25,5,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
277277
--grid-max-width: 69.75rem;
278-
--grid-min-width: 34rem;
278+
--grid-min-width: 0;
279279
--grid-gutter: var(--space-s-l, clamp(1rem, 0.4975rem + 2.5126vw, 2.25rem));
280280
--grid-columns: 12;
281281

282282
--header-height: 4rem;
283283

284-
--sidebar-width: 24rem;
284+
--sidebar-width: min(24rem, 100%);
285285
--sidebar-item-padding-lr: 0.75rem;
286286
--sidebar-item-padding-tb: 0.25rem;
287287
--content-max-width: 88rem;
@@ -403,9 +403,17 @@ ol li:last-child {
403403
}
404404

405405
.breadcrumb-layout {
406-
border-bottom: 1px solid oklch(var(--color-divider));
407406
align-items: center;
408407
padding: var(--space-xs) 0;
408+
409+
&::after {
410+
content: "";
411+
position: absolute;
412+
bottom: 0;
413+
width: calc(100% + (-4 * var(--overflow-gutter-extension)));
414+
margin-left: calc(2 * var(--overflow-gutter-extension));
415+
border-bottom: 1px solid oklch(var(--color-divider));
416+
}
409417
}
410418
}
411419
.content {
@@ -1730,7 +1738,7 @@ blockquote {
17301738
border: 1px solid oklch(var(--color-foreground));
17311739
padding: 1rem;
17321740
height: fit-content;
1733-
margin: var(--margin-callout);
1741+
margin: var(--margin-callout); /* Expand into the gutter */
17341742

17351743
/* solid 3px drop shadow */
17361744
box-shadow: 3px 3px 0px oklch(var(--color-shadow));
@@ -1745,16 +1753,6 @@ blockquote {
17451753
}
17461754
}
17471755

1748-
blockquote[data-grid="last-third"] {
1749-
margin-block-start: 0;
1750-
}
1751-
1752-
@media (max-width: 55rem) {
1753-
blockquote[data-grid="last-third"] {
1754-
margin: var(--margin-callout);
1755-
}
1756-
}
1757-
17581756
blockquote.note {
17591757
position: relative;
17601758
z-index: 0;
@@ -1789,6 +1787,13 @@ blockquote p:last-child {
17891787
}
17901788
}
17911789

1790+
/* Maintain the gutter overflow for as long as possible */
1791+
@media (max-width: 55rem) {
1792+
blockquote {
1793+
margin-inline: 0;
1794+
}
1795+
}
1796+
17921797
blockquote > div > * {
17931798
margin: 0 0 var(--flow-gap) 0;
17941799
}
@@ -2014,7 +2019,7 @@ a:has(code:not(pre code)) {
20142019

20152020
.code-block {
20162021
position: relative;
2017-
margin: var(--margin-codeblock);
2022+
margin: var(--margin-codeblock); /* Expand into the gutter */
20182023

20192024
tr::after {
20202025
display: none;
@@ -2087,6 +2092,11 @@ a:has(code:not(pre code)) {
20872092
}
20882093
}
20892094
}
2095+
2096+
/* Maintain the gutter overflow for as long as possible */
2097+
@media (max-width: 55rem) {
2098+
margin-inline: 0rem;
2099+
}
20902100
}
20912101

20922102
ol .code-block,

layouts/partials/banner.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{- if isset . "md" -}}
1111
<!-- Show markdown if "md" is provided -->
1212
{{- $bannerPage := readFile .md -}}
13-
<div class="banner{{ if .type }} banner-{{ .type }}{{ end }}">
13+
<div class="banner{{ if .type }} banner-{{ .type }}{{ end }}" data-grid="first-two-thirds">
1414
{{ $bannerPage | markdownify }}
1515
</div>
1616
{{- else -}}

0 commit comments

Comments
 (0)