diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index c02ed5b67..dfeaf2bf5 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -8747,4 +8747,6 @@ button.report-ask-excerpt-toggle { height: 32px; padding: 0; color: var(--color- top-right corner of the sidebar tile. */ .secondary-header-tag { flex: none; padding: 3px 7px; border-radius: 999px; background: var(--color-canvas-muted); color: var(--color-ink-secondary); font-size: 12px; font-weight: 400; line-height: 1.2; white-space: nowrap; } .sidebar-nav-link:has(.sidebar-nav-tag) { position: relative; } +/* The active tile lifts its children with position: relative (.sidebar-nav-link[data-active] > :not(...)); the tag stays in the corner. */ +.sidebar-nav-link > .sidebar-nav-tag, .sidebar-nav-link[data-active="true"] > .sidebar-nav-tag { position: absolute; z-index: 2; } .sidebar-nav-tag { position: absolute; top: 4px; right: 4px; padding: 2px 5px; border-radius: 999px; background: var(--sidebar-solid, var(--color-canvas)); color: var(--color-ink-secondary); font-size: 10px; line-height: 1.2; white-space: nowrap; pointer-events: none; } diff --git a/frontend/tests/rect-casual-edition-2256.test.ts b/frontend/tests/rect-casual-edition-2256.test.ts index 9166fe94e..b31bb0721 100644 --- a/frontend/tests/rect-casual-edition-2256.test.ts +++ b/frontend/tests/rect-casual-edition-2256.test.ts @@ -17,6 +17,8 @@ test("生时纠正 says 随缘版 beside its title and on its sidebar tile", () const css = read("../src/app/globals.css"); assert.match(css, /\.secondary-header-tag \{/); assert.match(css, /\.sidebar-nav-tag \{/); + // The active tile (on 生时纠正 itself) must not pull the tag back into the flow. + assert.match(css, /\.sidebar-nav-link\[data-active="true"\] > \.sidebar-nav-tag \{ position: absolute; z-index: 2; \}/); }); test("the home no longer says the report opens by naming your own choice", () => {