phase-4: scss upgrade

This commit is contained in:
Sai Kiran Vella
2026-06-04 15:49:49 -04:00
parent dc7ee22135
commit 57190f2945
18 changed files with 1275 additions and 819 deletions
+67
View File
@@ -0,0 +1,67 @@
@use 'sass:map';
// ── Shared pill base ─────────────────────────────────────────────────────
%pill-base {
display: inline-block;
font-weight: 700;
letter-spacing: 0.06em;
padding: 3px 10px;
border-radius: var(--radius-pill);
}
// ── Verdict pill ─────────────────────────────────────────────────────────
// Unified: replaces both .verdict-pill (screener) and .vpill (safe-buys)
$verdict-variants: (
'green': (color: var(--green), bg: var(--green-bg)),
'yellow': (color: var(--yellow), bg: var(--yellow-bg)),
'red': (color: var(--red), bg: var(--red-bg)),
);
.verdict-pill {
@extend %pill-base;
font-size: var(--fs-sm);
letter-spacing: 0.02em;
@each $name, $vals in $verdict-variants {
&.#{$name} {
background: map.get($vals, 'bg');
color: map.get($vals, 'color');
}
}
}
// ── Sentiment pill (LLM sidebar — BULLISH / BEARISH / NEUTRAL) ───────────
$sentiment-variants: (
BULLISH: (color: var(--green), bg: var(--green-bg)),
BEARISH: (color: var(--red), bg: var(--red-bg)),
NEUTRAL: (color: var(--text-muted), bg: var(--bg-card)),
);
.sentiment-pill {
@extend %pill-base;
font-size: var(--fs-xs);
@each $sentiment, $vals in $sentiment-variants {
&[data-sentiment='#{$sentiment}'] {
background: map.get($vals, 'bg');
color: map.get($vals, 'color');
}
}
}
// ── Text colour helpers ───────────────────────────────────────────────────
$text-colors: (
'green': var(--green),
'yellow': var(--yellow),
'red': var(--red),
'orange': var(--orange),
);
@each $name, $color in $text-colors {
.text-#{$name} { color: $color; font-weight: 600; }
}
.text-gray { color: var(--text-dim); }
+101
View File
@@ -0,0 +1,101 @@
// ── Shared placeholders ───────────────────────────────────────────────────
%btn-disabled {
opacity: 0.45;
cursor: default;
}
%btn-inline-flex {
display: inline-flex;
align-items: center;
justify-content: center;
}
// ── Button base reset ─────────────────────────────────────────────────────
button {
cursor: pointer;
font-family: inherit;
font-size: var(--fs-md);
font-weight: 600;
border: none;
border-radius: var(--radius-md);
padding: 10px 18px;
white-space: nowrap;
transition: background var(--transition), opacity var(--transition), color var(--transition);
&:disabled { @extend %btn-disabled; }
}
// ── btn-primary (blue filled — " New Call", "Save Call") ───────────────
.btn-primary {
@extend %btn-inline-flex;
background: var(--blue-dark);
color: #fff;
gap: 8px;
&:hover:not(:disabled) { background: var(--blue-darker); }
&:disabled { opacity: 0.5; }
}
// ── btn-catalyst (blue filled — "📰 Today Market") ──────────────────────
.btn-catalyst {
@extend %btn-inline-flex;
background: var(--blue-dark);
color: #fff;
gap: 6px;
padding: 10px 20px;
&:hover:not(:disabled) { background: var(--blue-darker); }
}
// ── btn-ghost (dark border — "🔍 Search tickers") ───────────────────────
.btn-ghost {
background: var(--bg-card);
color: var(--text-dim);
border: 1px solid var(--border-input);
font-size: 12px;
padding: 8px 14px;
&:hover { background: #263347; color: var(--text-muted); }
}
// ── btn-screen (muted blue — "Screen" inside search row) ────────────────
.btn-screen {
@extend %btn-inline-flex;
background: var(--blue-surface);
color: var(--blue-muted);
border: 1px solid var(--blue-surface);
min-width: 80px;
&:hover:not(:disabled) { background: #163356; }
}
// ── btn-analyze (ghost blue — "✦ Analyze" in section header) ────────────
.btn-analyze {
@extend %btn-inline-flex;
background: transparent;
color: #7c93b0;
border: 1px solid var(--border);
font-size: var(--fs-sm);
font-weight: 600;
letter-spacing: 0.04em;
padding: 4px 12px;
border-radius: var(--radius-sm);
gap: 5px;
margin-left: 8px;
white-space: nowrap;
&:hover:not(:disabled) {
background: var(--blue-deep);
color: #93c5fd;
border-color: var(--blue-surface);
}
&:disabled { @extend %btn-disabled; opacity: 0.4; }
}
+109
View File
@@ -0,0 +1,109 @@
// ── Shell & Navigation ────────────────────────────────────────────────────
.shell {
min-height: 100vh;
display: flex;
flex-direction: column;
}
nav {
display: flex;
align-items: center;
gap: var(--space-2xl);
padding: 14px 32px;
border-bottom: 1px solid var(--border);
background: var(--bg-base);
position: sticky;
top: 0;
z-index: 10;
}
.brand { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.links {
display: flex;
gap: var(--space-xs);
margin-left: auto;
a {
color: var(--text-dim);
text-decoration: none;
padding: 6px 14px;
border-radius: var(--radius-sm);
font-weight: 500;
transition: color var(--transition), background var(--transition);
// Active and hover share identical styles — one rule
&:hover,
&.active {
color: var(--text-secondary);
background: var(--bg-card);
}
}
}
main { flex: 1; padding: 28px 32px; }
// ── Navigation progress bar ───────────────────────────────────────────────
.nav-progress {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 2px;
z-index: 100;
background: var(--bg-card);
overflow: hidden;
.nav-bar {
height: 100%;
background: var(--blue);
animation: nav-progress 1.5s ease-in-out infinite;
transform-origin: left;
}
}
@keyframes nav-progress {
0% { transform: translateX(-100%) scaleX(0.3); }
50% { transform: translateX(0%) scaleX(0.7); }
100% { transform: translateX(100%) scaleX(0.3); }
}
// ── Page-load overlay ─────────────────────────────────────────────────────
.nav-overlay {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 14px;
padding: 100px 0;
flex: 1;
}
.nav-spinner {
width: 40px;
height: 40px;
border: 3px solid var(--bg-card);
border-top-color: var(--blue);
border-radius: 50%;
animation: spin 0.7s linear infinite;
}
.nav-label {
font-size: var(--fs-xs);
color: var(--text-dimmer);
letter-spacing: 0.02em;
}
@keyframes spin { to { transform: rotate(360deg); } }
// ── Shared loading area ───────────────────────────────────────────────────
.loading-area {
display: flex;
justify-content: center;
align-items: center;
padding: 80px 0;
}
+10
View File
@@ -0,0 +1,10 @@
// ── Reset & Base ──────────────────────────────────────────────────────────
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg-base);
color: var(--text-secondary);
font-size: var(--fs-md);
}
+78
View File
@@ -0,0 +1,78 @@
// ── Section card ──────────────────────────────────────────────────────────
.section {
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
margin-bottom: 16px;
overflow: hidden;
}
.section-header {
display: flex;
align-items: center;
gap: 10px;
padding: 14px var(--space-xl) 12px;
border-bottom: 1px solid var(--border);
background: var(--bg-elevated);
}
// Section heading — small caps label style
.section h2,
.section-header h2 {
font-size: var(--fs-sm);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-dim);
margin: 0;
}
// ── Count badge ───────────────────────────────────────────────────────────
.count {
font-size: var(--fs-xs);
font-weight: 600;
color: var(--text-faint);
background: var(--bg-card);
padding: 2px 7px;
border-radius: var(--radius-pill);
}
// ── Mode tabs (Mkt-Adjusted / Graham) ────────────────────────────────────
.mode-tabs {
display: flex;
gap: var(--space-xs);
margin-left: auto;
button {
background: transparent;
color: var(--text-dimmer);
border: 1px solid var(--border);
font-size: var(--fs-sm);
padding: 4px 12px;
border-radius: var(--radius-sm);
font-weight: 600;
cursor: pointer;
transition: background var(--transition), color var(--transition);
&.active {
background: var(--blue-surface);
color: var(--blue-muted);
border-color: var(--blue-surface);
}
}
}
// ── Error banner ──────────────────────────────────────────────────────────
.error-banner {
background: var(--red-deep);
border: 1px solid var(--red-border);
border-radius: var(--radius-md);
color: var(--red);
padding: 10px var(--space-lg);
margin-bottom: 16px;
font-size: var(--fs-md);
}
+91
View File
@@ -0,0 +1,91 @@
// ── Shared table styles ───────────────────────────────────────────────────
.table-wrap {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
table {
width: max-content;
min-width: 100%;
border-collapse: collapse;
thead th {
text-align: left;
padding: 8px var(--space-lg);
font-size: var(--fs-xs);
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-faint);
border-bottom: 1px solid var(--border);
white-space: nowrap;
background: var(--bg-elevated);
}
tbody {
tr {
border-bottom: 1px solid var(--border-subtle);
&:hover {
background: var(--bg-card-hover);
td:first-child { background: var(--bg-card-hover); }
}
}
td {
padding: 10px var(--space-lg);
vertical-align: middle;
white-space: nowrap;
font-size: var(--fs-md);
// Sticky first column (body)
&:first-child {
position: sticky;
left: 0;
background: var(--bg-surface);
z-index: 1;
}
}
}
}
// Sticky col-ticker (thead — applied via class to support .col-ticker th)
.col-ticker {
position: sticky;
left: 0;
background: var(--bg-elevated);
z-index: 1;
}
// ── Cell helpers ──────────────────────────────────────────────────────────
.ticker {
font-weight: 700;
font-size: var(--fs-md);
color: var(--text-primary);
letter-spacing: 0.02em;
}
.num {
color: var(--text-dim);
font-variant-numeric: tabular-nums;
font-size: 12px;
}
// ── Tag pill (STOCK / ETF / BOND / sector) ────────────────────────────────
.tag {
display: inline-block;
background: var(--bg-card);
color: var(--text-dim);
padding: 2px 8px;
border-radius: var(--radius-xs);
font-size: var(--fs-xs);
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
&.sm { padding: 1px 6px; }
}
+91
View File
@@ -0,0 +1,91 @@
// ── Design Tokens ────────────────────────────────────────────────────────
// SCSS maps generate CSS custom properties. Organised by category so new
// tokens are easy to locate and add. All runtime theming uses var(--name).
// Background layers — darkest to lightest
$bg: (
base: #0f1117, // body, nav background
surface: #0d1117, // section cards, sidebar
elevated: #111827, // section headers, table headers
card: #1e293b, // input bg, tags, summary cards, ctx cards
card-hover: #131c2b, // table row hover
row-alt: #1a2233, // portfolio table row border
);
// Borders
$borders: (
border: #1e293b, // primary — cards, sections, inputs
border-subtle: #161f2e, // table row separators
border-input: #2d3f55, // form input borders
);
// Text — brightest to most muted
$text: (
text-primary: #f1f5f9, // headings, tickers, card values
text-secondary: #e2e8f0, // body text, input values
text-muted: #94a3b8, // secondary text, reasons
text-dim: #64748b, // labels, table headers, muted values
text-dimmer: #475569, // very muted — timestamps, hints
text-faint: #334155, // count badge text, column headers
);
// Blue accent ('blue' is a CSS color name — must be quoted)
$blues: (
'blue': #3b82f6, // focus ring, progress bar, bar-fill
'blue-dark': #2563eb, // primary button bg
'blue-darker': #1d4ed8, // primary button hover
'blue-muted': #60a5fa, // active tab text, edit icon hover
'blue-surface': #1e3a5f, // active tab bg, mode tab bg
'blue-deep': #0f2240, // analyze button hover bg
'blue-badge': #0d1e30, // sidebar header background
);
// Signal / semantic colors (green/yellow/red/orange are CSS color names — must be quoted)
$signals: (
'green': #4ade80,
'green-bg': #14532d33,
'yellow': #facc15,
'yellow-bg': #71350033,
'red': #f87171,
'red-bg': #450a0a33,
'red-deep': #450a0a55, // error banner bg
'red-border': #7f1d1d, // error banner border
'orange': #fb923c,
);
// ── Emit all maps as CSS custom properties ───────────────────────────────
:root {
@each $name, $val in $bg { --bg-#{$name}: #{$val}; }
@each $name, $val in $borders { --#{$name}: #{$val}; }
@each $name, $val in $text { --#{$name}: #{$val}; }
@each $name, $val in $blues { --#{$name}: #{$val}; }
@each $name, $val in $signals { --#{$name}: #{$val}; }
// Typography
--fs-2xs: 9px;
--fs-xs: 10px;
--fs-sm: 11px;
--fs-md: 13px;
--fs-lg: 15px;
--fs-xl: 18px;
--fs-2xl: 20px;
// Border radius
--radius-xs: 4px;
--radius-sm: 6px;
--radius-md: 8px;
--radius-lg: 10px;
--radius-pill: 20px;
// Spacing
--space-xs: 4px;
--space-sm: 8px;
--space-md: 12px;
--space-lg: 14px;
--space-xl: 18px;
--space-2xl: 24px;
--space-3xl: 32px;
// Transitions
--transition: 0.15s;
}
+11
View File
@@ -0,0 +1,11 @@
// ── Root stylesheet — imports all shared token/pattern partials ───────────
// Order matters: tokens first (defines CSS custom properties), then reset
// (uses tokens on body), then layout patterns.
@use 'tokens';
@use 'reset';
@use 'layout';
@use 'section';
@use 'table';
@use 'buttons';
@use 'badges';