colorsbymax 0.4.0 → 0.5.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/dist/auto.js CHANGED
@@ -1,4 +1,4 @@
1
- import { o as ThemeProvider, t as ThemeSwitcher } from "./ThemeSwitcher-DB_-2YB8.js";
1
+ import { n as ThemeProvider, t as ThemeSwitcher } from "./ThemeSwitcher-Cns36kps.js";
2
2
  import { createElement } from "react";
3
3
  import { createRoot } from "react-dom/client";
4
4
  //#region src/auto.js
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { A as PAIRINGS, C as TOKEN_KEYS, D as MIN_CONTRAST_NON_TEXT, E as MIN_CONTRAST_LARGE_TEXT, F as contrastRatio, I as normalizeHex, M as checkTheme, N as fixAll, O as MIN_CONTRAST_TEXT, P as suggestFix, S as TOKEN_GROUPS, T as deriveAppTokens, _ as darkTokens, a as themeFromPalette, b as BASE_TOKENS, c as useTheme, d as DEFAULT_SETTINGS, f as collectColors, g as themeFromRoles, h as suggestThemes, i as rolesFromPalette, j as checkRamp, k as MIN_RAMP_STEP_DELTA_E, l as DEFAULT_STORAGE_KEY, m as inferRoles, n as coloursFromFile, o as ThemeProvider, p as detectSiteName, r as dominantColours, s as applyTokens, t as ThemeSwitcher, u as prePaintScript, v as isDarkTheme, w as completeTokens, x as PRESETS, y as toDark } from "./ThemeSwitcher-DB_-2YB8.js";
1
+ import { A as PAIRINGS, C as TOKEN_KEYS, D as MIN_CONTRAST_NON_TEXT, E as MIN_CONTRAST_LARGE_TEXT, F as contrastRatio, I as normalizeHex, M as checkTheme, N as fixAll, O as MIN_CONTRAST_TEXT, P as suggestFix, S as TOKEN_GROUPS, T as deriveAppTokens, _ as darkTokens, a as DEFAULT_STORAGE_KEY, b as BASE_TOKENS, c as coloursFromFile, d as themeFromPalette, f as collectColors, g as themeFromRoles, h as suggestThemes, i as useTheme, j as checkRamp, k as MIN_RAMP_STEP_DELTA_E, l as dominantColours, m as inferRoles, n as ThemeProvider, o as prePaintScript, p as detectSiteName, r as applyTokens, s as DEFAULT_SETTINGS, t as ThemeSwitcher, u as rolesFromPalette, v as isDarkTheme, w as completeTokens, x as PRESETS, y as toDark } from "./ThemeSwitcher-Cns36kps.js";
2
2
  export { BASE_TOKENS, DEFAULT_SETTINGS, DEFAULT_STORAGE_KEY, MIN_CONTRAST_LARGE_TEXT, MIN_CONTRAST_NON_TEXT, MIN_CONTRAST_TEXT, MIN_RAMP_STEP_DELTA_E, PAIRINGS, PRESETS, TOKEN_GROUPS, TOKEN_KEYS, ThemeProvider, ThemeSwitcher, applyTokens, checkRamp, checkTheme, collectColors, coloursFromFile, completeTokens, contrastRatio, darkTokens, deriveAppTokens, detectSiteName, dominantColours, fixAll, inferRoles, isDarkTheme, normalizeHex, prePaintScript, rolesFromPalette, suggestFix, suggestThemes, themeFromPalette, themeFromRoles, toDark, useTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colorsbymax",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A live theme switcher for any website: site themes, 700+ palettes, for light/dark modes and WCAG contrast checks.",
5
5
  "keywords": [
6
6
  "theme",
package/types/index.d.ts CHANGED
@@ -96,17 +96,32 @@ export interface ColorsByMaxConfig {
96
96
  */
97
97
  colourLogo?: boolean
98
98
  /**
99
- * How boldly a re-coloured site (one that doesn't paint with the --color-* variables) takes a
100
- * theme, for a first-time visitor. 'colourful' (default) paints the page's parts by role, as a
101
- * designer would: header, hero, alternating sections, cards, buttons, links, headings and footer.
102
- * 'subtle' only swaps the colours the site already has. Visitors can switch in the panel.
99
+ * How boldly the site takes a theme, for a first-time visitor. 'subtle' keeps the site's own
100
+ * backgrounds, cards and text and brings the theme in on buttons, links and highlights.
101
+ * 'balanced' is the theme as designed (the default on a site painted with the --color-*
102
+ * variables). 'colourful' is an overhaul: tinted backgrounds, and the page's parts painted by role
103
+ * as a designer would (the default on a site colorsbymax re-colours). Visitors can switch in the panel.
103
104
  */
104
- colourStyle?: 'colourful' | 'subtle'
105
+ colourStyle?: 'subtle' | 'balanced' | 'colourful'
106
+ /**
107
+ * The bell in the panel: says when a newer colorsbymax is out, with how to update, and shows news
108
+ * from mrmaxdesigns. 'dev' (default) shows it only on development addresses (localhost and the
109
+ * like), never to a live site's visitors; true everywhere; false never. It checks once a day.
110
+ */
111
+ updates?: boolean | 'dev'
112
+ /** How strongly Colourful paints for a first-time visitor, 0 (a light wash) to 100 (bold). Default 50. */
113
+ colourStrength?: number
105
114
  /**
106
115
  * Parts of the panel to switch off for everyone, e.g. `{ scan: false, audit: false }`. All are on
107
116
  * by default. Unlike the rest of the config it's read live, so a site can change it after loading.
108
117
  */
109
- features?: Partial<Record<'picks' | 'library' | 'search' | 'surprise' | 'scan' | 'custom' | 'overrides' | 'importExport' | 'audit' | 'addToSite' | 'colourStyle' | 'colourCount', boolean>>
118
+ features?: Partial<Record<'picks' | 'library' | 'search' | 'surprise' | 'scan' | 'custom' | 'overrides' | 'importExport' | 'audit' | 'addToSite' | 'colourStyle' | 'colourCount' | 'studio', boolean>>
119
+ /**
120
+ * Only colour these pages, e.g. `['/', '/pricing', '/blog/*']`. A path ending in `/*` is that
121
+ * section and every page under it. Every other page keeps its own colours. Default: the whole
122
+ * site. A visitor can choose differently in Studio, on their own device.
123
+ */
124
+ pages?: string[]
110
125
  /**
111
126
  * The mode a first-time visitor starts in (default 'light'; 'system' follows their device). Any
112
127
  * site can start dark: every theme has a dark twin. Visitors can still change it.
@@ -232,8 +247,12 @@ export interface PanelSettings {
232
247
  libraryCollapsed: boolean
233
248
  /** Whether themes re-colour the site's logo too. Off (the default) keeps its own colours. */
234
249
  colourLogo: boolean
235
- /** On a re-coloured site: 'colourful' paints its parts by role, 'subtle' only swaps its colours. */
236
- colourStyle: 'colourful' | 'subtle'
250
+ /** How boldly the site takes a theme: its own look with the theme's accents, the theme as designed, or an overhaul. */
251
+ colourStyle: 'subtle' | 'balanced' | 'colourful'
252
+ /** How strongly Colourful paints, 0 (a light wash) to 100 (bold). */
253
+ colourStrength: number
254
+ /** Whether Colourful tints the page with colours from the site's own pictures. */
255
+ imageTints: boolean
237
256
  /** Hidden on this device (from the finish screen); Alt+Shift+C or ?colorsbymax brings it back. */
238
257
  hideButton: boolean
239
258
  }