Comments (1)
Hi @vijhhh2. If I understand correctly this issue comes because your SVG already has a hardcoded color. To override you need to use a deep selector to override the fill property. If you want to style your SVGs using the color attribute you need to provide your SVG in a different way. Basically without a hardcoded color.
svg-to-ts
just converts your SVGs into TypeScript
/ JavaScript
. However, we also offer the possibility to run some optimizations on your SVGs by passing an svgo
object. In the snippet above I see that your are already using this option. I would recommend you to check out the svgo README.
I remember that we had something pretty similar in our project. And the way to solve it was that our designer delivered SVGs without hardcoded colors and then it just worked fine.
I am going to close this Issue here since in my opinion this is more related to your SVGs and not to the transformation.
from svg-to-ts.
Related Issues (20)
- Icon name using folder as name HOT 4
- `svg-to-ts-files` always generate a single file HOT 2
- Deliver correct ESM
- svg - same id of path generated for all icons HOT 1
- update to svgo version 3.x HOT 1
- Run within a module repository HOT 1
- How to customize size and apply primary color HOT 6
- Unexpected viewBox removal HOT 1
- Possibility to extract only the "d" attribute of the path HOT 1
- 'svg-to-ts' is not recognized as an internal or external command (Angular 15) HOT 5
- SVG not completely converted HOT 1
- Config option "tsx: true" error: Parameter 'props' implicitly has an 'any' type. HOT 3
- Threeshaking not working HOT 1
- Only converting new files
- Expression produces a union type that is too complex to represent. HOT 1
- Tutorial requires a paid Medium account HOT 2
- Option to use existing dir structure when using globs
- When generating an interface, Icon's do not implement the Interface
- Option to generate constant name in uppercase HOT 1
- Add support for verbatimModuleSyntax HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg-to-ts.