preserve ti-fw classes for icons - fixes #580

I thought that `ti-fw` was mostly useless, but it turns out that:

- it affects the alignment of icons in many places

- it's set separately in some places
  (e.g. `packages/frontend/src/ui/_common_/navbar.ts` has `<i
  class="ti-fw" :class="[$style.itemIcon,
  navbarItemDef[item].icon]"></i>`)

so we have to keep it around.
This commit is contained in:
dakkar 2024-07-15 16:33:10 +01:00
parent f9a09b0358
commit ded459304e

View file

@ -5,10 +5,9 @@ function iconsReplace(opts: RollupReplaceOptions) {
return pluginReplace({ return pluginReplace({
...opts, ...opts,
preventAssignment: false, preventAssignment: false,
// only replace these strings at the start of strings, remove a // only replace these strings at the start of strings, and make
// `ti-fw` it if happens to be just after, and make sure they're // sure they're followed by a word-boundary that's not a dash
// followed by a word-boundary that's not a dash delimiters: ['(?<=["\'`])', '\\b(?!-)'],
delimiters: ['(?<=["\'`])', '(?: ti-fw)?\\b(?!-)'],
}); });
} }