Topics

Note Selector

SVG Tagging

Wednesday, April 28, 2021

An SVG widget's name will typically just be 'svg'. This is okay since developers shouldn't create raw SVG widgets, but instead, graphic widgets that own SVG widgets. Providing a name to the graphic widget should be sufficient to create individuality.

Format: ../name of parent graphic widget/svg
Example: ../icon/svg

SVGs can be made up of multiple elements. In SVG files, these elements are identified by their 'id' value. To specify an SVG's element in the tagging system, use '#' followed by the element's 'id' value.

Format: ../svg/#id
Example: ../svg/#gear

The following are examples of accepted attribute tags:

../svg/#id/color
../svg/#id/hover_color

Specifying IDs like above allows for customization of specific SVG elements. Sometimes, it is better to be able to set one theme attribute to define the color for an SVG, regardless of element. For this purpose, use the following attribute tags without the '#id' part:

../svg/common_color
../svg/common_hover_color

In order to use the common attributes, the use attribute associated with the desired common attribute must be enabled. For example:

set_atttribute_value("use_common_color", true)