colorsbymax 0.2.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  What changed in each colorsbymax release. Update with `npm install colorsbymax@latest`.
4
4
 
5
+ ## 0.3.1 (2026-09-25)
6
+
7
+ - **`colourLogo` config option:** start with "Colour the logo too" on, for sites whose logo is drawn in the theme's colours. It's off by default, so logos keep their own colours, and visitors can still change it in settings. It also applies when the switcher is hidden. The colorsbymax site turns it on for its wordmark.
8
+
9
+ ## 0.3.0 (2026-09-25)
10
+
11
+ - **Dark mode for every site, on every load.** The mode now lives in the theme provider: a saved Dark (or Auto on a dark device) turns the whole site dark as soon as it loads, not only when the mode is changed, and it keeps working when the switcher is hidden. Before, the panel could go dark while the site stayed light. Sites without a dark mode of their own get one: every theme's dark twin re-colours the page, contrast-checked.
12
+ - **A light and dark switch for your site:** mark any element with `data-colorsbymax-mode="toggle"` (or `light`, `dark`, `system`) and colorsbymax wires it up and remembers the choice. `<html>` gets `data-colorsbymax-scheme` with the current mode, and `useTheme()` has `mode`, `modeSetting` and `setMode`.
13
+ - **Light, Dark and Auto in the panel's header**, next to Audit, so they're one click away.
14
+ - **"Add to site": a light and dark switch for your site.** Next to the mode buttons, it previews a working switch in your page's top bar (until reload) and gives the code (HTML or React, plus styles) and a prompt for Claude, Cursor or Copilot to add it for good.
15
+ - **Plain sites show off a theme.** On a site with no brand colour of its own (greys and text), grey icons and plain text links now take the theme's brand colour, contrast-checked, so a theme visibly changes the page.
16
+ - **A burst of colour on every click** of the colour button, not only when it first appears.
17
+ - **The panel stays open while you drag the button**, and moves with it.
18
+ - **Picking a library category scrolls to its themes**, so the colours are in view straight away.
19
+ - **Feedback on the colorsbymax site:** a Feedback button in the top bar (and the menu and footer) opens a form for bug reports, suggestions, praise and questions, with the areas it's about, a rating, steps to reproduce, expected and actual results, severity, several screenshots (pasted, dropped, chosen or captured from the page) and technical details attached automatically. The coffee and bakery demo pages are gone: the colorsbymax site is the demo. The site also asks for feedback in its own section, and has a support page (buy Max a coffee, coming soon).
20
+ - **The colour button makes an entrance.** A moment after the page loads, it pops in with a burst of squiggles, dots and dashes in the theme's colours, so visitors notice it arrive. With reduced motion it simply fades in. Turn it off with `intro: false`.
21
+ - **A new colorsbymax site** at [mrmaxdesigns.com/colorsbymax](https://mrmaxdesigns.com/colorsbymax): what colorsbymax does and why, every colour role explained with a live preview, the rules of good colour (with a little history), setup guides, coding-agent setup, and a way back to mrmaxdesigns.com. Every colour on it follows the theme you pick.
22
+ - **Set-up steps for many more coding agents,** in the README, the MCP README and the site: GitHub Copilot CLI, Codex, Google Antigravity, Gemini CLI, Grok Build, Windsurf, Kiro, Zed, JetBrains, Cline and Roo, and opencode, alongside Claude Code, Cursor, VS Code and Claude Desktop. The MCP server's docs tool has a new `agents` topic with all of them (colorsbymax-mcp 0.1.3).
23
+ - **Dark themes always read.** A dark twin's brand, data and status colours are now lifted until they measurably pass against the dark background, and buttons get whichever text colour (dark or white) reads best. Before, a few vivid blues and violets stayed too dark to read (7 of the 720 built-in themes, and some sites' own colours); now every built-in theme passes every check in both light and dark.
24
+ - The colorsbymax site's own colours now pass every contrast check in light and dark.
25
+ - Fixed: when the colour button was hidden on a device, the next page load could stop the switcher with an error.
26
+ - The demo is live at [mrmaxdesigns.com/colorsbymax](https://mrmaxdesigns.com/colorsbymax), now the package's homepage.
27
+
5
28
  ## 0.2.3 (2026-09-25)
6
29
 
7
30
  - **Paste an image to build a palette.** Took a screenshot of something whose colours you like? Open the panel and press Ctrl+V (⌘V on a Mac), or use the new **Paste image** button in Import / export. Import / export opens by itself and shows a thumbnail of the image, marked "Image pasted", with its size and a button to remove it (dropped and chosen images get the same preview). Pasting text into a field still works as usual.
package/README.md CHANGED
@@ -10,6 +10,8 @@
10
10
  <a href="LICENSE"><img src="https://img.shields.io/badge/licence-MIT-c2410c?style=flat-square" alt="MIT licence"></a>
11
11
  </p>
12
12
 
13
+ <p align="center"><strong><a href="https://mrmaxdesigns.com/colorsbymax">See it live at mrmaxdesigns.com/colorsbymax →</a></strong><br>Open the colour button on the page and re-colour the whole site.</p>
14
+
13
15
  A floating theme switcher for websites. Visitors (or the site's owner) can re-colour the whole site instantly: pick one of the site's own themes, a hand-tuned pick, or one of 715 library themes in 14 categories; build and share custom palettes; or override single colours. Every theme is checked against the Web Content Accessibility Guidelines (WCAG) contrast rules, with one-click fixes.
14
16
 
15
17
  <p align="center">
@@ -64,12 +66,14 @@ Already installed it? Get the newest version with `npm install colorsbymax@lates
64
66
 
65
67
  ## Try the demo
66
68
 
69
+ colorsbymax's home, **[mrmaxdesigns.com/colorsbymax](https://mrmaxdesigns.com/colorsbymax)**, is the demo: open the colour button and the whole page re-colours. To run it locally:
70
+
67
71
  ```bash
68
72
  npm install
69
73
  npm run dev
70
74
  ```
71
75
 
72
- This serves `demo/`: colorsbymax's own landing page, built with Tailwind, where every colour is a token (it uses every token group, and a strip shows the live values); `/plain.html`, a plain-CSS bakery site with deliberately careless global styles to show they don't reach the panel; and `/unwired.html`, a coffee shop with only hard-coded colours whose whole setup is `import 'colorsbymax/auto'`.
76
+ This serves `demo/`, the same site: built with Tailwind, where every colour is a token, and every token group is used. Its sections are in `demo/site/`.
73
77
 
74
78
  <br>
75
79
 
@@ -77,7 +81,7 @@ This serves `demo/`: colorsbymax's own landing page, built with Tailwind, where
77
81
 
78
82
  ## Coding agents (MCP)
79
83
 
80
- Your coding agent can set colorsbymax up and use it for you. [colorsbymax-mcp](mcp/) is an [MCP](https://modelcontextprotocol.io) server that gives Claude Code, Cursor, VS Code Copilot, Claude Desktop, Windsurf, Codex and other agents colorsbymax's own tools:
84
+ Your coding agent can set colorsbymax up and use it for you. [colorsbymax-mcp](mcp/) is an [MCP](https://modelcontextprotocol.io) server that gives Claude Code, Cursor, GitHub Copilot, Codex, Google Antigravity, Gemini CLI, Grok Build, Claude Desktop, Windsurf, Kiro, Zed, JetBrains, Cline, opencode and other agents colorsbymax's own tools:
81
85
 
82
86
  | The agent can… | Tool |
83
87
  | --- | --- |
@@ -137,9 +141,21 @@ Add this to `.vscode/mcp.json`, then use it from Copilot Chat in **Agent** mode:
137
141
 
138
142
  Open **Settings → Developer → Edit Config**, add the same `mcpServers` entry as Cursor to `claude_desktop_config.json`, and restart Claude Desktop.
139
143
 
140
- ### Windsurf, Cline, Codex and others
144
+ ### GitHub Copilot CLI
141
145
 
142
- Most agents take the same `mcpServers` entry as Cursor: Windsurf in `~/.codeium/windsurf/mcp_config.json`, and Cline under **MCP Servers → Configure**. For the Codex CLI, add this to `~/.codex/config.toml`:
146
+ ```bash
147
+ copilot mcp add colorsbymax -- npx -y colorsbymax-mcp
148
+ ```
149
+
150
+ Or type `/mcp add` inside `copilot`. It's saved to `~/.copilot/mcp-config.json`.
151
+
152
+ ### Codex (OpenAI)
153
+
154
+ ```bash
155
+ codex mcp add colorsbymax -- npx -y colorsbymax-mcp
156
+ ```
157
+
158
+ It's saved to `~/.codex/config.toml`, which the Codex IDE extension shares. To write it by hand:
143
159
 
144
160
  ```toml
145
161
  [mcp_servers.colorsbymax]
@@ -147,6 +163,57 @@ command = "npx"
147
163
  args = ["-y", "colorsbymax-mcp"]
148
164
  ```
149
165
 
166
+ ### Google Antigravity
167
+
168
+ In the agent panel, open **… → MCP Servers → Manage MCP Servers → View raw config**, add the same `mcpServers` entry as Cursor to `~/.gemini/config/mcp_config.json`, and save. Antigravity reloads it by itself. For one project, use `.agents/mcp_config.json`. In the Antigravity CLI, `/mcp` opens the same manager.
169
+
170
+ ### Gemini CLI
171
+
172
+ Add the same `mcpServers` entry as Cursor to `~/.gemini/settings.json` (or `.gemini/settings.json` in your project), restart Gemini CLI, and check it with `/mcp`.
173
+
174
+ ### Grok Build (xAI)
175
+
176
+ ```bash
177
+ grok mcp add colorsbymax -- npx -y colorsbymax-mcp
178
+ ```
179
+
180
+ It's saved to `~/.grok/config.toml`; add `--scope project` for `.grok/config.toml`. The first start downloads the server, so if it times out, raise `startup_timeout_sec` for it in that file.
181
+
182
+ ### Windsurf, Kiro, JetBrains, Cline and Roo
183
+
184
+ They take the same `mcpServers` entry as Cursor:
185
+
186
+ - **Windsurf:** `~/.codeium/windsurf/mcp_config.json`
187
+ - **Kiro:** `.kiro/settings/mcp.json` in your project, or `~/.kiro/settings/mcp.json`. Kiro doesn't read your shell's PATH, so use the full path to `npx` if it can't start.
188
+ - **JetBrains:** AI Assistant under **Settings → Tools → AI Assistant → Model Context Protocol (MCP)**; Junie under **Settings → Tools → Junie → MCP Settings**.
189
+ - **Cline and Roo Code:** in the extension's **MCP Servers** view, choose **Configure** (or **Edit MCP Settings**).
190
+
191
+ ### Zed and opencode
192
+
193
+ Zed calls them context servers. In `settings.json`, or through **Settings → AI → MCP Servers → Add Server**:
194
+
195
+ ```json
196
+ {
197
+ "context_servers": {
198
+ "colorsbymax": { "command": "npx", "args": ["-y", "colorsbymax-mcp"] }
199
+ }
200
+ }
201
+ ```
202
+
203
+ opencode, in `opencode.json`:
204
+
205
+ ```json
206
+ {
207
+ "mcp": {
208
+ "colorsbymax": { "type": "local", "command": ["npx", "-y", "colorsbymax-mcp"] }
209
+ }
210
+ }
211
+ ```
212
+
213
+ ### Any other MCP client
214
+
215
+ Most take the same `mcpServers` entry as Cursor: the command is `npx`, with `-y colorsbymax-mcp` as its arguments.
216
+
150
217
  On Windows, if an editor can't start `npx`, use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "colorsbymax-mcp"]`.
151
218
 
152
219
  ### What to ask
@@ -179,8 +246,8 @@ When you're done choosing colours, the panel's **I'm done** button gives you rea
179
246
  - **Contrast checks.** Problems show as a badge on the theme; the breakdown offers per-item fixes or "Fix all automatically", which changes lightness only.
180
247
  - **No flash on reload.** An inline pre-paint script applies the saved theme before the page draws.
181
248
  - **Works on any site.** The panel carries its own stylesheet inside a shadow root, so it needs no Tailwind or other CSS from the site, and the site's CSS can't restyle it.
182
- - **Movable colour button.** The floating button starts in the corner; visitors can drag it anywhere (mouse or touch; a tooltip says so on hover, and the panel closes while it moves) and it stays there, remembered across reloads. The panel then opens beside it, on whichever side has room. Its dot cycles through the current theme's colours.
183
- - **Light and dark mode.** Every built-in theme is designed light; dark mode lists a generated dark twin of each (dark surfaces, light text, brand colours lifted to read on dark, then contrast-fixed) and switches the current theme to its twin. The panel turns dark with it. Custom palettes stay as they were made.
249
+ - **Movable colour button.** The floating button starts in the corner; visitors can drag it anywhere (mouse or touch; a tooltip says so on hover, and an open panel moves with it) and it stays there, remembered across reloads. The panel then opens beside it, on whichever side has room. Its dot cycles through the current theme's colours.
250
+ - **Light and dark mode, for any site.** Every built-in theme is designed light and has a generated dark twin (dark surfaces, light text, brand colours lifted until they read on dark, then contrast-checked). Switching to Dark, one click in the panel's header, turns the whole site dark, even one that never had a dark mode. Auto follows the visitor's device, and a light and dark switch can go anywhere on the site (see [Dark mode](#dark-mode)). Custom palettes stay as they were made.
184
251
  - **Visitor settings.** The gear in the panel header opens settings: theme mode (Light, Dark, Auto), panel size (Compact, Standard, Large), which groups and sections to show, whether the button can be dragged or its dot animates, and moving the button back to its corner. Saved per site.
185
252
  - **Resizable panel.** Drag the panel's free edges or corner (the ones away from the colour button) to any size, or pick a size in settings; double-click an edge to reset it. The layout follows the panel's width, so a large panel shows three theme cards a row.
186
253
  - **Audit the page.** The **Audit** button in the panel header looks at the page in the chosen colours and pins notes to what won't look right: a logo that disappears against its background (with a one-click "Colour the logo", or tips when it's a picture colorsbymax can't re-colour, plus "Preview inverted"), pictures whose solid background shows as a box, and text or icons too faint to read. The notes stay on the page as you scroll; **Re-check** after a fix (it also re-checks when the colours change) and close it from its bar.
@@ -215,7 +282,7 @@ This is the full setup, for sites that want exact control over which colour goes
215
282
  }
216
283
  ```
217
284
 
218
- With plain CSS, or Tailwind before v4, define the variables yourself (`demo/plain.html` shows this):
285
+ With plain CSS, or Tailwind before v4, define the variables yourself:
219
286
 
220
287
  ```css
221
288
  :root {
@@ -237,7 +304,7 @@ This is the full setup, for sites that want exact control over which colour goes
237
304
  </ThemeProvider>
238
305
  ```
239
306
 
240
- The switcher needs React but not a React site: `demo/plain.jsx` mounts it on its own next to a static page.
307
+ The switcher needs React but not a React site: `autoMount` from `colorsbymax/auto` mounts it on its own next to any page.
241
308
 
242
309
  3. **Add the pre-paint script** to `<head>`, as a classic inline `<script>`, using the same storage key. `prePaintScript(storageKey)` returns its source, and `demo/index.html` shows it in place.
243
310
 
@@ -259,9 +326,33 @@ Without a `siteName`, the site group is named from the page's `og:site_name`, it
259
326
  position: 'bottom-right', // where the button starts: bottom-right (default), bottom-left,
260
327
  // top-left, or top-right (just under a floating nav bar)
261
328
  hidden: import.meta.env.PROD, // hide the button (the theme still applies), e.g. in production
329
+ colourLogo: false, // themes colour the logo too, for first-time visitors (default
330
+ // false: it keeps its own colours); visitors can change it
331
+ intro: true, // the button pops in with a burst of the theme's colours a moment
332
+ // after the page loads (default); reduced motion fades it in
333
+ }
334
+ ```
335
+
336
+ ### Dark mode
337
+
338
+ Dark mode works on any site: every theme has a dark twin, so choosing Dark (or Auto, on a device set to dark) re-colours the whole page, and text, buttons and icons are checked for contrast on the dark background. It applies on every page load, and keeps working when the switcher is hidden in production.
339
+
340
+ Give visitors a light and dark switch anywhere, styled your way, by marking an element with `data-colorsbymax-mode`:
341
+
342
+ ```html
343
+ <button data-colorsbymax-mode="toggle">Light / dark</button>
344
+ ```
345
+
346
+ The panel's **Add to site** button (next to Light, Dark and Auto) previews one in your top bar and gives you ready-made code and an AI-editor prompt. `toggle` switches between light and dark; `light`, `dark` and `system` set one mode. colorsbymax wires the click, remembers the choice and sets `aria-pressed`. The page is marked with the current mode, for anything your CSS wants to adjust, like photos:
347
+
348
+ ```css
349
+ html[data-colorsbymax-scheme="dark"] .hero-photo {
350
+ filter: brightness(0.9);
262
351
  }
263
352
  ```
264
353
 
354
+ With `ThemeProvider`, `useTheme()` gives `mode` ('light' or 'dark'), `modeSetting` (including 'system') and `setMode(mode)`, for building your own switch.
355
+
265
356
  ### PDF uploads
266
357
 
267
358
  Building a palette from an image works out of the box. PDFs, such as brand guides, need [PDF.js](https://mozilla.github.io/pdf.js/), which is large, so it's opt-in: install it and pass the loader from `colorsbymax/pdf`.