This tool uses the svgo library to inline styles in SVG files. It processes all SVG files in the svgs directory and updates them with inlined styles.
- Node.js and npm should be installed on your system.
-
Clone the repository and navigate to the project directory.
-
Install the required dependencies by running:
npm install
-
Ensure your SVG files are located in the
svgsdirectory. -
Run the tool to process the SVG files:
node tools/embedStyles.js
-
The tool will inline styles in each SVG file and overwrite the original files.
To verify the changes, you can open any SVG file in a browser to see the inlined styles:
open svgs/sample.svg- Ensure the
svgsdirectory exists and contains SVG files. - Check for any error messages in the console output for guidance on resolving issues.