colorsbymax 0.2.2 → 0.3.0
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 +24 -0
- package/README.md +107 -9
- package/dist/{ThemeSwitcher-L1GXY55E.js → ThemeSwitcher-CFtLm7PM.js} +846 -203
- package/dist/auto.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
- package/types/index.d.ts +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in each colorsbymax release. Update with `npm install colorsbymax@latest`.
|
|
4
4
|
|
|
5
|
+
## 0.3.0 (2026-09-25)
|
|
6
|
+
|
|
7
|
+
- **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.
|
|
8
|
+
- **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`.
|
|
9
|
+
- **Light, Dark and Auto in the panel's header**, next to Audit, so they're one click away.
|
|
10
|
+
- **"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.
|
|
11
|
+
- **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.
|
|
12
|
+
- **A burst of colour on every click** of the colour button, not only when it first appears.
|
|
13
|
+
- **The panel stays open while you drag the button**, and moves with it.
|
|
14
|
+
- **Picking a library category scrolls to its themes**, so the colours are in view straight away.
|
|
15
|
+
- **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).
|
|
16
|
+
- **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`.
|
|
17
|
+
- **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.
|
|
18
|
+
- **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).
|
|
19
|
+
- **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.
|
|
20
|
+
- The colorsbymax site's own colours now pass every contrast check in light and dark.
|
|
21
|
+
- Fixed: when the colour button was hidden on a device, the next page load could stop the switcher with an error.
|
|
22
|
+
- The demo is live at [mrmaxdesigns.com/colorsbymax](https://mrmaxdesigns.com/colorsbymax), now the package's homepage.
|
|
23
|
+
|
|
24
|
+
## 0.2.3 (2026-09-25)
|
|
25
|
+
|
|
26
|
+
- **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.
|
|
27
|
+
- The README and the MCP README now explain the steps after adding the MCP server: start a new session, ask your agent to add colorsbymax, and run your site.
|
|
28
|
+
|
|
5
29
|
## 0.2.2 (2026-09-25)
|
|
6
30
|
|
|
7
31
|
- **MCP server for AI agents.** [colorsbymax-mcp](mcp/) lets Claude Code, Cursor, VS Code Copilot and other agents set colorsbymax up in a project (with the right edits for Vite, Next.js, Remix, Astro, Nuxt, SvelteKit, plain HTML and more), find themes, build one from brand colours, check contrast and finish. Add it with `claude mcp add colorsbymax -- npx -y colorsbymax-mcp`.
|
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
|
|
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,
|
|
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
|
| --- | --- |
|
|
@@ -90,6 +94,13 @@ Your coding agent can set colorsbymax up and use it for you. [colorsbymax-mcp](m
|
|
|
90
94
|
|
|
91
95
|
It reads your project but never changes it: the agent makes the edits, so you review them as usual. It runs with `npx`, so there's nothing to install first (Node 18 or later).
|
|
92
96
|
|
|
97
|
+
**Adding the server doesn't change your site by itself.** It gives your agent the tools; the agent then sets colorsbymax up when you ask:
|
|
98
|
+
|
|
99
|
+
1. **Add the server** once, with the steps for your editor below.
|
|
100
|
+
2. **Start a new chat or session** in your project. Agents load MCP servers when a session starts, so one that was already open won't see it yet.
|
|
101
|
+
3. **Ask:** *"Add colorsbymax to this project."* The agent installs the package and adds the one line (or the right version of it for your framework).
|
|
102
|
+
4. **Run your site** (for example `npm run dev`). The colour button appears in the bottom-right corner.
|
|
103
|
+
|
|
93
104
|
### Claude Code
|
|
94
105
|
|
|
95
106
|
```bash
|
|
@@ -98,6 +109,8 @@ claude mcp add colorsbymax -- npx -y colorsbymax-mcp
|
|
|
98
109
|
|
|
99
110
|
That adds it for you in this project. Add `--scope user` to have it in every project, or `--scope project` to share it with your team through a `.mcp.json` file. Check it with `/mcp` inside Claude Code.
|
|
100
111
|
|
|
112
|
+
If your terminal says `claude` isn't found (the desktop app doesn't always put it on your PATH), ask Claude Code itself: *"Add the colorsbymax MCP server: `npx -y colorsbymax-mcp`."*
|
|
113
|
+
|
|
101
114
|
### Cursor
|
|
102
115
|
|
|
103
116
|
Add this to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json` for every project:
|
|
@@ -128,9 +141,21 @@ Add this to `.vscode/mcp.json`, then use it from Copilot Chat in **Agent** mode:
|
|
|
128
141
|
|
|
129
142
|
Open **Settings → Developer → Edit Config**, add the same `mcpServers` entry as Cursor to `claude_desktop_config.json`, and restart Claude Desktop.
|
|
130
143
|
|
|
131
|
-
###
|
|
144
|
+
### GitHub Copilot CLI
|
|
145
|
+
|
|
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`.
|
|
132
151
|
|
|
133
|
-
|
|
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:
|
|
134
159
|
|
|
135
160
|
```toml
|
|
136
161
|
[mcp_servers.colorsbymax]
|
|
@@ -138,6 +163,57 @@ command = "npx"
|
|
|
138
163
|
args = ["-y", "colorsbymax-mcp"]
|
|
139
164
|
```
|
|
140
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
|
+
|
|
141
217
|
On Windows, if an editor can't start `npx`, use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "colorsbymax-mcp"]`.
|
|
142
218
|
|
|
143
219
|
### What to ask
|
|
@@ -166,12 +242,12 @@ When you're done choosing colours, the panel's **I'm done** button gives you rea
|
|
|
166
242
|
- **Scan the site.** Press "Scan site" and colorsbymax reads the colours actually painted on the page (ignoring any theme it has applied, and including gradients). It works out the page background, surfaces, text and brand colours, then adds themes named after the site: Scanned (as found), Accessible, Soft, Bold, Complementary, and the closest library matches. Scans run only when asked, and the results are remembered.
|
|
167
243
|
- **Max’s picks and library.** 5 hand-tuned picks, plus 715 library themes (Bright, Fun, Pastel, Earth tones, Summer, Autumn, Winter, Spring, Ocean, Warm, Nature, Moody, Monochrome, Eclectic) with search and "Surprise me". The library loads only when the panel opens.
|
|
168
244
|
- **Custom palettes, single-colour overrides, JSON import/export.**
|
|
169
|
-
- **Palettes from images and PDFs.** In Import / export, upload or drop a mood board, screenshot or photo
|
|
245
|
+
- **Palettes from images and PDFs.** In Import / export, upload or drop a mood board, screenshot or photo, or paste one straight from the clipboard: take a screenshot, open the panel and press Ctrl+V (⌘V on a Mac), or use **Paste image**. colorsbymax picks out its main colours, lets you leave any out, previews the palette it builds around them and saves it as a custom palette. Nothing leaves the browser. PDFs, such as brand guides, work where the site [turns them on](#pdf-uploads); hex codes written in a PDF take priority.
|
|
170
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.
|
|
171
247
|
- **No flash on reload.** An inline pre-paint script applies the saved theme before the page draws.
|
|
172
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.
|
|
173
|
-
- **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
|
|
174
|
-
- **Light and dark mode.** Every built-in theme is designed light
|
|
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.
|
|
175
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.
|
|
176
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.
|
|
177
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.
|
|
@@ -206,7 +282,7 @@ This is the full setup, for sites that want exact control over which colour goes
|
|
|
206
282
|
}
|
|
207
283
|
```
|
|
208
284
|
|
|
209
|
-
With plain CSS, or Tailwind before v4, define the variables yourself
|
|
285
|
+
With plain CSS, or Tailwind before v4, define the variables yourself:
|
|
210
286
|
|
|
211
287
|
```css
|
|
212
288
|
:root {
|
|
@@ -228,7 +304,7 @@ This is the full setup, for sites that want exact control over which colour goes
|
|
|
228
304
|
</ThemeProvider>
|
|
229
305
|
```
|
|
230
306
|
|
|
231
|
-
The switcher needs React but not a React site: `
|
|
307
|
+
The switcher needs React but not a React site: `autoMount` from `colorsbymax/auto` mounts it on its own next to any page.
|
|
232
308
|
|
|
233
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.
|
|
234
310
|
|
|
@@ -250,9 +326,31 @@ Without a `siteName`, the site group is named from the page's `og:site_name`, it
|
|
|
250
326
|
position: 'bottom-right', // where the button starts: bottom-right (default), bottom-left,
|
|
251
327
|
// top-left, or top-right (just under a floating nav bar)
|
|
252
328
|
hidden: import.meta.env.PROD, // hide the button (the theme still applies), e.g. in production
|
|
329
|
+
intro: true, // the button pops in with a burst of the theme's colours a moment
|
|
330
|
+
// after the page loads (default); reduced motion fades it in
|
|
253
331
|
}
|
|
254
332
|
```
|
|
255
333
|
|
|
334
|
+
### Dark mode
|
|
335
|
+
|
|
336
|
+
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.
|
|
337
|
+
|
|
338
|
+
Give visitors a light and dark switch anywhere, styled your way, by marking an element with `data-colorsbymax-mode`:
|
|
339
|
+
|
|
340
|
+
```html
|
|
341
|
+
<button data-colorsbymax-mode="toggle">Light / dark</button>
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
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:
|
|
345
|
+
|
|
346
|
+
```css
|
|
347
|
+
html[data-colorsbymax-scheme="dark"] .hero-photo {
|
|
348
|
+
filter: brightness(0.9);
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
With `ThemeProvider`, `useTheme()` gives `mode` ('light' or 'dark'), `modeSetting` (including 'system') and `setMode(mode)`, for building your own switch.
|
|
353
|
+
|
|
256
354
|
### PDF uploads
|
|
257
355
|
|
|
258
356
|
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`.
|