fix(frontend): scope the credits button skins to the user-center shell

The user-center route rendered a 4px top-nav publish chip while every other
route kept the 50px pill. assets/css/routes/user-center/credits.css restated
border-radius on bare legacy colour modifiers (.but.jb-blue, .but.b-blue-2,
.but.c-blue-2.hollow, .but.c-green.hollow). Those rules are (0,2,0) and load
after public.css, so they out-rank .but.radius's 50px and flatten the publish
chip, which is newadd-btns but jb-blue radius, down to 4px.

The same leak also repainted every site-wide .but.jb-blue outside the panel
with the flat #3b82f6 skin instead of the legacy gradient, so login, submit,
badge and cashier buttons lost their reference surface on that route too.

Scope the four rules to .uc-content, the shell every credits panel and its
modals render inside (templates/pages/page-profile.php wraps
templates/parts/user-center/panel.php). The panel keeps its own button skins
and the top-nav chips get the reference pill back.

The .btn-block restatement that sat in the same block is byte-identical to
the one in core/buttons.css, which loads earlier on every page, so it could
never win; it is dropped rather than scoped.

Verified: node --test across tests/ (604 passing), plus a stubbed navbar
rendered against each route's real stylesheet set measuring the computed
border-radius of the publish chip and of the panel's own buttons. A new
contract test fails on the previous stylesheet and passes on this one.
This commit is contained in:
kate522 committed 2026-10-15 23:22:18 +08:00
1 parent ee39024549
commit 4d69aaee50
2 files changed
+51 -10

No files matched your search

+22 -10
View File
@@ -304,12 +304,24 @@
body.uc-modal-open {
overflow: hidden;
}
.btn-block {
display: block;
width: 100%;
}
.but.jb-blue,
.but.b-blue-2 {
/* Scoped to the user-center content shell. These are the credits panel's own
* button skins, and every element they target renders inside .uc-content (the
* panels and their modals are all emitted through templates/parts/user-center/
* panel.php, which templates/pages/page-profile.php wraps in .uc-content).
*
* Left unscoped they are (0,2,0) rules that load after public.css, so they
* out-rank the legacy .but.radius pill and flatten every .but.jb-blue on the
* page down to 4px. The top-nav publish chip is .but.jb-blue.radius, so on the
* user-center route it lost its 50px pill and no longer matched the homepage.
* Site-wide .but.jb-blue callers outside the panel (login, submit, badge and
* cashier buttons) also picked up the flat #3b82f6 skin instead of the legacy
* gradient.
*
* The .btn-block restatement that used to sit here was byte-identical to the
* one in core/buttons.css, which loads earlier on every page, so it could never
* win and is dropped rather than scoped. */
.uc-content .but.jb-blue,
.uc-content .but.b-blue-2 {
background: #3b82f6;
color: #fff;
border: 0;
@@ -317,18 +329,18 @@ body.uc-modal-open {
padding: 0.45em 1em;
cursor: pointer;
}
.but.c-blue-2.hollow,
.but.c-green.hollow {
.uc-content .but.c-blue-2.hollow,
.uc-content .but.c-green.hollow {
background: transparent;
border: 1px solid currentColor;
border-radius: 4px;
padding: 0.4em 0.9em;
cursor: pointer;
}
.but.c-blue-2 {
.uc-content .but.c-blue-2 {
color: #3b82f6;
}
.but.c-green {
.uc-content .but.c-green {
color: #16a34a;
}