Skip to content

Commit d54e349

Browse files
committed
Grid: Removed overflow on callouts + codeblocks + set min width to zero
1 parent 0ed1da1 commit d54e349

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

assets/css/v2/style.css

Lines changed: 18 additions & 16 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,7 +275,7 @@ 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: 22rem;
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

@@ -1730,7 +1730,7 @@ blockquote {
17301730
border: 1px solid oklch(var(--color-foreground));
17311731
padding: 1rem;
17321732
height: fit-content;
1733-
margin: var(--margin-callout);
1733+
margin: var(--margin-callout); /* Expand into the gutter */
17341734

17351735
/* solid 3px drop shadow */
17361736
box-shadow: 3px 3px 0px oklch(var(--color-shadow));
@@ -1745,16 +1745,6 @@ blockquote {
17451745
}
17461746
}
17471747

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-
17581748
blockquote.note {
17591749
position: relative;
17601750
z-index: 0;
@@ -1789,6 +1779,13 @@ blockquote p:last-child {
17891779
}
17901780
}
17911781

1782+
/* Maintain the gutter overflow for as long as possible */
1783+
@media (max-width: 55rem) {
1784+
blockquote {
1785+
margin-inline: 0;
1786+
}
1787+
}
1788+
17921789
blockquote > div > * {
17931790
margin: 0 0 var(--flow-gap) 0;
17941791
}
@@ -2014,7 +2011,7 @@ a:has(code:not(pre code)) {
20142011

20152012
.code-block {
20162013
position: relative;
2017-
margin: var(--margin-codeblock);
2014+
margin: var(--margin-codeblock); /* Expand into the gutter */
20182015

20192016
tr::after {
20202017
display: none;
@@ -2087,6 +2084,11 @@ a:has(code:not(pre code)) {
20872084
}
20882085
}
20892086
}
2087+
2088+
/* Maintain the gutter overflow for as long as possible */
2089+
@media (max-width: 55rem) {
2090+
margin-inline: 0rem;
2091+
}
20902092
}
20912093

20922094
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)