@shikijs/colorized-brackets 2.0.0 → 2.0.2

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 +3 -3
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -530,13 +530,13 @@ function assignColorToToken(token, themes, shikiOptions, level) {
530
530
  token.color = getColor(themes, themeName, level);
531
531
  } else {
532
532
  const { defaultColor = "light", cssVariablePrefix = "--shiki-" } = shikiOptions;
533
- const styles = [];
533
+ const styles = typeof token.htmlStyle === "string" ? {} : token.htmlStyle || {};
534
534
  for (const [colorName, theme] of Object.entries(shikiOptions.themes)) {
535
535
  const themeName = typeof theme === "string" ? theme : theme?.name;
536
536
  const cssProperty = colorName === defaultColor ? "color" : `${cssVariablePrefix}${colorName}`;
537
- styles.push(`${cssProperty}:${getColor(themes, themeName, level)}`);
537
+ styles[cssProperty] = getColor(themes, themeName, level);
538
538
  }
539
- token.htmlStyle = styles.join(";");
539
+ token.htmlStyle = styles;
540
540
  }
541
541
  }
542
542
  function isSingleTheme(shikiOptions) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/colorized-brackets",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "description": "Collective of common transformers transformers for Shiki",
6
6
  "author": "Michael Moore <mscottmoore@pm.me>",
7
7
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "shiki": "2.0.0"
33
+ "shiki": "2.0.2"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "unbuild",