-
-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to pass dynamic svg props #165
Conversation
With this |
Codecov Report
@@ Coverage Diff @@
## master #165 +/- ##
==========================================
- Coverage 88.91% 87.86% -1.05%
==========================================
Files 25 27 +2
Lines 424 478 +54
Branches 78 87 +9
==========================================
+ Hits 377 420 +43
- Misses 45 55 +10
- Partials 2 3 +1
Continue to review full report at Codecov.
|
Adding I suggest to modify svgAttributes: {
bool: true, // bool={true}
numeric: 1, // numeric={1}
string: 'string', // string="string"
dynamic: '`dynamic`', // dynamic={dynamic}
} This way, it will be easy to add dynamic values even in CLI:
What do you think? |
I don't suggest to keep both in the final api. svgProps is a clear name about what is expected. Attributes is html/xml term and its is always a string. I suggest to add this option for minor release and remove svgAttributes in the next major one. |
Ah, I see what you suggest. I'm not sure about using `` for expressions. Also types detection from strings in cli may lead to inconsistencies with config. |
In this diff I introduce the new option `svgProps` which is similar to svgAttributes but applies values in interpolation style `{true}`. This allows to specify expressions depending on template values for example default `currentColor` in `fill` prop. I mentioned in comment about later fixing api to smooth-code/h2x#13
If we keep only Using command line it will result to this:
My problem is that your use-case is minimal, people expects:
I think we have to keep the two options. |
If backquote notation is a problem, we could imagine:
What do you think? |
Won't this case be interpolated by bash somehow? |
Okay, this case is good for me |
@neoziro Done |
See #172 |
In this diff I introduce the new option
svgProps
which is similar tosvgAttributes but applies values in interpolation style
{true}
.This allows to specify expressions depending on template values for
example default
currentColor
infill
prop.I mentioned in comment about later fixing api to smooth-code/h2x#13