Skip to content
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

Add ClipPath / Mask + How to use Style? #12

Open
nico-k3 opened this issue Jul 5, 2022 · 1 comment
Open

Add ClipPath / Mask + How to use Style? #12

nico-k3 opened this issue Jul 5, 2022 · 1 comment

Comments

@nico-k3
Copy link

nico-k3 commented Jul 5, 2022

Hi! I am currently trying to use your Package,
and first of all: Thank you a lot! I have created SVGs using string interpolation before but this gets messy fast, so it is highly appreciated to have a cleaner alternative.

Unfortunately, I can't really figure out how to use the Style Element.

Seems like I have to provide another SVG-Builder Element as content eg.

svg.style({}, svg.line(...))

This does not really make sense to me as I would like to write some styling into the style tags not create a line or path.

I think some more Documentation would come a long way here.

Also, I would really appreciate it if there was something like a mask or clipPath.
Would make this package a whole lot more versatile!

Thanks for your effort so far!

Nico

@armoredpigeon
Copy link

armoredpigeon commented Jul 20, 2022

Looking at the code, it looks like the style element accepts style as an attribute, so you can put, for example: svg.style({style:"fill: skyblue; stroke: cadetblue"}) if you want to write styling into the style tags.

The arguments in a given svg.function-name-here are attributes then content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants