@layer components { /* buttons: one shape for links and buttons that act */ .btn { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; height: 32px; padding: 0 var(--s3); font: 600 var(--fs-s) / 1 var(--font); color: var(--ink); text-decoration: none; background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: var(--r-s); cursor: pointer; &:hover { background: var(--bg-strong); color: var(--ink-hi); text-decoration: none; } & kbd { margin-right: -4px; } &.primary { background: var(--ink-hi); color: var(--on-ink); border-color: var(--ink-hi); } &.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); } &.danger:hover { color: var(--red); border-color: var(--red); } &.icon { width: 32px; justify-content: center; padding: 0; } &[aria-disabled="true"] { opacity: .45; pointer-events: none; } &[aria-current="true"], &[aria-pressed="true"] { background: var(--bg-strong); color: var(--ink-hi); border-color: var(--ink-mute); } } /* icons: SVG files used as masks, so they take the colour of the text */ .ico { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; mask: var(--i) center / contain no-repeat; } .i-branch { --i: url(icons/branch.svg); } .i-search { --i: url(icons/search.svg); } .i-file { --i: url(icons/file.svg); } .i-chevron { --i: url(icons/chevron.svg); } .i-tag { --i: url(icons/tag.svg); } .i-user { --i: url(icons/user.svg); } .i-key { --i: url(icons/key.svg); } .i-log-in { --i: url(icons/log-in.svg); } .i-log-out { --i: url(icons/log-out.svg); } .i-download { --i: url(icons/download.svg); } .pill { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s2); margin-left: var(--s1); font: 600 var(--fs-xs) / 1 var(--mono); color: var(--ink-dim); vertical-align: 1px; background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: 999px; white-space: nowrap; &.tag::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border: 1.5px solid currentColor; border-radius: 1px; transform: rotate(45deg); } &.new { color: var(--teal); border-color: currentColor; } } .count { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: var(--s1); font: 600 var(--fs-xs) / 20px var(--font); text-align: center; color: var(--ink-dim); background: var(--bg-raised); border-radius: 999px; vertical-align: 1px; } /* header: identity, path and actions on top, the repository tabs below. --hdr-h is its height, the offset of the sticky bars of the diffs. */ body { --hdr-h: 57px; } body:has(.hdr .tabs) { --hdr-h: 101px; } .hdr { position: sticky; top: 0; z-index: 20; background: var(--bg-surface); border-bottom: 1px solid var(--border); } .hdr-top { display: flex; align-items: center; gap: var(--s4); max-width: var(--page); margin: 0 auto; height: 56px; padding: 0 var(--pad); } .brand { display: flex; align-items: center; flex: none; text-decoration: none; &:hover { text-decoration: none; } } /* the hermit by his fire: a grey picture in its own rounded square */ .brand-mark { width: 32px; height: 32px; flex: none; background: url(icons/brand.svg) center / contain no-repeat; } .crumbs { min-width: 0; flex: 1 1 auto; overflow: hidden; & ol { display: flex; align-items: center; min-width: 0; font-family: var(--mono); font-size: var(--fs); } & li { display: flex; align-items: center; min-width: 0; white-space: nowrap; } & li:last-child { overflow: hidden; } & li::before { content: "/"; padding: 0 var(--s2); color: var(--border-strong); } & a, & span { overflow: hidden; text-overflow: ellipsis; color: var(--ink-dim); text-decoration: none; } & a:hover { color: var(--ink-hi); text-decoration: underline; } & [aria-current] { color: var(--ink-hi); font-weight: 700; } } .hdr-acts { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; } .ref { font-family: var(--mono); max-width: 28ch; & .ref-name { overflow: hidden; text-overflow: ellipsis; } & .sha { font-weight: 400; color: var(--ink-mute); } } .search { min-width: 220px; justify-content: flex-start; color: var(--ink-mute); font-weight: 400; background: var(--bg-inset); & .search-label { flex: 1; } } .owner { display: flex; align-items: center; gap: var(--s2); & .owner-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 20ch; padding: 0 var(--s1); font: 600 var(--fs-s) / 1 var(--mono); color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } } .tabs { max-width: var(--page); margin: 0 auto; padding: 0 var(--pad); overflow-x: auto; scrollbar-width: none; & ul { display: flex; gap: var(--s1); } & a { position: relative; display: flex; align-items: center; gap: var(--s2); height: 44px; padding: 0 var(--s3); color: var(--ink-dim); text-decoration: none; white-space: nowrap; font-weight: 600; } & a::after { content: ""; position: absolute; left: var(--s2); right: var(--s2); bottom: -1px; height: 2px; border-radius: 2px; } & a:hover { color: var(--ink-hi); } & a:hover::after { background: var(--border-strong); } & a[aria-current] { color: var(--ink-hi); } & a[aria-current]::after { background: var(--ink-hi); } & kbd { opacity: .55; } & a:hover kbd, & a:focus-visible kbd, & a[aria-current] kbd { opacity: 1; } } /* work area: content and rail, centred, the page scrolls */ .work { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: var(--s5) var(--pad) var(--s7); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; /* .work grows to fill the page (flex: 1): without this, the rows share the spare height and a short content pushes the rail down */ align-content: start; } .work.has-rail { grid-template-columns: minmax(0, 1fr) var(--rail); } .rail { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; } .work-lede { grid-column: 1 / -1; margin-bottom: calc(-1 * var(--s2)); } main > * + * { margin-top: var(--s4); } /* blocks: a surface with a header; rail sections are blocks too */ .card, .rail section { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r); min-width: 0; } .card-h, .rail h2 { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); font-size: var(--fs); line-height: 20px; & a { margin-left: auto; font: 600 var(--fs-s) / 1 var(--font); color: var(--ink-dim); text-decoration: none; } & a:hover { color: var(--ink-hi); text-decoration: underline; } } .rail section > :not(h2) { margin: var(--s3) var(--s4); } .rail section > .list { margin: var(--s2) 0; } .rail section > p + p { margin-top: calc(-1 * var(--s2)); } /* newest tag, a row of About in the summary rail */ .kv dd.latest-tag { display: flex; align-items: baseline; gap: var(--s2); & .tag-name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; font-weight: 700; font-family: var(--mono); color: var(--ink-hi); text-decoration: none; } & .tag-name .ico { flex: none; } & .tag-name:hover { text-decoration: underline; } & time { white-space: nowrap; } & .all-tags { margin-left: auto; white-space: nowrap; color: var(--ink-dim); text-decoration: none; } & .all-tags:hover { color: var(--ink-hi); text-decoration: underline; } } .kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--s4); row-gap: var(--s1); font-size: var(--fs-s); & dt { color: var(--ink-mute); } & dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); } } .outline { font-size: var(--fs-s); & a { display: block; padding: 2px var(--s2); margin: 0 calc(-1 * var(--s2)); border-radius: 4px; color: var(--ink-dim); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } & a:hover { background: var(--bg-raised); color: var(--ink-hi); } & .l1 { font-weight: 700; color: var(--ink); } & .l3 { padding-left: var(--s5); } & .l4, & .l5, & .l6 { padding-left: var(--s6); } } /* footer: version and source (AGPL ยง13) */ .foot { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; width: 100%; max-width: var(--page); margin: 0 auto; padding: var(--s4) var(--pad) var(--s5); font-size: var(--fs-s); color: var(--ink-mute); &::before { content: ""; flex-basis: 100%; height: 1px; margin-bottom: var(--s2); background: var(--border); } & a { color: var(--ink-dim); } & .foot-keys { margin-left: auto; color: var(--ink-dim); } & .foot-keys:hover { color: var(--ink-hi); } } /* hint: bottom right, only while it has something to say */ .hint { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 25; display: flex; gap: var(--s3); align-items: center; padding: var(--s2) var(--s3); font: 600 var(--fs-s) / 18px var(--mono); color: var(--ink-hi); background: var(--bg-overlay); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow); pointer-events: none; & > :empty { display: none; } & .hint-live { color: var(--red); } } /* empty, the badge is out of sight but stays a status region (display: none would drop it from the accessibility tree and its next message would not be announced) */ .hint:not(:has(> :not(:empty))) { width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); box-shadow: none; } @media (max-width: 1080px) { /* the rail goes under the content, in two columns while there is room */ .work.has-rail { grid-template-columns: minmax(0, 1fr); } .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; } .search { min-width: 0; } .search .search-label, .search kbd { display: none; } .search { width: 32px; padding: 0; justify-content: center; } } @media (max-width: 720px) { :root { --pad: var(--s4); } .hdr-top { gap: var(--s3); height: 52px; } .crumbs li:not(:last-child) { display: none; } .ref .sha, .owner .owner-badge { display: none; } .ref { max-width: 16ch; } .work { padding-top: var(--s4); } .rail { grid-template-columns: minmax(0, 1fr); } .tabs kbd { display: none; } .list .c-who, .list .c-desc, .list .c-sub, .list .c-ref, .list .c-size, .list .c-lang { display: none; } } }