Skip to content

Instantly share code, notes, and snippets.

@denisdefreyne
Created June 6, 2024 14:58
Show Gist options
  • Save denisdefreyne/7264b69c6c527fc318f8ed95e848c539 to your computer and use it in GitHub Desktop.
Save denisdefreyne/7264b69c6c527fc318f8ed95e848c539 to your computer and use it in GitHub Desktop.
/***********************************************************
* config
*/
:root {
--base-size: 0.3625rem;
--size-1: calc(1 * var(--base-size));
--size-2: calc(2 * var(--base-size));
--size-3: calc(4 * var(--base-size));
--size-4: calc(8 * var(--base-size));
--size-5: calc(16 * var(--base-size));
}
/***********************************************************
* reset
* modern-normalize v2.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize
*/
*,
::after,
::before {
box-sizing: border-box
}
html {
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4
}
body {
margin: 0
}
hr {
height: 0;
color: inherit
}
abbr[title] {
text-decoration-line: underline;
text-decoration-style: dotted;
}
b,
strong {
font-weight: bolder
}
code,
kbd,
pre,
samp {
font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 1em
}
small {
font-size: 80%
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline
}
sub {
bottom: -.25em
}
sup {
top: -.5em
}
table {
text-indent: 0;
border-color: inherit
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
font-size: 100%;
line-height: 1.15;
margin: 0
}
button,
select {
text-transform: none
}
[type=button],
[type=reset],
[type=submit],
button {
-webkit-appearance: button
}
::-moz-focus-inner {
border-style: none;
padding: 0
}
:-moz-focusring {
outline: 1px dotted ButtonText
}
:-moz-ui-invalid {
box-shadow: none
}
legend {
padding: 0
}
progress {
vertical-align: baseline
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px
}
::-webkit-search-decoration {
-webkit-appearance: none
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit
}
summary {
display: list-item
}
/***********************************************************
* core styles
*/
* {
margin: 0;
padding: 0;
}
body {
-webkit-hyphens: auto;
-webkit-hyphenate-limit-before: 3;
-webkit-hyphenate-limit-after: 3;
-webkit-hyphenate-limit-chars: 6 3 3;
-webkit-hyphenate-limit-lines: 2;
-webkit-hyphenate-limit-last: always;
-webkit-hyphenate-limit-zone: 8%;
hyphens: auto;
hyphenate-limit-chars: 6 3 3;
hyphenate-limit-lines: 2;
hyphenate-limit-last: always;
hyphenate-limit-zone: 8%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
text-wrap: balance;
}
p,
li {
text-wrap: pretty;
}
.display-none {
display: none;
}
.visually-hidden {
border: 0;
clip: rect(0 0 0 0);
width: 1px;
height: auto;
margin: 0;
padding: 0;
overflow: hidden;
position: absolute;
white-space: nowrap;
}
/***********************************************************
* components
*/
/* cluster */
.cluster-1,
.cluster-2,
.cluster-3,
.cluster-4,
.cluster-5 {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
}
.cluster-1 {
gap: var(--size-1);
}
.cluster-2 {
gap: var(--size-2);
}
.cluster-3 {
gap: var(--size-3);
}
.cluster-4 {
gap: var(--size-4);
}
.cluster-5 {
gap: var(--size-5);
}
/* stack */
.stack-1>*,
.stack-2>*,
.stack-3>*,
.stack-4>*,
.stack-5>* {
margin-top: 0;
margin-bottom: 0;
}
.stack-1>*+* {
margin-top: var(--size-1);
}
.stack-2>*+* {
margin-top: var(--size-2);
}
.stack-3>*+* {
margin-top: var(--size-3);
}
.stack-4>*+* {
margin-top: var(--size-4);
}
.stack-5>*+* {
margin-top: var(--size-5);
}
/* center */
.center {
box-sizing: content-box;
margin-left: auto;
margin-right: auto;
padding-left: var(--size-3);
padding-right: var(--size-3);
}
/* prose */
.prose blockquote>* {
/* same as stack-3 */
margin-top: 0;
margin-bottom: 0;
}
.prose blockquote>*+* {
/* same as stack-3 */
margin-top: var(--size-3);
}
.prose ul:has(p)>*,
.prose ol:has(p)>* {
/* same as stack-3 */
margin-top: 0;
margin-bottom: 0;
}
.prose ul:has(p)>*+*,
.prose ol:has(p)>*+* {
/* same as stack-3 */
margin-top: var(--size-3);
}
.prose ul:has(p) p+p,
.prose ol:has(p) p+p {
margin-top: var(--size-3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment