diff --git a/.changeset/fruity-trains-tease.md b/.changeset/fruity-trains-tease.md new file mode 100644 index 000000000..cacf43cbd --- /dev/null +++ b/.changeset/fruity-trains-tease.md @@ -0,0 +1,5 @@ +--- +"@gitbook/icons": patch +--- + +Fix icon rendering with explicit currentColor on icon element diff --git a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx index be6dd5981..6e23d3533 100644 --- a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx +++ b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx @@ -29,7 +29,6 @@ import { tcls } from '@/lib/tailwind'; import { RootLayoutClientContexts } from './RootLayoutClientContexts'; -import '@gitbook/icons/style.css'; import './globals.css'; import type { GitBookAnyContext } from '@/lib/context'; import { GITBOOK_FONTS_URL, GITBOOK_ICONS_TOKEN, GITBOOK_ICONS_URL } from '@/lib/env'; diff --git a/packages/icons/package.json b/packages/icons/package.json index bdeb5658f..6117b05d1 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -11,8 +11,7 @@ "types": "./dist/icons.d.ts", "development": "./src/icons.ts", "default": "./dist/icons.js" - }, - "./style.css": "./src/style.css" + } }, "sideEffects": false, "version": "0.4.0", diff --git a/packages/icons/src/Icon.tsx b/packages/icons/src/Icon.tsx index 4f5f91130..d1eedd06e 100644 --- a/packages/icons/src/Icon.tsx +++ b/packages/icons/src/Icon.tsx @@ -63,6 +63,7 @@ export const Icon = React.forwardRef(function Icon( WebkitMaskRepeat: 'no-repeat', maskPosition: 'center', WebkitMaskPosition: 'center', + backgroundColor: 'currentColor', ...(size ? { width: size, height: size } : {}), ...rest.style, }} diff --git a/packages/icons/src/style.css b/packages/icons/src/style.css deleted file mode 100644 index e35e26f8f..000000000 --- a/packages/icons/src/style.css +++ /dev/null @@ -1,11 +0,0 @@ -/* Normal */ -svg.gb-icon { - background-color: currentColor; -} - -/* Sprite */ -svg.gb-icon-s path, -svg.gb-icon-s use { - fill: currentColor; - stroke: currentColor; -}