hive ui: hide the shell's page heading, which the dashboard showed as a second title
This commit is contained in:
parent
8e2844ec92
commit
2d3da56907
3 changed files with 34 additions and 13 deletions
|
|
@ -256,3 +256,19 @@
|
|||
:root[data-motion="allow"] .shell-body {
|
||||
animation: shell-page-enter 160ms ease;
|
||||
}
|
||||
|
||||
/* Text for a screen reader that is not drawn: the page's `<h1>`. Here, not in a
|
||||
page's own stylesheet, because every page on the shell draws that `<h1>`: the
|
||||
hive dashboard has no rule of its own for it and showed it as a second,
|
||||
large title under the active tab. */
|
||||
.ui-visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
clip-path: inset(50%);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,16 +12,3 @@
|
|||
a {
|
||||
color: var(--blue);
|
||||
}
|
||||
|
||||
/* Text for a screen reader that is not drawn: the page's `<h1>`. */
|
||||
.ui-visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
clip-path: inset(50%);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
|
|
|||
18
frontend/packages/swarm-ui/test/visually-hidden-css.test.mjs
Normal file
18
frontend/packages/swarm-ui/test/visually-hidden-css.test.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// The shell's hidden `<h1>` is styled by the shell's own stylesheet, so every
|
||||
// page on it (the swarm UI and the hive dashboard) hides it. Run by `npm test`.
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { test } from "node:test";
|
||||
|
||||
const read = (path) => readFileSync(new URL(path, import.meta.url), "utf8");
|
||||
|
||||
test("the shell's stylesheet hides the page heading it draws", () => {
|
||||
assert.match(
|
||||
read("../../shared/src/app-shell/AppShell.css"),
|
||||
/\.ui-visually-hidden \{[^}]*clip-path: inset\(50%\)/,
|
||||
);
|
||||
});
|
||||
|
||||
test("a page's own stylesheet doesn't define it a second time", () => {
|
||||
assert.doesNotMatch(read("../src/swarm-ui.css"), /\.ui-visually-hidden/);
|
||||
});
|
||||
Loading…
Reference in a new issue