Skip to content

Commit 6a1c58e

Browse files
committed
minor #2671 [Icons] explain svg colors and improve example configuration (dbu)
This PR was merged into the 2.x branch. Discussion ---------- [Icons] explain svg colors and improve example configuration | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | yes | Issues | - | License | MIT I got mislead by the configuration examples setting the `fill` attribute on the `<svg>` element. All icons i looked have `<path>` elements that reference `currentColor` for either fill or outline. and `currentColor` in the context of CSS is the `color` attribute of the element. thus, to change the color of an icon, we need to set the CSS color. changing the `fill` attribute on the top level `<svg>` has no effect. I am not 100% sure if this is always true, maybe the section i add needs to be less assertive or explain in which cases it is correct. Commits ------- b9347f6 [Icons] explain svg colors and improve example configuration
2 parents 405251f + b9347f6 commit 6a1c58e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Icons/doc/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ To keep your design consistent and easily adjustable, consider defining a
109109
:ref:`default attribute <icons_default_attributes>`. This allows you to control
110110
the size of all your icons from a single place.
111111

112+
Icon Color
113+
~~~~~~~~~~
114+
115+
Typically, SVG icons use ``fill="currentColor"`` to inherit the color of the containing element.
116+
You can set the color in CSS on the container or directly on the SVG element/class.
117+
118+
112119
Icon Sets
113120
~~~~~~~~~
114121

0 commit comments

Comments
 (0)