cloud / core / lib / src / theme / plain-page.cssmain at aacbc74
/* The plain pages' rules: HTML served with no build and no Tailwind (the platform's sign-in,
consent, keys, members and approval pages, an app's gate pages, the callback pages, the CLI's
sign-in page). standalonePage() inlines tokens.css and then this file. Each page is ONE CARD on
a quiet page, with iterate's mark at its head: narrow and centred for one question and one
action, wide for a page a person reads or works in. The type is the system's own sans-serif;
a fixed-width font is for code alone. On a phone the card is the page.
Colours come from tokens.css by name, never as values here.
After an edit to this file or tokens.css, run `node core/lib/scripts/plain-page-css.ts`. */
body {
display: flex;
flex-direction: column;
min-height: 100svh;
margin: 0;
background: var(--muted);
color: var(--foreground);
font-family:
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
font-size: 0.9375rem;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
/* the card: in the middle of the screen, both ways */
main {
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 1.25rem;
width: calc(100% - 2rem);
max-width: 26rem;
margin: auto;
padding: 2rem;
border: 1px solid var(--border);
border-radius: calc(var(--radius) + 4px);
background: var(--card);
color: var(--card-foreground);
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%);
overflow-wrap: anywhere;
}
/* a page to read or work in: wider, and it starts at the top */
main.wide {
max-width: 46rem;
margin: 3rem auto;
}
/* a phone: the card is the page */
@media (max-width: 40rem) {
body {
background: var(--card);
}
main,
main.wide {
width: 100%;
max-width: none;
margin: 0;
padding: 2rem 1.25rem 4rem;
border: 0;
border-radius: 0;
box-shadow: none;
}
main.centered {
max-width: 24rem;
margin: 0 auto;
padding-top: 3rem;
}
}
/* A field's text at 16 px at least on a narrow screen and on every touch screen (a phone held
sideways is wide): iOS Safari zooms the page into a field with smaller text. */
@media (max-width: 40rem), (pointer: coarse) {
input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]),
select,
textarea {
font-size: max(1rem, 16px);
}
}
.mark {
display: flex;
}
.mark svg {
width: 2.25rem;
height: 2.25rem;
border-radius: 22.37%;
}
/* a sign-in's card or a consent's: narrower, roomier, its mark and heading in the middle */
main.centered {
max-width: 24rem;
gap: 1.5rem;
padding: 2.5rem 2rem 2rem;
}
main.centered > .mark,
main.centered > .tile,
main.centered > .asks,
main.centered > h1 {
align-self: center;
text-align: center;
text-wrap: balance;
}
main.centered > .mark svg,
main.centered > .tile {
width: 2.75rem;
height: 2.75rem;
}
/* who asks, beside the mind it asks for: the two marks, and a quiet dotted line between them */
.asks {
display: flex;
align-items: center;
gap: 0.75rem;
}
.asks .mark svg,
.asks .tile {
width: 2.75rem;
height: 2.75rem;
}
.joins {
width: 1.5rem;
border-top: 2px dotted var(--ring);
}
.tile {
box-sizing: border-box;
display: grid;
place-items: center;
border-radius: 22.37%;
overflow: hidden;
border: 1px solid var(--border);
background: var(--card);
color: var(--foreground);
font-size: 1.125rem;
font-weight: 600;
}
.tile svg {
width: 60%;
height: 60%;
}
.tile img {
width: 100%;
height: 100%;
object-fit: contain;
}
/* the same tile in a row of a list: who a sign-in or a key belongs to */
.tile.small {
flex: none;
width: 2rem;
height: 2rem;
font-size: 0.75rem;
}
/* a sign-in's buttons, each of one height */
main.centered .stack > button:not(.link) {
min-height: 2.875rem;
font-size: 0.9375rem;
}
main.centered p {
text-wrap: pretty;
}
/* a line in a centered card that stands alone in the middle: who is signed in, and the way out */
main.centered > .center {
text-align: center;
}
.mark rect {
fill: var(--foreground);
}
.mark g {
fill: var(--card);
}
h1 {
margin: 0;
font-size: 1.25rem;
font-weight: 600;
line-height: 1.3;
letter-spacing: -0.025em;
}
h2 {
margin: 0;
font-size: inherit;
font-weight: 600;
}
p,
form {
margin: 0;
}
ul {
margin: 0;
padding-left: 1.25rem;
}
/* a list with nothing in it takes no room */
ul:empty {
display: none;
}
fieldset {
margin: 0;
padding: 0.75rem 1rem;
border: 1px solid var(--border);
border-radius: var(--radius);
}
/* a thing to choose's own words are inside its box, over the rest, not on the box's border */
legend {
float: left;
width: 100%;
margin-bottom: 0.5rem;
padding: 0;
}
legend + * {
clear: both;
}
/* a field's name over the field; no wider than the form, so a long field narrows on a phone */
label {
display: flex;
flex-direction: column;
gap: 0.375rem;
max-width: 100%;
font-size: 0.875rem;
font-weight: 500;
}
/* a tick box and its words share one line */
label:has(> input:is([type="checkbox"], [type="radio"])) {
flex-direction: row;
align-items: baseline;
gap: 0.5rem;
}
input,
select,
textarea {
font: inherit;
}
/* shadcn's Input: one line of text in a rounded border. The padding is outside the width, so a
field keeps the width its `size` or `cols` asks for. */
input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]),
select,
textarea {
box-sizing: content-box;
max-width: calc(100% - 1.5rem - 2px);
min-height: 1.5rem;
padding: 0.375rem 0.75rem;
border: 1px solid var(--input);
border-radius: calc(var(--radius) - 2px);
background: transparent;
color: inherit;
}
/* a code from a mail: its digits apart and in the middle, a size up, for a thumb and an eye */
input.code {
font-size: 1.125rem;
font-variant-numeric: tabular-nums;
letter-spacing: 0.25em;
text-align: center;
}
pre,
code {
font-family:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
monospace;
font-size: 0.875em;
}
pre {
margin: 0;
padding: 0.75rem;
border-radius: calc(var(--radius) - 2px);
background: var(--muted);
overflow-x: auto;
white-space: pre-wrap;
}
pre code {
font-size: inherit;
}
button {
font: inherit;
}
:not(pre) > code {
background: var(--muted);
padding: 0.125rem 0.3rem;
border-radius: 0.25rem;
}
a,
.link {
color: var(--link);
font-weight: 500;
text-decoration: underline;
text-underline-offset: 4px;
}
/* a view's main action, as shadcn's Button; `button.link` is one that reads as a link beside it */
button {
min-height: 2.25rem;
padding: 0 1rem;
border: 0;
border-radius: calc(var(--radius) - 2px);
background: var(--primary);
color: var(--primary-foreground);
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
}
button:hover {
background: color-mix(in oklab, var(--primary) 90%, transparent);
}
button.link {
min-height: 0;
padding: 0;
background: none;
font-size: inherit;
}
/* a form that is one link-like button in a line of text: "Not you? Use another account" */
form.inline {
display: inline;
}
/* another way to do the same thing, beside or under the main action */
button.secondary {
border: 1px solid var(--input);
background: transparent;
color: var(--foreground);
}
button.secondary:hover {
background: var(--accent);
}
/* the line between two ways: "or" */
.or {
display: flex;
align-items: center;
gap: 0.75rem;
color: var(--muted-foreground);
font-size: 0.8125rem;
}
.or::before,
.or::after {
flex: 1;
border-top: 1px solid var(--border);
content: "";
}
/* in a narrow card, a form's field and its action are as wide as the card */
main:not(.wide) .stack {
align-items: stretch;
}
main:not(.wide) .stack > button:not(.link) {
width: 100%;
}
/* a yes and a no share the card's width, each label on one line. A button is never narrower than
its words, so when the two do not fit side by side (a phone, a long label), each takes a line
of its own, as wide as the card. When the main action is last (a no, then a yes), the lines
go upwards: the main action is then on top. */
main:not(.wide) .actions > button:not(.link) {
flex: 1 1 0;
min-width: max-content;
}
main:not(.wide) .actions:has(> button:last-of-type:not(.secondary, .outline, .link)) {
flex-wrap: wrap-reverse;
}
main:not(.wide)
:is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), textarea) {
box-sizing: border-box;
width: 100%;
max-width: none;
min-height: 2.25rem;
}
blockquote {
margin: 0;
padding-left: 0.875rem;
border-left: 2px solid var(--border);
color: var(--muted-foreground);
}
small {
color: var(--muted-foreground);
font-size: 0.8125rem;
}
/* a second way beside the main action, with a provider's mark before its words */
button.outline {
border: 1px solid var(--border);
background: var(--background);
color: var(--foreground);
}
button.outline:hover {
background: var(--accent);
}
/* a provider's mark before a button's words, on the words' middle */
button:has(> svg) {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.625rem;
}
button > svg {
flex: none;
}
:focus-visible {
outline: 2px solid color-mix(in oklab, var(--foreground) 70%, transparent);
outline-offset: 2px;
}
.muted {
color: var(--muted-foreground);
}
[role="alert"] {
color: var(--destructive);
}
/* the parts of a form or a step, closer together than the page's */
.stack {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.75rem;
}
/* a line that says how something is going takes no room until it says something */
[role="status"]:empty {
display: none;
}
/* `hidden` wins over any display above */
[hidden] {
display: none !important;
}
/* a view's actions, in a row that wraps */
.actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem 1.25rem;
}
/* what a press signs or allows, as a table: a name and its value in each row (standalone-page.ts
`factsTable`). `.note` is a quieter line under a value. `.help` is a row's "?", beside its
name: the browser's own details, so a key press or a touch opens it as a click does. Open, the
name and its help take the row's whole width, and the value goes under them. Under 30rem a
row's value goes under its name. */
.facts {
margin: 0;
border: 1px solid var(--border);
border-radius: var(--radius);
font-size: 0.875rem;
}
/* in a box of what waits, the table stands clear of the lines over and under it */
fieldset > .facts {
margin: 0.5rem 0;
}
.facts > div {
display: grid;
grid-template-columns: 9rem minmax(0, 1fr);
gap: 0.25rem 1rem;
padding: 0.5rem 0.875rem;
}
.facts > div + div {
border-top: 1px solid var(--border);
}
.facts dt {
color: var(--muted-foreground);
}
.facts > div:has(.help[open]) > dt,
.facts > div:has(.help[open]) > dd {
grid-column: 1 / -1;
}
.facts dd {
margin: 0;
overflow-wrap: anywhere;
}
/* a value that is shown character for character: its runs of spaces and its tabs stay */
.facts dd.exact {
white-space: pre-wrap;
}
.facts dd > pre {
margin-top: 0.25rem;
}
.facts dd > ul {
margin: 0;
padding-left: 1.125rem;
}
.facts .note {
display: block;
margin-top: 0.125rem;
color: var(--muted-foreground);
}
.help {
display: inline;
}
.help > summary {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.125rem;
height: 1.125rem;
border: 1px solid var(--border);
border-radius: 999px;
color: var(--muted-foreground);
font-size: 0.6875rem;
line-height: 1;
cursor: pointer;
list-style: none;
vertical-align: text-top;
}
.help > summary::-webkit-details-marker {
display: none;
}
.help[open] > summary {
background: var(--muted);
}
.help > p {
margin: 0.25rem 0 0;
color: var(--muted-foreground);
}
@media (max-width: 30rem) {
.facts > div {
grid-template-columns: minmax(0, 1fr);
}
}
/* how something stands, and the one action that changes it: the words and the button side by
side in a box of their own, the button under the words when there is no room */
.state {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 0.75rem 1rem;
padding: 0.75rem 1rem;
border: 1px solid var(--border);
border-radius: var(--radius);
}
.state > p {
flex: 1 1 14rem;
}
/* a question before an act that matters, over the dimmed page: the browser's own dialog, drawn
as shadcn's. Closed, it takes no room and is not drawn. Its main action is last. */
dialog {
box-sizing: border-box;
width: calc(100% - 2rem);
max-width: 28rem;
padding: 1.5rem;
border: 1px solid var(--border);
border-radius: calc(var(--radius) + 4px);
background: var(--card);
color: var(--card-foreground);
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%);
overflow-wrap: anywhere;
}
dialog[open] {
display: flex;
flex-direction: column;
gap: 1rem;
}
dialog::backdrop {
background: color-mix(in oklab, var(--foreground) 50%, transparent);
}
dialog li + li {
margin-top: 0.375rem;
}
dialog .actions {
justify-content: flex-end;
}
/* where a person is signed in (/sessions) and who holds access (/sessions, /members): grouped
lists whose rows align a tile, compact facts and one action on the right */
.page-head {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.session-section {
display: flex;
flex-direction: column;
gap: 0.625rem;
}
.section-head {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 0.5rem 1rem;
}
.section-title {
display: flex;
align-items: center;
gap: 0.5rem;
}
.count {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.25rem;
height: 1.25rem;
padding: 0 0.375rem;
border-radius: 999px;
background: var(--muted);
color: var(--muted-foreground);
font-size: 0.75rem;
font-weight: 500;
font-variant-numeric: tabular-nums;
}
button.small {
min-height: 1.75rem;
padding: 0 0.625rem;
border-radius: calc(var(--radius) - 3px);
font-size: 0.8125rem;
white-space: nowrap;
}
.browser-sessions,
.access-list {
list-style: none;
margin: 0;
padding: 0;
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.browser-sessions > li + li,
.access-list > li + li {
border-top: 1px solid var(--border);
}
.browser-row,
.access {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 0.125rem 0.75rem;
align-items: center;
padding: 0.75rem 0.875rem;
}
.browser-row[data-current] {
background: color-mix(in oklab, var(--muted) 60%, transparent);
}
.browser-row > .tile,
.access > .tile {
grid-row: 1 / span 2;
align-self: start;
margin-top: 0.0625rem;
}
.browser-row > form {
grid-column: 3;
grid-row: 1 / span 2;
align-self: center;
}
.access > form {
grid-column: 3;
grid-row: 1;
align-self: start;
}
button.secondary.small {
border-color: var(--border);
background: var(--card);
}
button.secondary.small:hover {
border-color: var(--input);
background: var(--accent);
}
.row-title {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.25rem 0.5rem;
min-width: 0;
line-height: 1.35;
}
.row-title strong {
font-weight: 600;
}
.row-meta {
grid-column: 2;
display: flex;
flex-direction: column;
gap: 0.125rem;
color: var(--muted-foreground);
font-size: 0.8125rem;
line-height: 1.45;
overflow-wrap: anywhere;
}
.meta-line {
margin: -1px;
padding: 1px;
overflow: hidden;
}
.meta-track {
display: flex;
flex-wrap: wrap;
align-items: center;
row-gap: 0.125rem;
margin-left: -0.875rem;
}
.meta-track > * {
position: relative;
margin-left: 0.875rem;
}
.meta-track > .badge + .meta-item {
margin-left: 0.5rem;
}
.meta-item + .meta-item::before {
position: absolute;
left: -0.5625rem;
opacity: 0.5;
content: "·";
}
.badge {
display: inline-flex;
align-items: center;
height: 1.1875rem;
padding: 0 0.4375rem;
border: 1px solid var(--border);
border-radius: calc(var(--radius) - 4px);
background: var(--muted);
color: var(--muted-foreground);
font-size: 0.6875rem;
font-weight: 500;
line-height: 1;
white-space: nowrap;
}
.badge-current,
.badge-strong {
border-color: color-mix(in oklab, var(--foreground) 18%, var(--border));
background: color-mix(in oklab, var(--foreground) 8%, var(--card));
color: var(--foreground);
}
time {
font-variant-numeric: tabular-nums;
}
/* a client's individual sign-ins when it holds more than one: collapsed until opened */
.access-details {
grid-column: 2 / -1;
margin-top: 0.25rem;
font-size: 0.8125rem;
}
.access-details > summary {
display: inline-flex;
align-items: center;
gap: 0.3125rem;
color: var(--foreground);
font-weight: 500;
cursor: pointer;
list-style: none;
user-select: none;
}
.access-details > summary::-webkit-details-marker {
display: none;
}
.access-details > summary::before {
display: inline-block;
width: 0.375rem;
height: 0.375rem;
border-right: 1.5px solid var(--muted-foreground);
border-bottom: 1.5px solid var(--muted-foreground);
transform: rotate(-45deg);
transition: transform 0.12s ease;
content: "";
}
.access-details[open] > summary::before {
transform: rotate(45deg);
}
.access-details > summary:hover {
text-decoration: underline;
text-underline-offset: 3px;
}
.access-sessions {
list-style: none;
margin: 0.375rem 0 0;
padding: 0.125rem 0.625rem;
border: 1px solid var(--border);
border-radius: calc(var(--radius) - 2px);
background: color-mix(in oklab, var(--muted) 45%, transparent);
}
.access-sessions > li {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem 0.75rem;
padding: 0.375rem 0;
color: var(--muted-foreground);
overflow-wrap: anywhere;
}
.access-sessions > li + li {
border-top: 1px solid var(--border);
}
.access-sessions button.small {
min-height: 1.5rem;
padding: 0 0.5rem;
font-size: 0.75rem;
}
@media (max-width: 34rem) {
.browser-row,
.access {
padding: 0.6875rem 0.75rem;
gap: 0.1875rem 0.625rem;
}
.browser-row > form {
grid-row: 1;
align-self: start;
}
.row-meta {
grid-column: 2 / -1;
}
button.small {
min-height: 1.625rem;
padding: 0 0.5rem;
font-size: 0.75rem;
}
}
/* the mark and the mind's hostname beside it: which mind the page is of */
.masthead {
display: flex;
align-items: center;
gap: 0.75rem;
}
.masthead .mind {
font-weight: 600;
overflow-wrap: anywhere;
}
/* words for a screen reader alone */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* Markdown that a page shows (a secret's description): its paragraphs apart */
.prose {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
/* a secret's field with its show and hide button inside it, at its right end */
.reveal-field {
position: relative;
display: flex;
}
main .reveal-field > input {
flex: 1;
min-width: 0;
padding-right: 2.75rem;
}
.reveal-field > button.reveal {
position: absolute;
top: 0;
right: 0;
bottom: 0;
display: grid;
place-items: center;
width: 2.5rem;
min-height: 0;
padding: 0;
background: none;
color: var(--muted-foreground);
}
.reveal-field > button.reveal:hover {
color: var(--foreground);
}
.reveal svg {
width: 1.125rem;
height: 1.125rem;
}
.reveal[aria-pressed="true"] .shows,
.reveal[aria-pressed="false"] .hides {
display: none;
}
/* a form's main action, once it is sent: it waits, and a second press does nothing */
button[aria-disabled="true"] {
cursor: progress;
opacity: 0.6;
}
/* a link that is a page's main action (an OAuth start's Continue): drawn as the main button, as
wide as a narrow card */
a.button {
display: flex;
align-items: center;
justify-content: center;
min-height: 2.25rem;
padding: 0 1rem;
border-radius: calc(var(--radius) - 2px);
background: var(--primary);
color: var(--primary-foreground);
font-size: 0.875rem;
text-decoration: none;
}
main.wide a.button {
display: inline-flex;
}
a.button:hover {
background: color-mix(in oklab, var(--primary) 90%, transparent);
}