style(tangle-cloud): slim styles.css — drop ~80% of overrides + !important#3231
Merged
Conversation
…rtant
The cloud dapp's styles.css was 698 LOC with 109 !important declarations —
every single !important in apps/tangle-cloud/src/ lived in this one file. The
gap was structural: cloud was fighting its own design system at every level
instead of working with it.
Slim to 362 LOC (-48%) with 3 !important (-97%). What changed:
- Drop cloud-side re-declarations of tokens that match sandbox-ui defaults.
Keep ONLY the deliberate cloud deltas (richer card+elevated steps, indigo
primary, brand-tinted root gradient, sharper shadows).
- Re-bind Tailwind/shadcn HSL aliases (--card, --primary, --border, ...) on
the dark theme block so .bg-card / .bg-primary / .border resolve to cloud
tokens without per-utility !important overrides.
- Replace `[data-sandbox-ui] :where(...) { color }` !important storm with a
single `.tangle-cloud-shell :where(h1..h6, p, ...) { color: inherit }` —
selector specificity already wins over ui-components @layer base rules.
- Drop the * { color-scheme } and `#root * { font-family }` over-applications.
Cloud's styles.css cascades after the legacy ui-components CSS in the
bundle, so font-family + color win on selector specificity alone.
- Remove dead rules: .tangle-wallet-modal (class never applied), .operator-row
(no consumer), .tangle-cloud-wallet-action-secondary (no consumer),
.tangle-cloud-status-pill (no consumer).
- Keep [role='dialog'] margin-left rule for the wallet modal centering fix
(recently-fixed bug, must survive).
- Trim 7 of the 11 .tangle-blueprint-host text-white/* rules — the remaining
two (border-white, bg-white) are kept because BlueprintHostCard uses
Tailwind `!`-prefix utilities which compile to !important, so cloud
overrides need matching !important by definition.
The 3 surviving !important:
- .tangle-cloud-wallet-action button p — Typography compiles to inline color,
parent gradient inheritance loses without !important.
- .tangle-blueprint-host [class*='border-white'] / [class*='bg-white'] — fight
Tailwind `!`-prefix utilities in BlueprintHostCard.tsx (parallel agent's
scope, can't modify).
Verified:
- pnpm nx typecheck/lint/test/build tangle-cloud all clean
- Playwright screenshots on /blueprints, /blueprints/sandbox, /blueprints/trading,
/instances, /operators in both dark (tangle) and light (vault) themes show
visual parity vs origin/develop.
- CSS bundle: 179.9K -> 175.9K (-4K).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The cloud dapp's
apps/tangle-cloud/src/styles.csswas 698 LOC with 109!importantdeclarations — every single!importantinapps/tangle-cloud/src/lived in this one file. By comparison,apps/tangle-dapp/src/styles.css(the staking dapp) is 27 LOC with 2!important. The gap was structural: the cloud dapp was fighting its own design system at every level instead of working with it.This PR slims the file to 362 LOC (-48%) with 3
!important(-97%).styles.cssLOC!importantdeclarationsWhat changed
Drop redundant token re-declarations. Sandbox-ui's brand tokens already define the full token system (
--md3-*,--hsl-*,--bg-*,--text-*,--border-*,--btn-*,--shadow-*, plus light theme via[data-sandbox-theme='vault']). Cloud now only declares the deliberate cloud deltas: richer card/elevated steps, indigo primary, brand-tinted root gradient, sharper shadows.Re-bind Tailwind/shadcn HSL aliases on the dark theme block.
--card,--popover,--muted,--border,--input,--primaryare pointed at cloud-tuned HSL values, so.bg-card/.bg-primary/.borderresolve to cloud tokens without per-utility!importantoverrides.Replace the
[data-sandbox-ui] :where(...) { color !important }storm with a single.tangle-cloud-shell :where(h1..h6, p, label, ...) { color: inherit }. Selector specificity already wins overlibs/ui-components/src/css/layer-base.cssrules (h1..h6 { @apply text-mono-* },p,div,span,label { @apply text-mono-* }).Drop the
* { color-scheme }and#root * { font-family }over-applications. Cloud'sstyles.csscascades AFTER the legacyui-componentsTailwind CSS in the bundled output (verified by inspecting the builtindex-*.css), sofont-family+colorwin on selector specificity alone — no!importantneeded.Remove dead rules —
.tangle-wallet-modal(class never applied; actual wallet modal renders via Radix Dialog),.operator-row,.tangle-cloud-wallet-action-secondary,.tangle-cloud-status-pill(no consumers anywhere inapps/orlibs/).Keep the
[role='dialog']margin-leftrule — the recently-fixed wallet modal centering bug (PR fix(tangle-cloud): center wallet modal in visible content area, not viewport #3227) stays intact.Trim 7 of the 11
.tangle-blueprint-host [class*='text-white/*']rules. The two retained (border-white,bg-white) are kept becauseBlueprintHostCard.tsxuses Tailwind!-prefix utilities which compile to!important, so cloud overrides need matching!importantby definition.The 3 surviving
!importantEach one is defensible:
.tangle-cloud-wallet-action button p— Typography compiles to inlinecolor: ...on the element class; parent gradient inheritance loses without!important..tangle-blueprint-host [class*='border-white']— fights Tailwind!-prefix utilities inBlueprintHostCard.tsx..tangle-blueprint-host [class*='bg-white']— same.Test plan
pnpm nx typecheck tangle-cloudcleanpnpm nx lint tangle-cloudcleanpnpm nx test tangle-cloudcleanpnpm nx build tangle-cloudclean/blueprints,/blueprints/sandbox,/blueprints/trading,/instances,/operators) confirm visual parity vsorigin/develop[role='dialog'] margin-left) preserved — sidebar collapsed AND expanded.bg-primaryrebinding verified)Before/after Playwright screenshots saved to
/tmp/dapp-browser-test/{before,after}/{tangle,vault}-{route}.png— will attach in a follow-up comment.