diff --git a/projects/icons-fontawesome/scripts/prepare-icons.ts b/projects/icons-fontawesome/scripts/prepare-icons.ts
index 29cf9462b597..b4ca2ebdaceb 100644
--- a/projects/icons-fontawesome/scripts/prepare-icons.ts
+++ b/projects/icons-fontawesome/scripts/prepare-icons.ts
@@ -3,68 +3,58 @@ import fs from 'node:fs';
import path from 'node:path';
import {PAYMENTS_ICONS} from '../../../scripts/custom-icons';
+import {prepareSvg} from '../../../scripts/prepare-svg';
import {tuiIsCI} from '../../cdk/schematics';
const verbose = !tuiIsCI();
+const dest =
+ process.argv[2] || path.join(process.cwd(), 'projects', 'icons-fontawesome', 'src');
+
+// 1. copy fontawesome icons
+['brands', 'regular', 'solid'].forEach((type) => {
+ const src = path.join(
+ process.cwd(),
+ 'node_modules',
+ '@fortawesome',
+ 'fontawesome-free',
+ 'svgs',
+ type,
+ );
-(function main(): void {
- const dest =
- process.argv[2] ||
- path.join(process.cwd(), 'projects', 'icons-fontawesome', 'src');
-
- // 1. copy fontawesome icons
- ['brands', 'regular', 'solid'].forEach((type) => {
- const src = path.join(
- process.cwd(),
- 'node_modules',
- '@fortawesome',
- 'fontawesome-free',
- 'svgs',
- type,
- );
-
- // noinspection DuplicatedCode
- fs.readdirSync(src).forEach((filename: string) => {
- const content = fs
- .readFileSync(path.join(src, filename), 'utf-8')
- .replace(/class="[a-zA-Z0-9:;.\s()\-,]*"/, '')
- .replaceAll(
- /<(circle|ellipse|line|polygon|polyline|path|rect)/g,
- '<$1 vector-effect="non-scaling-stroke"',
- );
-
- const filePath = path.join(dest, 'fa', type, filename);
-
- fs.mkdirSync(path.dirname(filePath), {recursive: true});
- fs.writeFileSync(filePath, content);
-
- verbose && console.info('copied:', filePath);
- });
- });
-
- // 2. copy flags from design tokens
// noinspection DuplicatedCode
- const flagsDir = path.resolve('node_modules/@taiga-ui/design-tokens/icons/flags');
-
- fs.readdirSync(flagsDir).forEach((filename: string) => {
- const content = fs.readFileSync(path.join(flagsDir, filename), 'utf-8');
- const filePath = path.join(dest, 'flags', filename);
+ fs.readdirSync(src).forEach((filename: string) => {
+ const content = prepareSvg(fs.readFileSync(path.join(src, filename), 'utf-8'));
+ const filePath = path.join(dest, 'fa', type, filename);
fs.mkdirSync(path.dirname(filePath), {recursive: true});
fs.writeFileSync(filePath, content);
verbose && console.info('copied:', filePath);
});
+});
- // 3. copy payment icons
- PAYMENTS_ICONS.forEach((filename) => {
- const filePath = path.join('projects/icons/src', `${filename}.svg`);
+// 2. copy flags from design tokens
+// noinspection DuplicatedCode
+const flagsDir = path.resolve('node_modules/@taiga-ui/design-tokens/icons/flags');
- fs.writeFileSync(
- path.join(dest, `${filename}.svg`),
- fs.readFileSync(path.join(filePath), 'utf-8'),
- );
+fs.readdirSync(flagsDir).forEach((filename: string) => {
+ const content = fs.readFileSync(path.join(flagsDir, filename), 'utf-8');
+ const filePath = path.join(dest, 'flags', filename);
- verbose && console.info('copied:', filePath);
- });
-})();
+ fs.mkdirSync(path.dirname(filePath), {recursive: true});
+ fs.writeFileSync(filePath, content);
+
+ verbose && console.info('copied:', filePath);
+});
+
+// 3. copy payment icons
+PAYMENTS_ICONS.forEach((filename) => {
+ const filePath = path.join('projects/icons/src', `${filename}.svg`);
+
+ fs.writeFileSync(
+ path.join(dest, `${filename}.svg`),
+ fs.readFileSync(path.join(filePath), 'utf-8'),
+ );
+
+ verbose && console.info('copied:', filePath);
+});
diff --git a/projects/icons-fontawesome/src/fa/brands/42-group.svg b/projects/icons-fontawesome/src/fa/brands/42-group.svg
index 4b0d54451c53..f3d68c6a114f 100644
--- a/projects/icons-fontawesome/src/fa/brands/42-group.svg
+++ b/projects/icons-fontawesome/src/fa/brands/42-group.svg
@@ -1,5 +1,4 @@
diff --git a/projects/icons-fontawesome/src/fa/brands/html5.svg b/projects/icons-fontawesome/src/fa/brands/html5.svg
index 006be57d4742..75c7e2b21ae1 100644
--- a/projects/icons-fontawesome/src/fa/brands/html5.svg
+++ b/projects/icons-fontawesome/src/fa/brands/html5.svg
@@ -1,5 +1,4 @@