Skip to content

Commit

Permalink
fix: handle backslash in font-icons when generating CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Oct 17, 2024
1 parent 6355fba commit 94bc49f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/css-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ function shimThemableMixin(moduleId: string) {
return shimModule(themableMixin, {
...themableMixinModule,
css(strings: readonly string[], ...values: ReadonlyArray<CSSResult | number>) {
return new CSSResult(moduleId, strings, values);
const result: readonly string[] = moduleId.endsWith('font-icons.js')
? strings.map((string) => string.replace(/'\\\\([a-z0-9]+)'/g, "'\\$1'"))
: strings;
return new CSSResult(moduleId, result, values);
},
registerStyles() {},
unsafeCSS,
Expand Down

0 comments on commit 94bc49f

Please sign in to comment.