@canopy-iiif/app 0.10.12 → 0.10.14

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/ui/theme.js CHANGED
@@ -130,14 +130,15 @@ function toTailwindScale(name, options = {}) {
130
130
  const prefix = name;
131
131
  const scale = {};
132
132
  const darken900Amount = normalizeDarkenAmount(options.darken900Amount);
133
+ const steps = STEP_MAP;
133
134
  for (const lvl of LEVELS) {
134
- const radixStep = STEP_MAP[lvl];
135
+ const radixStep = steps[lvl];
135
136
  const key = `${prefix}${radixStep}`;
136
137
  const value = palette[key];
137
138
  if (!value) return null;
138
139
  scale[lvl] = value;
139
140
  }
140
- const darkestKey = `${prefix}${STEP_MAP["900"]}`;
141
+ const darkestKey = `${prefix}${steps["900"]}`;
141
142
  if (scale["800"] && palette[darkestKey]) {
142
143
  const amount = darken900Amount != null ? darken900Amount : 0.25;
143
144
  scale["900"] =
@@ -154,9 +155,9 @@ function buildVariablesMap(brandScale, grayScale, options = {}) {
154
155
  if (brandScale) {
155
156
  for (const lvl of LEVELS) {
156
157
  const value = brandScale[lvl];
157
- if (value) vars[`--color-brand-${lvl}`] = value;
158
+ if (value) vars[`--color-accent-${lvl}`] = value;
158
159
  }
159
- if (brandScale["700"]) vars["--color-brand-default"] = brandScale["700"];
160
+ if (brandScale["700"]) vars["--color-accent-default"] = brandScale["700"];
160
161
  }
161
162
  if (grayScale) {
162
163
  for (const lvl of LEVELS) {
@@ -271,21 +272,6 @@ function loadCanopyTheme(options = {}) {
271
272
  },
272
273
  });
273
274
 
274
- if (
275
- !DEBUG_ENABLED &&
276
- (accentName !== DEFAULT_ACCENT || grayName !== DEFAULT_GRAY)
277
- ) {
278
- try {
279
- console.log("[canopy-theme]", "resolved", {
280
- appearance,
281
- accent: accentName,
282
- accent500: accentScale && accentScale["500"],
283
- gray: grayName,
284
- gray500: grayScale && grayScale["500"],
285
- });
286
- } catch (_) {}
287
- }
288
-
289
275
  return {
290
276
  appearance,
291
277
  accent: {name: accentName, scale: accentScale},