Uh oh!
There was an error while loading. Please reload this page.
fix(css): revert #257 @layer wrapping — sidebar content was centered - #260
Merged
Conversation
…nents (Round A, #253) (#257)" This reverts commit cbdf108. #257 wrapped styles.css component rules into @layer base/components. Tailwind v4 orders the cascade base, components, utilities, so layered rules lose to utilities. The sidebar nav rows render as <UiButton size="nav" className="maka-nav-row">; the cva button base always carries inline-flex items-center justify-center utilities, and .maka-nav-row (display: grid + text-align: left) only overrode them while it stayed unlayered. Layered, it lost — collapsing every sidebar button (nav rows, session rows, settings) to flex-centered content for users whose sidebar is wide enough to show the gap. Restore the unlayered cascade. The Round A cleanup needs a different approach (overrides must sit above utilities) before it can re-land.
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 freeto 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.
Symptom
The sidebar nav rows (新任务 / 每日回顾 / 技能 / 定时任务), session-list rows, and the settings button all rendered with their content centered when they should be left-aligned. It's subtle in a narrow sidebar and increasingly obvious the wider the sidebar is dragged.
Root cause
#257 (
cbdf1088) wrappedstyles.csscomponent rules into@layer base/@layer components, described as "pure structural wrapping." But Tailwind v4 orders the cascadebase → components → utilities, so utilities have the highest priority.The sidebar nav rows render as
<UiButton size="nav" className="maka-nav-row">: the cva button base always carries the Tailwind utilitiesinline-flex items-center justify-center, and.maka-nav-row(display: grid+text-align: left) only overrode them while it stayed unlayered. Once moved into@layer components, it lost to the utilities → content centered. The compensating!importantcleanup was deferred to "Round H," so the override has nothing to lean on today.Evidence (CDP toggle)
Injecting a rule into the live renderer with the same selector and specificity as
.maka-nav-row, differing only in being unlayered:.maka-nav-rowcomputeddisplayflex(theinline-flexutility wins)grid(.maka-nav-rowwins, layout restored)flex(centered again)Same rule, one variable (layer membership) → the cause is the cascade layer, not specificity.
Change
@layerwrapping), restoring the unlayered cascade the whole stylesheet's override pattern depends on. Fixes every affected element at once (nav rows, session rows, settings button).renderer-style-layer-cascade-contract.test.ts: asserts.maka-nav-rowis not nested in any@layer. Red oncbdf1088, green after the revert.Verification
42pxleft offset (if centered, different label lengths would start at different offsets),display: grid, and session rows are left-aligned too.npm run -w @maka/desktop test: this PR adds zero new failures. The 16 failures already present in the suite are pre-existing onorigin/main— stale contracts introduced by ancestors of refactor(css): wrap styles.css rules into @layer base + components (Round A, #253) #257 (e.g.BOT_BRANDmoved to@maka/ui, a changedcopyFilesignature, a radius value) — and are out of scope here.Known trade-off (reviewed)
A full revert also returns the global form/button resets (
button/input/textarea/select { font: inherit }, the globalbutton { transition }) to unlayered, so they again outrank Tailwind text utilities. Measured impact vs #257: ~85 controls go fromfont-weight: 500back to400, and ~48 controls go from13.125px(text-sm) back to the inherited15px. This is not a new regression — it is the exact control typography the app shipped for months before #257; #257 incidentally flipped it one day ago alongside the sidebar break. Restoring it wholesale is the intended behavior of this revert. Whether controls should lettext-sm/font-mediumwin is a deliberate design decision deferred to the sidebar-redesign / CSS-layering-governance follow-up, not this hotfix.Follow-up (not in this PR)
@layer components.