update prose / global styles
This commit is contained in:
parent
64a80ac939
commit
07b337cb76
3 changed files with 32 additions and 33 deletions
|
|
@ -32,7 +32,7 @@ h2,
|
||||||
h3 {
|
h3 {
|
||||||
font-family: var(--font-display);
|
font-family: var(--font-display);
|
||||||
font-weight: var(--font-extra-bold);
|
font-weight: var(--font-extra-bold);
|
||||||
line-height: 1.2;
|
line-height: var(--leading-fine);
|
||||||
letter-spacing: var(--tracking-s);
|
letter-spacing: var(--tracking-s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,12 +48,6 @@ h3 {
|
||||||
font-size: var(--size-step-2);
|
font-size: var(--size-step-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
p,
|
|
||||||
li,
|
|
||||||
blockquote:not([class]) {
|
|
||||||
max-inline-size: 65ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
padding: var(--space-m-l);
|
padding: var(--space-m-l);
|
||||||
border-inline-start: 0.5rem solid var(--color-primary);
|
border-inline-start: 0.5rem solid var(--color-primary);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
/* inspired by: */
|
|
||||||
/* https://piccalil.li/blog/a-modern-css-reset/ */
|
/* https://piccalil.li/blog/a-modern-css-reset/ */
|
||||||
/* https://keithjgrant.com/posts/2024/01/my-css-resets/ */
|
/* https://keithjgrant.com/posts/2024/01/my-css-resets/ */
|
||||||
/* https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/#css-reset-additions */
|
/* https://moderncss.dev/modern-css-for-dynamic-component-based-architecture/#css-reset-additions */
|
||||||
/* https://github.com/mayank99/reset.css/blob/main/package/index.css */
|
/* https://github.com/mayank99/reset.css/blob/main/package/index.css */
|
||||||
/* Box sizing rules */
|
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*::before,
|
*::before,
|
||||||
|
|
@ -11,7 +9,6 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Typography */
|
|
||||||
* {
|
* {
|
||||||
text-wrap: pretty;
|
text-wrap: pretty;
|
||||||
}
|
}
|
||||||
|
|
@ -23,12 +20,10 @@ h4 {
|
||||||
text-wrap: balance;
|
text-wrap: balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scroll behavior */
|
|
||||||
html:focus-within {
|
html:focus-within {
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Body defaults */
|
|
||||||
body {
|
body {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
|
|
@ -36,7 +31,6 @@ body {
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Margins */
|
|
||||||
body,
|
body,
|
||||||
h1,
|
h1,
|
||||||
h2,
|
h2,
|
||||||
|
|
@ -50,7 +44,6 @@ dd {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List styles */
|
|
||||||
ul[role='list'],
|
ul[role='list'],
|
||||||
ol[role='list'] {
|
ol[role='list'] {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
@ -60,13 +53,11 @@ ol[role='list'] {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Anchor styles */
|
|
||||||
a {
|
a {
|
||||||
text-decoration-skip-ink: auto;
|
text-decoration-skip-ink: auto;
|
||||||
color: currentColor;
|
color: currentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Image styles */
|
|
||||||
img,
|
img,
|
||||||
picture,
|
picture,
|
||||||
svg,
|
svg,
|
||||||
|
|
@ -80,12 +71,14 @@ canvas {
|
||||||
shape-margin: 0.75rem;
|
shape-margin: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button styles */
|
picture {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
all: unset;
|
all: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inherit fonts for inputs and buttons */
|
|
||||||
button,
|
button,
|
||||||
input,
|
input,
|
||||||
select,
|
select,
|
||||||
|
|
@ -94,7 +87,6 @@ textarea {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Textarea styles */
|
|
||||||
textarea {
|
textarea {
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
resize: block;
|
resize: block;
|
||||||
|
|
@ -104,7 +96,6 @@ textarea:not([rows]) {
|
||||||
min-height: 10em;
|
min-height: 10em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cursor styles */
|
|
||||||
button,
|
button,
|
||||||
label,
|
label,
|
||||||
select,
|
select,
|
||||||
|
|
@ -114,12 +105,10 @@ summary,
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scroll margin above anchor links */
|
|
||||||
:target {
|
:target {
|
||||||
scroll-margin-block-start: 2ex;
|
scroll-margin-block-start: 2ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scroll margin below focused elements */
|
|
||||||
:focus {
|
:focus {
|
||||||
scroll-margin-block-end: 8vh;
|
scroll-margin-block-end: 8vh;
|
||||||
}
|
}
|
||||||
|
|
@ -139,18 +128,15 @@ dialog {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hide dialog elements without open or popover attributes, and elements with a popover attribute that are not in an open state. */
|
|
||||||
dialog:not([open], [popover]),
|
dialog:not([open], [popover]),
|
||||||
[popover]:not(:popover-open) {
|
[popover]:not(:popover-open) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prevent page scroll: https://blog.mayank.co/is-dialog-enough */
|
|
||||||
html:has(dialog[open]:modal) {
|
html:has(dialog[open]:modal) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reduced motion */
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
:focus-within {
|
:focus-within {
|
||||||
scroll-behavior: auto;
|
scroll-behavior: auto;
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,32 @@
|
||||||
--flow-space: var(--space-xl);
|
--flow-space: var(--space-xl);
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose :is(h2, h3, h4) {
|
.prose :is(img, video) {
|
||||||
--flow-space: 1.5em;
|
border: var(--stroke);
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose :is(h2 + *, h3 + *, h4 + *):not(figure) {
|
.prose :is(h2, h3, h4) {
|
||||||
|
--flow-space: 1.5em;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
hyphens: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen(md) {
|
||||||
|
.prose :is(h1, h2, h3) {
|
||||||
|
overflow-wrap: unset;
|
||||||
|
hyphens: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.prose :is(h1, h2, h3, h4) + *:not([class]):not(figure) {
|
||||||
--flow-space: var(--space-l);
|
--flow-space: var(--space-l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.prose :is(p, li, dl, blockquote) {
|
||||||
|
max-inline-size: 60ch;
|
||||||
|
text-wrap: pretty;
|
||||||
|
}
|
||||||
|
|
||||||
.prose .heading-anchor:where(:hover, :focus) {
|
.prose .heading-anchor:where(:hover, :focus) {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
@ -34,18 +52,19 @@
|
||||||
color: var(--color-dark);
|
color: var(--color-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* block space only for "regular lists" */
|
/* block space only for "regular lists" and sublists */
|
||||||
.prose :not(.cluster):not(.grid) > li + li {
|
.prose :is(ul, ol):not([class]) li + li,
|
||||||
padding-block-start: var(--space-s-m);
|
.prose :is(ul, ol):not([class]) li > :is(ol, ul) {
|
||||||
|
--flow-space: var(--space-s-m);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inline space only for "regular lists" */
|
/* inline space only for "regular lists" */
|
||||||
.prose :where(ul:not(.grid), ol:not(.grid)) {
|
.prose :is(ul:not([class]), ol:not(.grid)) {
|
||||||
padding-inline-start: 1.2ch;
|
padding-inline-start: 1.2ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* marker only for "regular lists" */
|
/* marker only for "regular lists" */
|
||||||
.prose :where(ul:not(.grid):not([role='list'])) li::marker {
|
.prose :is(ul:not([class]):not([role='list'])) li::marker {
|
||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
content: '– ';
|
content: '– ';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue