Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/web/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';

import './styles/layers.css';
import './styles/resets.css';
import './styles/tokens.css';
import './styles/base.css';
import './styles/utilities.css';

import { App } from './App';
import './styles.css';

createRoot(document.getElementById('root')!).render(
<StrictMode>
Expand Down
19 changes: 0 additions & 19 deletions apps/web/src/styles.css

This file was deleted.

102 changes: 102 additions & 0 deletions apps/web/src/styles/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
@layer base {
/* Global page defaults */
html {
color-scheme: light;
}

body {
font-family: var(--font-family-base);
font-size: var(--font-size-md);
font-weight: var(--font-weight-regular);
line-height: var(--line-height-normal);
color: var(--color-text-primary);
background-color: var(--color-bg-page);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-family-heading);
font-weight: var(--font-weight-semibold);
line-height: var(--line-height-tight);
}

h1,
h2,
h3 {
letter-spacing: var(--letter-spacing-tight);
}

h1 {
font-size: var(--font-size-4xl);
}

h2 {
font-size: var(--font-size-3xl);
}

h3 {
font-size: var(--font-size-2xl);
}

h4 {
font-size: var(--font-size-xl);
}

h5 {
font-size: var(--font-size-lg);
}

h6 {
font-size: var(--font-size-md);
}

/* Links */
a {
color: var(--color-text-accent);
text-decoration-thickness: from-font;
text-underline-offset: 0.15em;
}

a:hover {
color: var(--color-brand-primary-hover);
}

/* Keyboard focus */
:focus-visible {
outline: var(--border-width-medium) solid var(--color-focus-ring);
outline-offset: 2px;
}

/* Placeholder text */
::placeholder {
color: var(--color-text-muted);
opacity: 1;
}

/* Text emphasis */
strong,
b {
font-weight: var(--font-weight-semibold);
}

small {
font-size: var(--font-size-sm);
}

/* Text selection */
::selection {
color: var(--color-selection-text);
background-color: var(--color-selection-bg);
}

/* Dividers */
hr {
border: 0;
border-top: var(--border-width-thin) solid var(--color-border-divider);
}
}
2 changes: 2 additions & 0 deletions apps/web/src/styles/layers.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Cascade order: later layers take priority over earlier layers. */
@layer reset, base, components, utilities;
74 changes: 74 additions & 0 deletions apps/web/src/styles/resets.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
@layer reset {
/* Use predictable box sizing */
*,
*::before,
*::after {
box-sizing: border-box;
}

/* Ensure the page can fill the viewport */
html {
min-height: 100%;
}

body {
margin: 0;
min-height: 100dvh;
}

/* Keep media within its container */
img,
picture,
video,
canvas {
display: block;
max-width: 100%;
}

/* Preserve media aspect ratio */
img,
picture,
video {
height: auto;
}

/* Remove inline SVG baseline spacing */
svg {
display: block;
}

/* Inherit surrounding form typography */
button,
input,
select,
textarea {
font: inherit;
color: inherit;
}

/* Prevent long text from overflowing */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
overflow-wrap: anywhere;
}

/* Remove default content margins */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
}
Loading