@canopy-iiif/app 0.10.4 → 0.10.5

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.
@@ -47,9 +47,11 @@ async function ensureStyles() {
47
47
  }
48
48
  }
49
49
 
50
- const inputCss = fs.existsSync(customAppCss)
50
+ const hasAppCss = fs.existsSync(customAppCss);
51
+ const hasContentCss = fs.existsSync(customContentCss);
52
+ const inputCss = hasAppCss
51
53
  ? customAppCss
52
- : fs.existsSync(customContentCss)
54
+ : hasContentCss
53
55
  ? customContentCss
54
56
  : null;
55
57
 
@@ -141,6 +143,8 @@ async function ensureStyles() {
141
143
  } catch (_) {}
142
144
  }
143
145
 
146
+ const shouldInjectTheme = !(hasAppCss && configPath);
147
+
144
148
  if (configPath && (inputCss || generatedInput)) {
145
149
  const ok = buildTailwindCli({
146
150
  input: inputCss || generatedInput,
@@ -149,7 +153,7 @@ async function ensureStyles() {
149
153
  minify: true,
150
154
  });
151
155
  if (ok) {
152
- injectThemeTokens(dest);
156
+ if (shouldInjectTheme) injectThemeTokens(dest);
153
157
  return; // Tailwind compiled CSS
154
158
  }
155
159
  }
@@ -165,14 +169,14 @@ async function ensureStyles() {
165
169
  if (fs.existsSync(customAppCss)) {
166
170
  if (!isTailwindSource(customAppCss)) {
167
171
  await fsp.copyFile(customAppCss, dest);
168
- injectThemeTokens(dest);
172
+ if (shouldInjectTheme) injectThemeTokens(dest);
169
173
  return;
170
174
  }
171
175
  }
172
176
  if (fs.existsSync(customContentCss)) {
173
177
  if (!isTailwindSource(customContentCss)) {
174
178
  await fsp.copyFile(customContentCss, dest);
175
- injectThemeTokens(dest);
179
+ if (shouldInjectTheme) injectThemeTokens(dest);
176
180
  return;
177
181
  }
178
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopy-iiif/app",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Mat Jordan <mat@northwestern.edu>",