Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] `customize` option doesnt work

Open
#529 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
nuxt, typescript
Domain
frontend

Research direction

Start with the app.config.ts customize callback and the nuxt.config.ts icon clientBundle settings, then reproduce the tabler:bulb example and compare its rendered SVG with the expected changes. Done means the customize callback applies the requested stroke, fill, animation-duration, and opacity changes to the rendered icon.

Written by the indexing model from the issue text.

Description

It just doesn't work. I followed the instructions in the README, but nothing happens.

Operating system Windows 10.0.26200
CPU Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz (8 cores)
Node.js version v22.23.2
nuxt/cli version 3.37.0
Package manager [email protected]
Nuxt version 4.5.2
Nitro version 2.13.4
Builder [email protected]
Config compatibilityDate, css, dayjs, devtools, fonts, icon, ignore, modules, vite
Modules @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @vueuse/[email protected], [email protected] **
// nuxt.config.ts
export default defineNuxtConfig({
  ...
  modules: [
    ...
    '@nuxt/icon',
  ],
  icon: {
    mode: 'svg',
    clientBundle: {
      scan: true,
      includeCustomCollections: true,
    },
  },
})
// app.config.ts
export default defineAppConfig({
  icon: {
    customize: (content: string, name: string, prefix: string, provider: string) => {
      if (prefix !== 'tabler') return content // Ignore Prefix

      return content
        .replace(/stroke-width="[^"]*"/g, `stroke-width="5"`) // Change stroke width to **5**
        .replace(/stroke="[^"]*"/g, `stroke="#FF5733"`) // Change stroke color to red
        .replace(/fill="[^"]*"/g, `fill="#FF5733"`) // Change fill color to red
        .replace(/animation-duration="[^"]*"/g, `animation-duration="1s"`) // Change animation duration to 1s (for animated icons)
        .replace(/opacity="[^"]*"/g, `opacity="0.8"`);// Change opacity to 0.8
    }
  }
})

// Code in the project
<Icon
  name="tabler:bulb"
  class="-ml-0.5 mb-0.5 inline-block"
/>
// Rendered icon
<svg
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  aria-hidden="true"
  role="img"
  class="iconify iconify--tabler -ml-0.5 mb-0.5 inline-block"
  style=""
  width="1em"
  height="1em"
  viewBox="0 0 24 24"
>
  <path
    fill="none"
    stroke="currentColor"
    stroke-linecap="round"
    stroke-linejoin="round"
    stroke-width="2"
    d="M3 12h1m8-9v1m8 8h1M5.6 5.6l.7.7m12.1-.7l-.7.7M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0-1 3a2 2 0 0 1-4 0a3.5 3.5 0 0 0-1-3m.7 1h4.6"
  ></path>
</svg>
Dominant language
TypeScript
Stars
1.2k
Forks
97
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nuxt/icon

All issues in nuxt/icon

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.