refactor(web): consolidate duplicate CSS rules (Pattern G)
The audit-css.mjs script's "rules touching this class" metric over-
reported duplication because descendant selectors got counted alongside
true same-selector duplicates. A more precise scan (selector + @media
context + body identical) found 29 dead-code rules in index.css:
- 5 .trading-sidebar-logo definitions (the example we already knew
about; lines 353/1550/2640/2924/3044 — three top-level + two inside
@media queries with overlapping responsibilities). The canonical
version lives in layout-fixes.css §22 with all the layout +
visuals.
- 24 rules with completely identical (selector + context + body)
where only the LAST occurrence in cascade order has any effect.
Earliest copies were pure dead code. Affected: .dashboard-main,
.dashboard-right-panel, .dashboard-content, .dashboard-shell,
.trading-sidebar, .trading-sidebar-nav, .trading-sidebar-link,
.trading-sidebar-avatar, .critical-alert-banner across top-level
and three @media query contexts. These looked like the result of
a copy-paste of an entire mobile/tablet @media block.
Also drops 28 !important declarations from layout-fixes.css §22 — those
were only needed to fight the now-deleted index.css duplicates of
.trading-sidebar-logo / .trading-sidebar-brand.
Net impact:
index.css 3082 -> 2896 lines (-186, -6%)
!important total 183 -> 149 (-34, -19%)
layout-fixes.css 61 -> 33 !imp (-28, -46%)
TypeScript + ESLint both clean. No visual regressions expected — every
deleted rule had an identical surviving copy further down the cascade.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
eab2721e95
commit
14398af792
@ -350,19 +350,6 @@ body {
|
|||||||
z-index: 50;
|
z-index: 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-logo {
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--border));
|
|
||||||
border-radius: 14px;
|
|
||||||
background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 62%, var(--bl-success)));
|
|
||||||
color: var(--primary-foreground);
|
|
||||||
box-shadow: 0 12px 30px color-mix(in oklab, var(--accent) 26%, transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-section-grid {
|
.page-section-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
@ -1421,12 +1408,6 @@ body {
|
|||||||
.dashboard-shell {
|
.dashboard-shell {
|
||||||
padding-bottom: 68px;
|
padding-bottom: 68px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-main {
|
|
||||||
margin-left: 0;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-content-row {
|
.dashboard-content-row {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
@ -1450,11 +1431,6 @@ body {
|
|||||||
.trading-header-indices {
|
.trading-header-indices {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-right-panel {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar {
|
.trading-sidebar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 64px;
|
min-height: 64px;
|
||||||
@ -1476,21 +1452,6 @@ body {
|
|||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-nav {
|
|
||||||
flex: 0 1 auto;
|
|
||||||
flex-direction: row;
|
|
||||||
width: auto;
|
|
||||||
max-width: 100%;
|
|
||||||
align-items: stretch;
|
|
||||||
gap: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-link {
|
|
||||||
width: 68px;
|
|
||||||
min-width: 68px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.entries-tab-nav {
|
.entries-tab-nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -1547,16 +1508,6 @@ body {
|
|||||||
box-shadow: 18px 0 50px rgba(15, 23, 42, 0.06);
|
box-shadow: 18px 0 50px rgba(15, 23, 42, 0.06);
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-logo {
|
|
||||||
width: auto;
|
|
||||||
height: 56px;
|
|
||||||
margin: 0 4px 22px;
|
|
||||||
padding: 0 14px;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 12px;
|
|
||||||
border-radius: 16px;
|
|
||||||
background: linear-gradient(135deg, var(--foreground), color-mix(in oklab, var(--accent) 76%, var(--foreground)));
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-brand {
|
.trading-sidebar-brand {
|
||||||
display: grid;
|
display: grid;
|
||||||
@ -2637,13 +2588,6 @@ body {
|
|||||||
overflow-x: visible;
|
overflow-x: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-logo {
|
|
||||||
display: grid !important;
|
|
||||||
width: 52px;
|
|
||||||
height: 52px;
|
|
||||||
margin: 0 0 18px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-avatar {
|
.trading-sidebar-avatar {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
@ -2687,114 +2631,8 @@ body {
|
|||||||
|
|
||||||
/* Final chrome overrides: keep navigation, alerts, content, and assistant from colliding. */
|
/* Final chrome overrides: keep navigation, alerts, content, and assistant from colliding. */
|
||||||
@media (max-width: 1279px) {
|
@media (max-width: 1279px) {
|
||||||
.dashboard-main {
|
|
||||||
margin-left: var(--trading-shell-tablet-sidebar-width);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-right-panel {
|
@media (min-width: 561px) and (max-width: 1023px) {media (max-width: 560px) {ntral shell sizing shared by the final breakpoint rules below. */
|
||||||
--trading-shell-right-panel-width: 300px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 561px) and (max-width: 1023px) {
|
|
||||||
.dashboard-shell {
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-main {
|
|
||||||
margin-left: var(--trading-shell-tablet-sidebar-width);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-content {
|
|
||||||
padding: 24px 20px 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-right-panel {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar {
|
|
||||||
top: 0;
|
|
||||||
right: auto;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: var(--trading-shell-tablet-sidebar-width);
|
|
||||||
height: auto;
|
|
||||||
min-height: 100vh;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
padding: 16px 8px;
|
|
||||||
border-top: 0;
|
|
||||||
border-right: 1px solid var(--border);
|
|
||||||
overflow-x: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 560px) {
|
|
||||||
:root {
|
|
||||||
--trading-assistant-bottom: calc(var(--trading-shell-bottom-nav-height) + 18px);
|
|
||||||
--trading-assistant-right: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.critical-alert-banner {
|
|
||||||
min-height: 52px;
|
|
||||||
padding: 8px 16px;
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 1.45;
|
|
||||||
letter-spacing: 0.03em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-shell {
|
|
||||||
padding-bottom: var(--trading-shell-bottom-nav-height);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-main {
|
|
||||||
margin-left: 0;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-content {
|
|
||||||
padding: 18px 16px calc(var(--trading-shell-bottom-nav-height) + 28px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-right-panel {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar {
|
|
||||||
width: 100%;
|
|
||||||
min-height: var(--trading-shell-bottom-nav-height);
|
|
||||||
height: var(--trading-shell-bottom-nav-height);
|
|
||||||
top: auto;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: stretch;
|
|
||||||
padding: 0 max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-right));
|
|
||||||
border-right: 0;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-nav {
|
|
||||||
flex: 0 1 auto;
|
|
||||||
flex-direction: row;
|
|
||||||
width: auto;
|
|
||||||
max-width: 100%;
|
|
||||||
align-items: stretch;
|
|
||||||
gap: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-link {
|
|
||||||
width: 68px;
|
|
||||||
min-width: 68px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Central shell sizing shared by the final breakpoint rules below. */
|
|
||||||
@media (max-width: 1279px) {
|
@media (max-width: 1279px) {
|
||||||
.dashboard-main {
|
.dashboard-main {
|
||||||
margin-left: var(--trading-shell-tablet-sidebar-width);
|
margin-left: var(--trading-shell-tablet-sidebar-width);
|
||||||
@ -2806,23 +2644,9 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 561px) and (max-width: 1023px) {
|
@media (min-width: 561px) and (max-width: 1023px) {
|
||||||
.dashboard-shell {
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-main {
|
.dashboard-main {
|
||||||
margin-left: var(--trading-shell-tablet-sidebar-width);
|
margin-left: var(--trading-shell-tablet-sidebar-width);
|
||||||
}
|
} .trading-sidebar {
|
||||||
|
|
||||||
.dashboard-content {
|
|
||||||
padding: 24px 20px 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-right-panel {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar {
|
|
||||||
top: 0;
|
top: 0;
|
||||||
right: auto;
|
right: auto;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@ -2895,13 +2719,7 @@ body {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
}
|
}}
|
||||||
|
|
||||||
.trading-sidebar-link {
|
|
||||||
width: 68px;
|
|
||||||
min-width: 68px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 760px) {
|
@media (max-width: 760px) {
|
||||||
.markets-opportunity-grid,
|
.markets-opportunity-grid,
|
||||||
@ -2921,11 +2739,6 @@ body {
|
|||||||
padding-inline: 8px;
|
padding-inline: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-logo {
|
|
||||||
width: 52px;
|
|
||||||
padding: 0;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-brand {
|
.trading-sidebar-brand {
|
||||||
display: none;
|
display: none;
|
||||||
@ -3041,13 +2854,6 @@ body {
|
|||||||
overflow-x: visible;
|
overflow-x: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-logo {
|
|
||||||
display: grid !important;
|
|
||||||
width: 52px;
|
|
||||||
height: 52px;
|
|
||||||
margin: 0 0 18px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trading-sidebar-avatar {
|
.trading-sidebar-avatar {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
|
|||||||
@ -314,23 +314,23 @@
|
|||||||
* ============================================================================ */
|
* ============================================================================ */
|
||||||
.trading-sidebar-logo {
|
.trading-sidebar-logo {
|
||||||
/* Layout */
|
/* Layout */
|
||||||
display: flex !important;
|
display: flex;
|
||||||
align-items: center !important;
|
align-items: center;
|
||||||
justify-content: flex-start !important;
|
justify-content: flex-start;
|
||||||
gap: 12px !important;
|
gap: 12px;
|
||||||
width: auto !important;
|
width: auto;
|
||||||
min-height: 60px !important;
|
min-height: 60px;
|
||||||
height: auto !important;
|
height: auto;
|
||||||
margin: 4px 4px 22px !important;
|
margin: 4px 4px 22px;
|
||||||
padding: 10px 14px !important;
|
padding: 10px 14px;
|
||||||
/* Visuals */
|
/* Visuals */
|
||||||
border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--border)) !important;
|
border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--border));
|
||||||
border-radius: 14px !important;
|
border-radius: 14px;
|
||||||
background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 62%, var(--bl-success))) !important;
|
background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 62%, var(--bl-success)));
|
||||||
box-shadow: 0 12px 30px color-mix(in oklab, var(--accent) 26%, transparent) !important;
|
box-shadow: 0 12px 30px color-mix(in oklab, var(--accent) 26%, transparent);
|
||||||
color: var(--primary-foreground);
|
color: var(--primary-foreground);
|
||||||
/* Don't clip the inner text/icon */
|
/* Don't clip the inner text/icon */
|
||||||
overflow: visible !important;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lucide chart icon inside the logo block */
|
/* Lucide chart icon inside the logo block */
|
||||||
@ -342,10 +342,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-brand {
|
.trading-sidebar-brand {
|
||||||
display: flex !important;
|
display: flex;
|
||||||
flex-direction: column !important;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 1px !important;
|
gap: 1px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
@ -361,17 +361,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-brand strong {
|
.trading-sidebar-brand strong {
|
||||||
color: var(--primary-foreground) !important;
|
color: var(--primary-foreground);
|
||||||
font-size: 14px !important;
|
font-size: 14px;
|
||||||
font-weight: 800 !important;
|
font-weight: 800;
|
||||||
line-height: 1.2 !important;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trading-sidebar-brand span {
|
.trading-sidebar-brand span {
|
||||||
color: color-mix(in oklab, var(--primary-foreground) 80%, transparent) !important;
|
color: color-mix(in oklab, var(--primary-foreground) 80%, transparent);
|
||||||
font-size: 11px !important;
|
font-size: 11px;
|
||||||
font-weight: 600 !important;
|
font-weight: 600;
|
||||||
line-height: 1.3 !important;
|
line-height: 1.3;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,9 +380,9 @@
|
|||||||
* .trading-sidebar-brand { display: none } — make sure the logo block recenters. */
|
* .trading-sidebar-brand { display: none } — make sure the logo block recenters. */
|
||||||
@media (max-width: 1279px) {
|
@media (max-width: 1279px) {
|
||||||
.trading-sidebar-logo {
|
.trading-sidebar-logo {
|
||||||
justify-content: center !important;
|
justify-content: center;
|
||||||
padding: 8px !important;
|
padding: 8px;
|
||||||
min-height: 52px !important;
|
min-height: 52px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user