@shikijs/colorized-brackets 3.12.3 → 3.14.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.
Files changed (2) hide show
  1. package/dist/index.mjs +10 -0
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { ShikiError } from 'shiki';
2
+
1
3
  const builtInThemes = {
2
4
  "andromeeda": [
3
5
  "#FFD700",
@@ -590,6 +592,14 @@ function assignColorToToken(token, themes, shikiOptions, level) {
590
592
  const cssProperty = colorName === defaultColor ? "color" : `${cssVariablePrefix}${colorName}`;
591
593
  styles[cssProperty] = getColor(themes, themeName, level);
592
594
  }
595
+ if (defaultColor === "light-dark()") {
596
+ const lightColor = styles[`${cssVariablePrefix}light`];
597
+ const darkColor = styles[`${cssVariablePrefix}dark`];
598
+ if (!lightColor || !darkColor) {
599
+ throw new ShikiError('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
600
+ }
601
+ styles.color = `light-dark(${lightColor},${darkColor})`;
602
+ }
593
603
  token.htmlStyle = styles;
594
604
  }
595
605
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/colorized-brackets",
3
3
  "type": "module",
4
- "version": "3.12.3",
4
+ "version": "3.14.0",
5
5
  "description": "VSCode-style colorized brackets transformer for Shiki",
6
6
  "author": "Michael Moore <mscottmoore@pm.me>",
7
7
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "shiki": "3.12.3"
30
+ "shiki": "3.14.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "unbuild",