- {@html txt} -+
+ {@html txt} ++
diff --git a/src/app.css b/src/app.css index d22767e7..726a0c09 100644 --- a/src/app.css +++ b/src/app.css @@ -1,8 +1,8 @@ /* -Taking lots of inspiration from Distill.pub -https://github.com/distillpub/template/blob/master/src/styles/d-article.css -g*/ + Inspired by Distill.pub: https://github.com/distillpub/template/blob/master/src/styles/d-article.css +*/ +@import './design-tokens.css'; @import './fonts.css'; @import './code.css'; @import './utils.css'; @@ -10,146 +10,346 @@ g*/ @import './flair.css'; @import './classes.css'; -:root { - --breakpoint: 1200px; - --font: 'overpassregular', sans-serif; - --mono: 'Overpass Mono', monospace; - --dark-blue: #083c64; - --med-blue: #0371b5; - --light-blue: #1ca4fc; - --max-text-width: 70ch; - --min-text-width: 30ch; - --footer-height: 55px; - --event-flair: rgb(235, 161, 23); - --article-flair: var(--med-blue); - --reference-flair: rgb(34, 140, 34); - --podcast-flair: palevioletred; - --tutorial-flair: rgba(102, 103, 171, 255); - --grey: rgb(89, 89, 89); -} - -* { +/* ── Reset & Base ────────────────────────────────────────── */ + +*, +*::before, +*::after { box-sizing: border-box; } html { - font-family: var(--font); + font-family: var(--font-sans); font-size: 16px; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; + scroll-behavior: smooth; } body { margin: 0; - line-height: 1.5; + line-height: var(--leading-normal); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - color: #333; /* Default text color */ + color: var(--color-text); + background-color: var(--color-background); +} + +/* ── Typography ──────────────────────────────────────────── */ + +h1, h2, h3, h4, h5, h6 { + font-family: var(--font-sans); + color: var(--color-neutral-900); + text-wrap: balance; +} + +h1 { + font-size: var(--text-4xl); + font-weight: var(--font-extrabold); + line-height: var(--leading-tight); + letter-spacing: var(--tracking-tight); + margin: 0 0 0.5em; +} + +h2 { + font-size: var(--text-3xl); + font-weight: var(--font-bold); + line-height: var(--leading-snug); + letter-spacing: var(--tracking-tight); + margin: var(--heading-spacing) 0 var(--heading-spacing); + padding: 0; +} + +h3 { + font-size: var(--text-2xl); + font-weight: var(--font-semibold); + line-height: var(--leading-snug); + margin: 1.25em 0 0.5em; +} + +h4 { + font-size: var(--text-xl); + font-weight: var(--font-semibold); + line-height: var(--leading-snug); + margin: 1em 0 0.4em; } -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: var(--font); - margin: 0.6em 0; - line-height: 1.3; +h5, h6 { + font-size: var(--text-lg); + font-weight: var(--font-bold); + line-height: var(--leading-snug); + margin: 1em 0 0.4em; +} + +/* Body text with consistent rhythm */ +p { + margin: 0 0 var(--paragraph-spacing); + line-height: var(--leading-relaxed); } -ul, -ol, -p, blockquote { - margin-top: 0; - margin-bottom: 1em; - margin-left: 0; - margin-right: 0; - line-height: 1.7em; + margin: var(--space-8) 0; + padding: 0; } -li > p { - line-height: 1.2em; +/* ── Lists ───────────────────────────────────────────────── */ + +ul, ol { + margin: 0 0 var(--paragraph-spacing); + padding-left: 1.75em; + line-height: var(--leading-relaxed); } li { - margin-left: 0; - margin-right: 0; + margin-bottom: 0.35em; } -h1 { - font-size: 2.625em; - line-height: 1.2; +li:last-child { + margin-bottom: 0; } -h2 { - font-size: 1.625em; - line-height: 1.2; +li > p { + line-height: var(--leading-normal); + margin-bottom: 0.3em; } -h3 { - font-size: 1.3125em; - line-height: 1.24; +/* Nested lists */ +li > ul, li > ol { + margin-top: 0.35em; + margin-bottom: 0; } -h4 { - font-size: 1.1875em; - line-height: 1.23; +/* Custom bullet for unordered lists in articles */ +main ul { + list-style: none; + padding-left: 1.5em; +} + +main ul > li { + position: relative; +} + +main ul > li::before { + content: ''; + position: absolute; + left: -1.25em; + top: 0.6em; + width: 6px; + height: 6px; + border-radius: 50%; + background-color: var(--color-primary-300); +} + +main ul ul > li::before { + width: 5px; + height: 5px; + border-radius: 50%; + border: 1.5px solid var(--color-primary-300); + background-color: transparent; + top: 0.55em; +} + +/* ── Definition Lists ────────────────────────────────────── */ + +dl { + margin: var(--space-6) 0; +} + +dt { + font-weight: var(--font-bold); + font-size: var(--text-base); + color: var(--color-primary-800); + margin-top: var(--space-4); + margin-bottom: var(--space-1); +} + +dt:first-child { + margin-top: 0; +} + +dd { + margin-left: var(--space-5); + margin-bottom: var(--space-3); + color: var(--color-text-muted); + line-height: var(--leading-normal); + font-size: var(--text-sm); +} + +dd:last-child { + margin-bottom: 0; +} + +/* ── Tables ──────────────────────────────────────────────── */ + +table { + width: 100%; + margin: var(--space-6) 0; + border-collapse: collapse; + font-size: var(--text-sm); + line-height: var(--leading-normal); + border-radius: var(--radius-md); + overflow: hidden; + box-shadow: var(--shadow-sm); +} + +thead { + background-color: var(--color-primary-50); +} + +th { + text-align: left; + padding: var(--space-3) var(--space-4); + font-weight: var(--font-bold); + color: var(--color-primary-800); + font-size: var(--text-xs); + text-transform: uppercase; + letter-spacing: var(--tracking-wide); + border-bottom: 2px solid var(--color-primary-200); +} + +td { + padding: var(--space-3) var(--space-4); + border-bottom: 1px solid var(--color-neutral-200); + color: var(--color-text); } -h5, -h6 { - font-size: 1em; - font-weight: bold; +tbody tr:last-child td { + border-bottom: none; } +tbody tr:nth-child(even) { + background-color: var(--color-neutral-50); +} + +tbody tr:hover { + background-color: rgba(28, 164, 252, 0.04); +} + +/* Responsive table wrapper — wrap tables in a div.table-wrap */ +.table-wrap { + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + margin: var(--space-6) 0; +} + +.table-wrap table { + margin: 0; + min-width: 100%; +} + +/* ── Links ───────────────────────────────────────────────── */ + a { - color: var(--med-blue); - max-width: max-content; + color: var(--color-link); + text-decoration-thickness: 1px; + text-underline-offset: 2px; + transition: color var(--transition-fast), background-color var(--transition-fast); + border-radius: 2px; } a:hover { - color: white; - background: var(--med-blue); + color: var(--color-link-hover-text); + background: var(--color-link-hover-bg); + text-decoration-color: transparent; } -.title-box:after { - margin-top: 0.5em; - margin-bottom: 0.5em; +/* Inline links in paragraphs get subtler treatment */ +p a, li a, figcaption a { + text-decoration: underline; + text-decoration-color: rgba(3, 113, 181, 0.3); +} + +p a:hover, li a:hover, figcaption a:hover { + text-decoration-color: transparent; +} + +/* ── Code ────────────────────────────────────────────────── */ + +code { + font-family: var(--font-mono); + font-size: 0.9em; + color: var(--color-code-text); + background-color: var(--color-code-bg); + padding: 0.15em 0.35em; + border-radius: 3px; + border: 1px solid var(--color-neutral-200); +} + +pre code { + border: none; + padding: 0; + background: none; + font-size: 0.875rem; +} + +/* ── Title Box ───────────────────────────────────────────── */ + +.title-box::after { + margin-top: var(--space-4); + margin-bottom: var(--space-4); height: 1px; - content: ' '; + content: ''; display: block; - border-top: 0.5px solid #dcdee0; + border: none; + background: linear-gradient( + to right, + var(--color-border), + transparent 80% + ); } -code { - font-family: var(--mono); - font-size: 1em; - color: #555; - background-color: #f0f0f0; - padding: 0.1em 0.1em; - border-radius: 2px; +/* ── Horizontal Rules ────────────────────────────────────── */ + +hr { + border: none; + height: 1px; + margin: var(--space-8) 0; + background: linear-gradient( + to right, + transparent, + var(--color-neutral-300) 20%, + var(--color-neutral-300) 80%, + transparent + ); } +/* ── Heading Anchor Links ────────────────────────────────── */ + .autolink { width: 16px; height: 16px; padding-left: 0.3em; padding-right: 0.3em; + opacity: 0; + transition: opacity var(--transition-fast); +} + +h2:hover .autolink, +h3:hover .autolink, +h4:hover .autolink { + opacity: 0.5; } h2 > a:hover { background-color: transparent; } -/* New styles for consistency across components */ +/* ── Selection ───────────────────────────────────────────── */ + +::selection { + background-color: rgba(28, 164, 252, 0.2); + color: var(--color-neutral-900); +} + +/* ── Shared Utility Classes ──────────────────────────────── */ + .component-title { - font-size: 1.2rem; - font-weight: bold; - margin-bottom: 0.5em; - line-height: 1.3; + font-size: var(--text-md); + font-weight: var(--font-bold); + margin-bottom: var(--space-2); + line-height: var(--leading-snug); } .component-text { @@ -158,24 +358,24 @@ h2 > a:hover { } .small-text { - font-size: 0.8rem; + font-size: var(--text-xs); } .flair, .url { - font-size: 0.75rem; - font-weight: bold; + font-size: var(--text-xs); + font-weight: var(--font-bold); } .hover-effect { - transition: transform 0.3s ease, box-shadow 0.3s ease; + transition: transform var(--transition-slow), box-shadow var(--transition-slow); } .hover-effect:hover { transform: translateY(-2px); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08); + box-shadow: var(--shadow-md); } .rounded-corners { - border-radius: 12px; + border-radius: var(--radius-lg); overflow: hidden; } diff --git a/src/classes.css b/src/classes.css index c3e2f072..5c1836ec 100644 --- a/src/classes.css +++ b/src/classes.css @@ -1,11 +1,10 @@ .interactive-example-container { - margin-top: 2em; - margin-bottom: 2em; + margin-top: var(--space-8); + margin-bottom: var(--space-8); display: flex; flex-direction: column; - gap: 1em; - border-width: 2px; - border-style: solid; - border-color: rgba(28, 164, 252, 0.3); - padding: 1em; -} \ No newline at end of file + gap: var(--space-4); + border: 2px solid rgba(28, 164, 252, 0.3); + padding: var(--space-4); + border-radius: var(--radius-md); +} diff --git a/src/design-tokens.css b/src/design-tokens.css new file mode 100644 index 00000000..19c304c8 --- /dev/null +++ b/src/design-tokens.css @@ -0,0 +1,177 @@ +/* FluCoMa Learn — Design Tokens */ + +:root { + /* ── Color Palette ─────────────────────────────────────── */ + + /* Primary (Brand Blue) */ + --color-primary-50: #e6f2fa; + --color-primary-100: #b3d8f0; + --color-primary-200: #80bef0; + --color-primary-300: #4da8f5; + --color-primary-400: #1ca4fc; + --color-primary-500: #0390d6; + --color-primary-600: #0371b5; + --color-primary-700: #025891; + --color-primary-800: #083c64; + --color-primary-900: #042038; + + /* Neutral (Gray) */ + --color-neutral-50: #f8f9fa; + --color-neutral-100: #f0f0f0; + --color-neutral-200: #e0e0e0; + --color-neutral-300: #dcdee0; + --color-neutral-400: #b0b3b5; + --color-neutral-500: #8a8d90; + --color-neutral-600: #595959; + --color-neutral-700: #4a4d50; + --color-neutral-800: #333333; + --color-neutral-900: #1a1a1a; + + /* Content-Type Accents (flairs) */ + --color-article: #1ca4fc; + --color-event: #eba117; + --color-reference: #228c22; + --color-podcast: #db7093; + --color-tutorial: #6667ab; + + /* Admonition / Semantic */ + --color-note-bg: rgba(52, 52, 171, 0.2); + --color-note-border: rgba(31, 31, 136, 0.63); + --color-note-text: #414141; + --color-warning-bg: rgba(255, 204, 0, 0.2); + --color-warning-border: rgba(255, 204, 0, 0.63); + --color-danger-bg: rgba(204, 51, 0, 0.2); + --color-danger-border: rgba(204, 51, 0, 0.63); + --color-success-bg: rgba(230, 252, 224, 1); + --color-success-border: rgb(133, 229, 106); + + /* Semantic Aliases (consume these in components) */ + --color-text: var(--color-neutral-800); + --color-text-muted: var(--color-neutral-600); + --color-text-inverted: #ffffff; + --color-background: #ffffff; + --color-surface: var(--color-neutral-50); + --color-border: var(--color-neutral-300); + --color-link: var(--color-primary-600); + --color-link-hover-bg: var(--color-primary-600); + --color-link-hover-text: #ffffff; + --color-code-bg: var(--color-neutral-100); + --color-code-text: #555555; + --color-code-block-bg: #f7f7f7; + + /* ── Typography ────────────────────────────────────────── */ + + --font-sans: 'overpassregular', sans-serif; + --font-mono: 'Overpass Mono', monospace; + + /* Type Scale (1.25 major-third ratio) */ + --text-xs: 0.75rem; /* 12px */ + --text-sm: 0.875rem; /* 14px */ + --text-base: 1rem; /* 16px */ + --text-md: 1.125rem; /* 18px */ + --text-lg: 1.25rem; /* 20px */ + --text-xl: 1.5rem; /* 24px */ + --text-2xl: 1.75rem; /* 28px */ + --text-3xl: 2.125rem; /* 34px */ + --text-4xl: 2.5rem; /* 40px (h1) */ + + /* Font Weights */ + --font-normal: 400; + --font-semibold: 600; + --font-bold: 700; + --font-extrabold: 800; + + /* Letter Spacing */ + --tracking-tight: -0.015em; + --tracking-normal: 0; + --tracking-wide: 0.02em; + + /* Line Heights */ + --leading-tight: 1.15; + --leading-snug: 1.25; + --leading-normal: 1.6; + --leading-relaxed: 1.75; + + /* Content Rhythm */ + --paragraph-spacing: 1.25em; + --heading-spacing: 0.5em; + --section-spacing: 2em; + + /* ── Spacing Scale (4px base) ──────────────────────────── */ + + --space-0: 0; + --space-1: 0.25rem; /* 4px */ + --space-2: 0.5rem; /* 8px */ + --space-3: 0.75rem; /* 12px */ + --space-4: 1rem; /* 16px */ + --space-5: 1.25rem; /* 20px */ + --space-6: 1.5rem; /* 24px */ + --space-8: 2rem; /* 32px */ + --space-10: 2.5rem; /* 40px */ + --space-12: 3rem; /* 48px */ + --space-16: 4rem; /* 64px */ + + /* ── Border Radius ─────────────────────────────────────── */ + + --radius-none: 0; + --radius-sm: 0.25rem; /* 4px — subtle rounding */ + --radius-md: 0.5rem; /* 8px — cards, inputs */ + --radius-lg: 0.75rem; /* 12px — containers, modals */ + --radius-xl: 1rem; /* 16px */ + --radius-full: 9999px; /* pills, badges */ + + /* ── Shadows / Elevation ───────────────────────────────── */ + + --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1); + --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06); + --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05); + --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04); + + /* Interactive shadow (brand-tinted for raised cards/buttons) */ + --shadow-interactive: var(--color-primary-600) -5px 5px 0px -3px, + rgba(3, 113, 181, 0.2) -10px 10px, + rgba(3, 113, 181, 0.1) -15px 15px, + rgba(3, 113, 181, 0.05) -20px 20px; + + /* ── Transitions ───────────────────────────────────────── */ + + --transition-fast: 150ms ease; + --transition-base: 200ms ease; + --transition-slow: 300ms ease; + + /* ── Breakpoints (reference; use in media queries) ─────── */ + + --bp-tablet: 768px; + --bp-desktop: 1200px; + + /* ── Layout ────────────────────────────────────────────── */ + + --max-text-width: 70ch; + --min-text-width: 30ch; + --header-height: 55px; + --footer-height: 55px; + + /* ── Cards ─────────────────────────────────────────────── */ + + --card-radius: var(--radius-lg); + --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04); + --card-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06); + --card-image-overlay: linear-gradient(180deg, transparent 55%, rgba(8, 60, 100, 0.75) 100%); + --card-transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), + box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); + + /* ── Backwards-compat aliases (keep old var names working) ─ */ + + --font: var(--font-sans); + --mono: var(--font-mono); + --dark-blue: var(--color-primary-800); + --med-blue: var(--color-primary-600); + --light-blue: var(--color-primary-400); + --grey: var(--color-neutral-600); + --breakpoint: var(--bp-desktop); + --event-flair: var(--color-event); + --article-flair: var(--color-article); + --reference-flair: var(--color-reference); + --podcast-flair: var(--color-podcast); + --tutorial-flair: var(--color-tutorial); +} diff --git a/src/flair.css b/src/flair.css index 63c00313..63e5875f 100644 --- a/src/flair.css +++ b/src/flair.css @@ -1,19 +1,7 @@ -.event { - background-color: rgb(235, 161, 23); -} +/* Flair (content-type) colors — used as background pills/badges */ -.article { - background-color: var(--light-blue); -} - -.reference { - background-color: forestgreen; -} - -.podcast { - background-color: palevioletred; -} - -.tutorial { - background-color: rgba(102, 103, 171, 255); -} +.flair-event { background-color: var(--color-event); } +.flair-article { background-color: var(--color-article); } +.flair-reference { background-color: var(--color-reference); } +.flair-podcast { background-color: var(--color-podcast); } +.flair-tutorial { background-color: var(--color-tutorial); } diff --git a/src/lib/components/Admonition.svelte b/src/lib/components/Admonition.svelte index e9ba0c0a..d1770056 100644 --- a/src/lib/components/Admonition.svelte +++ b/src/lib/components/Admonition.svelte @@ -1,64 +1,64 @@ -
- {@html txt} -+
+ {@html txt} ++