-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
<style>/<defs> support #38
Comments
This makes it easy to run a tileset through different style files, which is how CSS is supposed to work.
Still no support for |
Sometimes I want to use a Possible solution: an |
Nice idea! Alternatively, we could use the Oh, but I see your point is to automatically generate unique IDs for dynamic markers inside symbols (and in particular in components/helper functions used in symbols, so also doesn't make sense to add a So here's the proposed API: id = svgtiler.def(<clipPath><polygon .../></clipPath>)
#or
id = svgtiler.def("<clipPath><polygon .../></clipPath>")
|
It would be nice to be able to define global CSS rules via
<style>
tag, and global objects like gradients via<defs>
tag, but we currently don't have anywhere to put global definitions. I see a few options:global
or maybesvgtiler:global
(to avoid conflicts) that can contain such definitions.global
that could be detected (I think) in addition to the main return value (object or function mapping).svgtiler.def(...)
or modify API data likesvgtiler.defs.push(...)
.export defs = <defs>...</defs>
, now that we supportexport
file.svg
that can have<defs>
(or<symbol>
s?) in it, which gets directly included.<style>
or<defs>
tags (outside of<symbol>
s, similar to Keys expanding to multiple <symbol>s #33) that get assembled into a global set of definitions, deduplicating CSS rules and defs with identical ids.The idea for the last option is that rules are often local to the (various versions of) a single symbol, and this way you can just include the rules you need for this particular figure. One example would be if the symbol SVG was extracted from an Illustrator file, which often has a
<style>
tag. But this also often isn't the case, e.g., all line types might be the same, or the definitions of-
and|
might share a lot. Not sure what's best...The text was updated successfully, but these errors were encountered: