# style
The SVG style
element allows style sheets to be embedded directly within SVG content.
SVG's style element has the same attributes as the corresponding element in HTML (see HTML's style
element).
Usually, this element is create with:
const style = parentElement.add('style')
It's possible create as a disconnected element with gySVG('style')
and attach it to the SVG document with .attachTo()
.
More info: mdn (opens new window) | w3c (opens new window)
# .type()
style.type( _ )
Set this attribute defines type
of the style sheet language to use as a media type
string.
argument:
{} _
returns:
{gySVGObject}
The original object
const type = element.type();
Get the type
current value.
- returns:
{}
# .media()
style.media( _ )
Set this attribute defines to which media
the style applies.
argument:
{} _
returns:
{gySVGObject}
The original object
const media = element.media();
Get the media
current value.