Where to put <style> inside SVG?
It doesn't matter. Neither approach is "more standard".
<style>
elements are not renderable anyway, so there is no real need to put them in the<defs>
section
As commented by Paul LeBeau.
After reading this article about style
on MDN, that shows an example of a style simply under the SVG
root, I am more convinced it is correct to put <style>
there rather than under <defs>
.
Also, since <defs>
tag is indeed for reusable graphical elements that should be rendered, and <style>
is not a renderable element, there's no point keeping it there.