feature: Set up basic layout and styles

This commit is contained in:
Keith Solomon
2025-05-24 12:22:24 -05:00
parent bd7e54d7c7
commit 89c725a282
7 changed files with 475 additions and 58 deletions

View File

@@ -3,22 +3,36 @@
@layer theme, base, components, utilities;
@layer theme {
:root, :host {
--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-sans: "Raleway", sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
--color-blue-400: oklch(70.7% 0.165 254.624);
--color-slate-900: oklch(20.8% 0.042 265.755);
--color-gray-200: oklch(92.8% 0.006 264.531);
--color-gray-400: oklch(70.7% 0.022 261.325);
--color-gray-800: oklch(27.8% 0.033 256.848);
--color-white: #fff;
--color-black: oklch(0% 0 0);
--color-white: oklch(100% 0 0);
--spacing: 0.25rem;
--text-xs: 0.75rem;
--text-xs--line-height: calc(1 / 0.75);
--text-base: 1rem;
--text-base--line-height: calc(1.5 / 1);
--text-4xl: 2.25rem;
--text-4xl--line-height: calc(2.5 / 2.25);
--radius-sm: 0.25rem;
--default-transition-duration: 150ms;
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
--default-font-family: var(--font-sans);
--default-mono-font-family: var(--font-mono);
--color-primary: oklch(0.57 0.203362 257.1706);
--color-secondary: oklch(0.56 0.0176 257.23);
--color-bodylinks: oklch(0.48 0.0789 211.58);
--color-warning: oklch(84.42% 0.1722 84.93);
--h1: calc(var(--text-base) * 2.25);
--h2: calc(var(--text-base) * 1.75);
--h3: calc(var(--text-base) * 1.5);
--h4: calc(var(--text-base) * 1.25);
--h5: calc(var(--text-base) * 1.125);
--h6: calc(var(--text-base) * 1.05);
}
}
@layer base {
@@ -167,31 +181,109 @@
}
}
@layer utilities {
.my-2 {
margin-block: calc(var(--spacing) * 2);
.container {
width: 100%;
@media (width >= 40rem) {
max-width: 40rem;
}
@media (width >= 48rem) {
max-width: 48rem;
}
@media (width >= 64rem) {
max-width: 64rem;
}
@media (width >= 80rem) {
max-width: 80rem;
}
@media (width >= 96rem) {
max-width: 96rem;
}
}
.my-4 {
margin-block: calc(var(--spacing) * 4);
.mx-auto {
margin-inline: auto;
}
.mb-2 {
margin-bottom: calc(var(--spacing) * 2);
.mt-8 {
margin-top: calc(var(--spacing) * 8);
}
.mr-2 {
margin-right: calc(var(--spacing) * 2);
}
.mb-4 {
margin-bottom: calc(var(--spacing) * 4);
}
.flex {
display: flex;
}
.table {
display: table;
}
.h-8 {
height: calc(var(--spacing) * 8);
}
.w-full {
width: 100%;
}
.border-collapse {
border-collapse: collapse;
}
.resize {
resize: both;
}
.items-center {
align-items: center;
}
.justify-between {
justify-content: space-between;
}
.justify-center {
justify-content: center;
}
.gap-8 {
gap: calc(var(--spacing) * 8);
}
.space-x-4 {
:where(& > :not(:last-child)) {
--tw-space-x-reverse: 0;
margin-inline-start: calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));
margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
}
}
.border {
border-style: var(--tw-border-style);
border-width: 1px;
}
.text-4xl {
font-size: var(--text-4xl);
line-height: var(--tw-leading, var(--text-4xl--line-height));
.bg-gray-200 {
background-color: var(--color-gray-200);
}
.bg-gray-800 {
background-color: var(--color-gray-800);
}
.p-4 {
padding: calc(var(--spacing) * 4);
}
.px-4 {
padding-inline: calc(var(--spacing) * 4);
}
.py-4 {
padding-block: calc(var(--spacing) * 4);
}
.py-8 {
padding-block: calc(var(--spacing) * 8);
}
.text-center {
text-align: center;
}
.text-blue-400 {
color: var(--color-blue-400);
}
.text-bodylinks {
color: var(--color-bodylinks);
}
.text-gray-800 {
color: var(--color-gray-800);
}
.text-white {
color: var(--color-white);
}
.underline {
text-decoration-line: underline;
@@ -200,35 +292,131 @@
outline-style: var(--tw-outline-style);
outline-width: 1px;
}
.transition {
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
.hover\:text-gray-400 {
&:hover {
@media (hover: hover) {
color: var(--color-gray-400);
}
}
}
}
body {
width: 100%;
@media (width >= 40rem) {
max-width: 40rem;
}
@media (width >= 48rem) {
max-width: 48rem;
}
@media (width >= 64rem) {
max-width: 64rem;
}
@media (width >= 80rem) {
max-width: 80rem;
}
@media (width >= 96rem) {
max-width: 96rem;
}
margin-inline: auto;
background-color: var(--color-slate-900);
padding-inline: calc(var(--spacing) * 4);
padding-block: calc(var(--spacing) * 8);
font-family: var(--font-sans);
font-size: var(--text-base);
line-height: var(--tw-leading, var(--text-base--line-height));
color: var(--color-gray-200);
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
a {
color: #00B7FF;
::selection {
background: var(--color-warning);
}
@layer components {
h1, h2, h3, h4, h5, h6 {
font-weight: 700;
margin: 0 0 1rem;
}
h1, .h1 {
font-size: var(--h1);
line-height: 1.2;
}
h2, .h2 {
font-size: var(--h2);
line-height: 1.3;
}
h3, .h3 {
font-size: var(--h3);
line-height: 1.4;
}
h4, .h4 {
font-size: var(--h4);
line-height: 1.5;
}
h5, .h5 {
font-size: var(--h5);
}
h6, .h6 {
font-size: var(--h6);
}
}
a, .link {
color: var(--color-bodylinks);
text-decoration: none;
transition: color 200ms;
cursor: pointer;
&:hover {
color: var(--color-primary);
}
}
h1 a, .h1 a, h2 a, .h2 a, h3 a, .h3 a {
color: inherit;
text-decoration: underline;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
li ul, li ol {
margin: 0 1rem;
}
ul {
list-style-type: disc;
}
ol {
list-style-type: decimal;
}
ol ol {
list-style: lower-alpha;
}
ol ol ol {
list-style: lower-roman;
}
ol ol ol ol {
list-style: lower-alpha;
}
pre, code, samp, style {
font-family: monospace;
}
pre {
font-size: 0.875rem;
overflow: auto;
padding: 1.5rem;
}
pre code {
background-color: inherit;
border-radius: 0;
color: inherit;
padding: 0;
}
code {
border-radius: var(--radius-sm);
background-color: color-mix(in srgb, oklch(0% 0 0) 30%, transparent);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--color-black) 30%, transparent);
}
padding-inline: 3px;
padding-block: 2px;
font-family: var(--font-mono);
font-size: var(--text-xs);
line-height: var(--tw-leading, var(--text-xs--line-height));
color: var(--color-black);
}
hr {
background-color: black;
border: none;
display: block;
height: 1px;
margin: 1rem 0;
width: 100%;
}
@property --tw-space-x-reverse {
syntax: "*";
inherits: false;
initial-value: 0;
}
@property --tw-border-style {
syntax: "*";
@@ -243,6 +431,7 @@ a {
@layer properties {
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
*, ::before, ::after, ::backdrop {
--tw-space-x-reverse: 0;
--tw-border-style: solid;
--tw-outline-style: solid;
}