mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Refactor again icon conversion to use properties for 'fill' and 'stroke' direct in 'svg' tags in icon components
This commit is contained in:
parent
a3a1b88f16
commit
9e66cc6e7a
@ -16,7 +16,14 @@ readdirSync(inputDir).forEach((file) => {
|
||||
const fileName = parse(file).name
|
||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||
const content = readFileSync(filePath, 'utf8')
|
||||
const vueComponent = `<!-- eslint-disable vue/multi-word-component-names -->\n<!-- eslint-disable @intlify/vue-i18n/no-raw-text -->\n<template>\n${content}\n<style scss>\n.svg-icon {\nfill: currentcolor;\nstroke: currentcolor;\n}\n</style>\n</template>\n`
|
||||
|
||||
// add 'fill' and 'stroke' attributes to SVG code
|
||||
const modifiedContent = content.replace(
|
||||
/<svg([^>]*)>/,
|
||||
'<svg$1 fill="currentColor" stroke="currentColor">',
|
||||
)
|
||||
|
||||
const vueComponent = `<!-- eslint-disable vue/multi-word-component-names -->\n<!-- eslint-disable @intlify/vue-i18n/no-raw-text -->\n<template>\n${modifiedContent}\n</template>\n`
|
||||
|
||||
const outputFilePath = join(outputDir, `${fileName}.vue`)
|
||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user