From c7e046f1c277663372ae9dd61a346abb818440fe Mon Sep 17 00:00:00 2001 From: donny Date: Thu, 28 May 2026 11:31:03 -0700 Subject: [PATCH] chore: update svgr options --- next.config.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/next.config.ts b/next.config.ts index a104613..2e8e868 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,22 +1,38 @@ import type { NextConfig } from "next"; +// SVGR rewrites hardcoded black/white fills to `currentColor` so SVGs +// inherit the surrounding CSS `color` (Tailwind's text-*) like Tabler icons do. +const svgrOptions = { + replaceAttrValues: { + "#000": "currentColor", + "#000000": "currentColor", + black: "currentColor", + "#fff": "currentColor", + "#ffffff": "currentColor", + white: "currentColor", + }, +}; + const nextConfig: NextConfig = { - // Turbopack (default in `next dev` and `next build` on Next 16) turbopack: { rules: { "*.svg": { - loaders: ["@svgr/webpack"], + loaders: [ + { + loader: "@svgr/webpack", + options: svgrOptions, + }, + ], as: "*.js", }, }, }, - // Webpack fallback — used if anyone opts out of Turbopack via `next build --no-turbopack` webpack(config) { config.module.rules.push({ test: /\.svg$/i, issuer: /\.[jt]sx?$/, - use: ["@svgr/webpack"], + use: [{ loader: "@svgr/webpack", options: svgrOptions }], }); return config; },