Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 1 addition & 126 deletions client/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4470,35 +4470,6 @@ html[data-reduce-motion] #chat .media-veil-main:hover .media-veil-icon {
width: 100%;
}

#settings .settings-sync-panel {
padding: 10px;
margin-bottom: 16px;
border-radius: 2px;
background-color: #d9edf7;
color: #31708f;
}

#settings .settings-sync-panel p:last-child {
margin-bottom: 0;
}

#settings .settings-sync-panel .btn {
color: #007bff;
border-color: #007bff;
margin-bottom: 0;
}

#settings .settings-sync-panel .btn:hover,
#settings .settings-sync-panel .btn:focus {
background-color: #007bff;
color: #fff;
}

#settings .settings-sync-panel .btn:active,
#settings .settings-sync-panel .btn:focus {
box-shadow: 0 0 0 3px rgb(0 123 255 / 50%);
}

#settings .opt {
display: block;
padding-block: 5px;
Expand Down Expand Up @@ -10332,71 +10303,7 @@ html[data-reduce-motion] #form .upload-bar-track.indeterminate .upload-bar-fill
color: var(--body-color);
}

/* Settings → Push Notifications: the on/off indicator dot + per-network rows */
.push-state {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}

.push-state-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--body-color-muted);
flex: 0 0 auto;
}

.push-state-subscribed {
background: #2ea043;
}

.push-state-unsubscribed,
.push-state-server-unsupported,
.push-state-not-installed {
background: #9e6a03;
}

.push-state-denied,
.push-state-blocked,
.push-state-unsupported {
background: #c93c37;
}

.push-networks {
margin: 8px 0 12px;
}

.push-network {
padding: 5px 0;
border-bottom: 1px solid var(--body-color-muted);
display: flex;
align-items: baseline;
gap: 8px;
}

.push-network-state {
margin-inline-start: auto;
font-size: 0.8125rem;
font-weight: bold;
color: var(--body-color-muted);
white-space: nowrap;
}

.push-net-on {
color: #2ea043;
}

.push-net-off,
.push-net-unsupported {
color: var(--body-color-muted);
}

.push-net-ready {
color: #9e6a03;
}

/* Settings → Notifications: the hints under its switches. */
.push-networks-hint,
.keepalive-hint,
.dnd-schedule-hint {
Expand Down Expand Up @@ -10432,38 +10339,6 @@ html[data-reduce-motion] #form .upload-bar-track.indeterminate .upload-bar-fill
border-radius: 0.25rem;
}

.session-row {
padding: 6px 0;
border-bottom: 1px solid var(--body-color-muted);
}

.session-state {
display: inline-block;
min-width: 4rem;
padding: 0 6px;
border-radius: 3px;
font-size: 0.8125rem;
font-weight: bold;
text-align: center;
margin-inline-end: 8px;
color: #fff;
background: var(--body-color-muted);
}

.session-held {
background: #2ea043;
}

.session-active {
background: #388bfd;
}

.session-info {
color: var(--body-color-muted);
font-size: 0.8125rem;
margin-top: 2px;
}

/* The Mac app's sizes (data-platform="macos", set before the first paint by
* loading-error-handlers.js): menus at AppKit's metrics, 13px text in 22px
* items, and the sidebar's rows AppKit's shape, whatever the theme. A row's
Expand Down
1 change: 0 additions & 1 deletion client/themes/panasync.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
--ansi-black: #000;
--ansi-blue: #00a;
--ansi-bright-blue: #55f;
--ansi-cyan-dim: #0aa;
--ansi-cyan: #5ff;
--ansi-green: #5f5;
--ansi-yellow: #ff5;
Expand Down
7 changes: 4 additions & 3 deletions client/themes/zelenzy.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,15 @@
/* Only the chat window has the terminal panes. The dialogs — settings, help,
* the connect form, the changelog, search results, the header popovers — are XP dialogs on the
* face grey: the window tokens are re-mapped on those windows, so everything
* in them that reads a token follows. Black on the face 17.4:1, muted 5.6:1,
* the selection blue for links and buttons 4.6:1. */
* in them that reads a token follows. Black on the face 17.4:1, muted 5.6:1;
* links take the selection blue a step darker, 4.9:1 (the blue itself is
* 4.3:1, too low for text), and buttons the blue itself. */
:is(.window:not(#chat), .header-popover) {
--window-bg-color: var(--win-face);
--body-color: #000;
--body-color-muted: #5a5a5a;
--window-heading-color: #000;
--link-color: var(--win-select);
--link-color: #2d62b6;
--button-color: var(--win-select);
--button-text-color-hover: #fff;

Expand Down
27 changes: 26 additions & 1 deletion docs/resources/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,31 @@ Five themes come as a light/dark pair: Coffee/Creama, Cobalt/Frost, Princess\_/P

`style.css` greys an own message's text to `--body-color-muted`, TheLounge's look, and a theme was free to band the row instead (the Princess pair). The grey is hard to read on an iPhone under a dark theme — a system setting there flattens it into the background, which Android and a desk do not do — so the choice is the user's, not the theme's: Settings → Appearance → Your own messages picks **greyed text** (the default, every theme as it was), a **highlighted row** (the text like everyone else's, the row on a band) or **nothing**. The value lands on `<html data-own-messages>` (`client/js/helpers/ownMessages.ts`, `settings.ts`) and the three looks are rules in `style.css`, so no theme file needs to know about it. The three do not overlap: a band a theme paints on `.msg.self` itself (the Princess pair, Keeki) shows under **highlighted row** only, in the colour the theme names with `--own-bg` (without one the band is the text colour at 7% over the row). Own join and mode lines are `.self` as well and are left to the theme in every mode: the band is for what was said. Browser check: `tools/scenarios/own-messages.mjs` (coffee and princess, every setting, a reload).

## The theme contract

What a theme may rely on, and what is checked. A theme is plain CSS loaded after `style.css` and before the user's own stylesheet; it changes the app's look through three things only.

**Tokens.** Custom properties on `:root`. A theme on coffee's rules (every theme but `day` and `morning`) sets the tokens coffee and `style.css` read, in groups: the surfaces (`--chat-bg`, `--window-bg-color`, `--body-bg-color`, `--canvas-bg-color`, `--menu-bg`, `--composer-bg`), the text (`--chat-fg`, `--chat-fg-muted`, `--chat-fg-faint`, `--body-color`, `--body-color-muted`, `--link-color`), the rail (`--rail-*`), what a message means (`--event-join`, `--event-quit`, `--nick-default`, `--notice-color`, `--action-color`, `--highlight-bg-color`, and `--own-bg` where it bands own messages), the notice boxes (`--note-*`, `--warn-*`, `--error-*`, `--ok-*`), the tints (`--tint-soft`, `--tint-strong`, `--focus-ring`, and the optional `--accent-tint-*`) and the code colours (`--tok-*`). Coffee maps them onto TheLounge's names (`--body-color`, `--window-bg-color`, …), which is what `style.css` reads; `day` and `morning` set TheLounge's names directly. A token nothing reads is a mistake, and so is a pair that misses its floor.

**Attributes on `<html>`**, set by the app for every theme, for a theme's selectors:

| Attribute | Values | Means |
| ------------------------------------ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data-reduce-motion` | present | Reduce Motion: anything that moves goes behind `:not([data-reduce-motion])` (`helpers/systemAccessibility.ts`) |
| `data-contrast` | `more` | Increase Contrast: `style.css` folds the muted text tokens into the full colour; a theme that re-maps one below `:root` restates the reset (`test/tests/themeContrast.ts`) |
| `data-motion-rest` | present | Nobody attends to the window, or the device saves power: a theme's endless animations pause (`animation-play-state: paused`), as Keeki's drift does (`themeScene.ts` `installThemeSceneHooks`) |
| `data-own-messages` | `muted`, `band`, `plain` | How the user wants their own lines (§ Your own messages) |
| `data-input` | `pointer`, `touch` | The last pointer, for hover against press affordances (`helpers/inputModality.ts`) |
| `data-shell`, `data-platform` | `desktop`, `native`; `ios`, `android`, `macos`, `windows`, `linux` | The app around the page; absent in a browser (`native.ts`) |
| `data-system-text`, `data-font-size` | present; the font-size step | The text size setting (`helpers/systemTextSize.ts`, `settings.ts`) |
| `dir`, `lang` | | The interface language: new CSS uses logical properties (`docs/resources/i18n.md`) |

`ps` adds its own (`data-ps-light`, `data-ps-text`, `data-ps-words`), which no other theme should read.

**Selectors.** Where `style.css` still has a literal colour (the sidebar rows and badges, header icons, the input and context menu, message-type icons, the mIRC colour table, nick slots `.user.color-1`…`-32`), a theme restates that selector. Prefer a token where one exists: a restated selector is coupled to the markup, a token is not.

**Checked without a browser** by `test/tests/themeContract.ts`, in CI: every custom property a theme declares is read by `client/` (ps's switched-off animal slots excepted; the check pools every file under `client/`, so it does not yet tell a token read by another theme only), and each theme's resolved tokens, light and dark, hold their floors on the surfaces the app paints them on: text, muted text and links at 4.5:1 on the window and the chat, text on a highlighted row, the rail's text on both ends of the rail's gradient (ps's rail is clear, so its text is measured on the glass's solid colour, `--body-bg-color`, not on the glass the browser draws), the join line at 3:1. A token that resolves to no colour (an empty value, a missing `var()`) fails. A translucent surface is measured over what it is painted on (a highlighted row over the window, the window, the chat and the rail over the page's own background), and a surface with nothing opaque under it in CSS must be named in the test as see-through. Besides `:root`, every block that re-maps either side of a pair is checked as its own surface, with the blocks it sits inside, that qualify it, or that match wherever it does (ps's light words under the outline, rim and glow settings): a `:root` under a width query (a phone's palette), zelenzy's dialogs and the same dialogs under Increase Contrast, ps by night and its night chat. Two kinds of block are named in the test and left out: ps's light words, painted on the scene rather than on a token, and the chat's own surfaces (the chat pane, a highlighted row) in a block scoped away from `#chat`. Glass and pictures are not a flat colour, so ps is measured in the browser as well (`tools/scenarios/theme-ps.mjs`); `tools/scenarios/themes.mjs` measures the themes it lists, which leaves out `macos` (its material needs the Mac app, `html[data-platform="macos"]`) and `zelenzy`. Known exceptions are listed in the test with their own floor, today's ratio, so the colour stays as it is and anything worse fails: `day`'s link green is TheLounge's own (3.0:1). Not checked yet: muted text and links on a highlighted row, which several themes miss today (day, princess, morning, creama, frost).

## Checking a theme

`pnpm test` never loads a stylesheet. Build, serve `public/`, and look (`docs/resources/browser-testing.md`); the Appearance dropdown switches live. `tools/scenarios/themes.mjs` drives that dropdown through every theme against the dev ircd, checks the stylesheet link, the stored name and the browser chrome colour, measures the pairs above on the four handoff themes (text, timestamps, links, the join line, a nick on a highlighted row at ≥ 4.5:1; icons and the placeholder at ≥ 3:1) from computed styles, and leaves a screenshot of the chat under each theme.
`pnpm test` never loads a stylesheet. Build, serve `public/`, and look (`docs/resources/browser-testing.md`); the Appearance dropdown switches live. `tools/scenarios/themes.mjs` drives that dropdown through the themes in its list (all but `macos` and `zelenzy`) against the dev ircd, checks the stylesheet link, the stored name and the browser chrome colour, measures the pairs above on the four handoff themes (text, timestamps, links, the join line, a nick on a highlighted row at ≥ 4.5:1; icons and the placeholder at ≥ 3:1) from computed styles, and leaves a screenshot of the chat under each theme.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"eruda": "3.4.3",
"fuzzy": "0.1.3",
"gemoji": "8.1.0",
"lightningcss": "1.33.0",
"mocha": "12.0.3",
"mousetrap": "1.6.5",
"normalize.css": "8.0.1",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading