Fix frontend-observability icon fill colour (#82326)

This commit is contained in:
Josh Hunt 2024-02-12 17:31:14 +00:00 committed by GitHub
parent fea23862b4
commit 2210d5228f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,11 @@
# How to add a new icon # How to add a new icon
- Add the new icon svg to the `unicons/` directory - Add the new icon svg to the `unicons/` directory
- Yes, even if it's not from [IconScout](https://iconscout.com/unicons/solid-icons) - Yes, even if it's not a unicon icon or from [IconScout](https://iconscout.com/unicons/solid-icons)
- We will eventually condense all the separate folders into a single `icons/` directory, and since `unicons/` is the default it makes sense to add new icons there - We will eventually condense all the separate folders into a single `icons/` directory, and since `unicons/` is the default it makes sense to add new icons there
- Ensure the new icon source is formatted correctly: - Ensure the new icon source is formatted correctly:
- Remove any `width` or `height` attributes - Remove any `width` or `height` attributes
- If the icon is a single color, ensure any explicitly defined fill or stroke colors are either removed or set to `currentColor` - If the icon is a single color, ensure any explicitly defined fill or stroke colors are either removed (or set to `currentColor` if a color must be defined)
- This allows the consumer to control the color of the `Icon`, which is useful for hover/focus states - This allows the consumer to control the color of the `Icon`, which is useful for hover/focus states
- Modify the [`availableIconsIndex` map in `@grafana/data`](https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/types/icon.ts#L1) and add the new icon - Modify the [`availableIconsIndex` map in `@grafana/data`](https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/types/icon.ts#L1) and add the new icon
- **Note:** the key must exactly match the icon filename, e.g. if your new icon is `my-icon.svg`, the key must be `my-icon` - **Note:** the key must exactly match the icon filename, e.g. if your new icon is `my-icon.svg`, the key must be `my-icon`

View File

@ -1,6 +1,6 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M4.79998 8.9999C4.79998 8.66853 5.06861 8.3999 5.39998 8.3999H5.99998C6.33135 8.3999 6.59998 8.66853 6.59998 8.9999C6.59998 9.33127 6.33135 9.5999 5.99998 9.5999H5.39998C5.0686 9.5999 4.79998 9.33127 4.79998 8.9999Z" fill="black"/> <path d="M4.79998 8.9999C4.79998 8.66853 5.06861 8.3999 5.39998 8.3999H5.99998C6.33135 8.3999 6.59998 8.66853 6.59998 8.9999C6.59998 9.33127 6.33135 9.5999 5.99998 9.5999H5.39998C5.0686 9.5999 4.79998 9.33127 4.79998 8.9999Z" />
<path d="M7.79998 8.3999C7.46861 8.3999 7.19998 8.66853 7.19998 8.9999C7.19998 9.33127 7.4686 9.5999 7.79998 9.5999H8.39998C8.73135 9.5999 8.99998 9.33127 8.99998 8.9999C8.99998 8.66853 8.73135 8.3999 8.39998 8.3999H7.79998Z" fill="black"/> <path d="M7.79998 8.3999C7.46861 8.3999 7.19998 8.66853 7.19998 8.9999C7.19998 9.33127 7.4686 9.5999 7.79998 9.5999H8.39998C8.73135 9.5999 8.99998 9.33127 8.99998 8.9999C8.99998 8.66853 8.73135 8.3999 8.39998 8.3999H7.79998Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 2H9C8.20435 2 7.44129 2.31607 6.87868 2.87868C6.31607 3.44129 6 4.20435 6 5V6H5C4.20435 6 3.44129 6.31607 2.87868 6.87868C2.31607 7.44129 2 8.20435 2 9V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H15C15.7956 22 16.5587 21.6839 17.1213 21.1213C17.6839 20.5587 18 19.7957 18 19V18H19C19.7957 18 20.5587 17.6839 21.1213 17.1213C21.6839 16.5587 22 15.7956 22 15V5C22 4.20435 21.6839 3.44129 21.1213 2.87868C20.5587 2.31607 19.7957 2 19 2ZM16 19C16 19.2652 15.8946 19.5196 15.7071 19.7071C15.5196 19.8946 15.2652 20 15 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V12H16V19ZM16 10H4V9C4 8.73478 4.10536 8.48043 4.29289 8.29289C4.48043 8.10536 4.73478 8 5 8H15C15.2652 8 15.5196 8.10536 15.7071 8.29289C15.8946 8.48043 16 8.73478 16 9V10ZM20 15C20 15.2652 19.8946 15.5196 19.7071 15.7071C19.5196 15.8946 19.2652 16 19 16H18V9C17.9973 8.65886 17.9364 8.32067 17.82 8H20V15ZM20 6H8V5C8 4.73478 8.10536 4.48043 8.29289 4.29289C8.48043 4.10536 8.73478 4 9 4H19C19.2652 4 19.5196 4.10536 19.7071 4.29289C19.8946 4.48043 20 4.73478 20 5V6Z" fill="black"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M19 2H9C8.20435 2 7.44129 2.31607 6.87868 2.87868C6.31607 3.44129 6 4.20435 6 5V6H5C4.20435 6 3.44129 6.31607 2.87868 6.87868C2.31607 7.44129 2 8.20435 2 9V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H15C15.7956 22 16.5587 21.6839 17.1213 21.1213C17.6839 20.5587 18 19.7957 18 19V18H19C19.7957 18 20.5587 17.6839 21.1213 17.1213C21.6839 16.5587 22 15.7956 22 15V5C22 4.20435 21.6839 3.44129 21.1213 2.87868C20.5587 2.31607 19.7957 2 19 2ZM16 19C16 19.2652 15.8946 19.5196 15.7071 19.7071C15.5196 19.8946 15.2652 20 15 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V12H16V19ZM16 10H4V9C4 8.73478 4.10536 8.48043 4.29289 8.29289C4.48043 8.10536 4.73478 8 5 8H15C15.2652 8 15.5196 8.10536 15.7071 8.29289C15.8946 8.48043 16 8.73478 16 9V10ZM20 15C20 15.2652 19.8946 15.5196 19.7071 15.7071C19.5196 15.8946 19.2652 16 19 16H18V9C17.9973 8.65886 17.9364 8.32067 17.82 8H20V15ZM20 6H8V5C8 4.73478 8.10536 4.48043 8.29289 4.29289C8.48043 4.10536 8.73478 4 9 4H19C19.2652 4 19.5196 4.10536 19.7071 4.29289C19.8946 4.48043 20 4.73478 20 5V6Z" />
<path d="M12.8201 14.986C12.8201 14.986 12.8201 14.986 12.8201 14.9709C12.6083 14.3921 12.224 13.8924 11.7192 13.5393C11.2143 13.1862 10.6133 12.9969 9.99749 12.9969C9.38164 12.9969 8.78066 13.1862 8.27583 13.5393C7.771 13.8924 7.38669 14.3921 7.17489 14.9709C7.17489 14.9709 7.17489 14.9709 7.17489 14.986C6.93836 15.6391 6.93836 16.3547 7.17489 17.0079C7.17489 17.0079 7.17489 17.0079 7.17489 17.0229C7.38669 17.6017 7.771 18.1015 8.27583 18.4545C8.78066 18.8076 9.38164 18.9969 9.99749 18.9969C10.6133 18.9969 11.2143 18.8076 11.7192 18.4545C12.224 18.1015 12.6083 17.6017 12.8201 17.0229C12.8201 17.0229 12.8201 17.0229 12.8201 17.0079C13.0566 16.3547 13.0566 15.6391 12.8201 14.986ZM7.66486 16.5987C7.56062 16.2043 7.56062 15.7895 7.66486 15.3952H8.22397C8.17589 15.7949 8.17589 16.1989 8.22397 16.5987H7.66486ZM7.91135 17.2004H8.33219C8.40274 17.4688 8.50359 17.7282 8.63278 17.9737C8.33799 17.7727 8.09156 17.5085 7.91135 17.2004ZM8.33219 14.7934H7.91135C8.08897 14.4862 8.33225 14.2222 8.62377 14.0201C8.49768 14.266 8.39986 14.5254 8.33219 14.7934ZM9.69088 18.3137C9.32168 18.0425 9.06238 17.6473 8.96043 17.2004H9.69088V18.3137ZM9.69088 16.5987H8.83118C8.77508 16.1995 8.77508 15.7944 8.83118 15.3952H9.69088V16.5987ZM9.69088 14.7934H8.96043C9.06238 14.3465 9.32168 13.9513 9.69088 13.6802V14.7934ZM12.0716 14.7934H11.6508C11.5802 14.5251 11.4794 14.2656 11.3502 14.0201C11.645 14.2212 11.8914 14.4853 12.0716 14.7934ZM10.2921 13.6802C10.6613 13.9513 10.9206 14.3465 11.0225 14.7934H10.2921V13.6802ZM10.2921 18.3137V17.2004H11.0225C10.9206 17.6473 10.6613 18.0425 10.2921 18.3137ZM11.1518 16.5987H10.2921V15.3952H11.1518C11.2079 15.7944 11.2079 16.1995 11.1518 16.5987ZM11.3592 17.9737C11.4884 17.7282 11.5892 17.4688 11.6598 17.2004H12.0806C11.9004 17.5085 11.654 17.7727 11.3592 17.9737ZM12.3181 16.5987H11.759C11.7834 16.399 11.7955 16.1981 11.7951 15.9969C11.7954 15.7958 11.7833 15.5948 11.759 15.3952H12.3181C12.4223 15.7895 12.4223 16.2043 12.3181 16.5987Z" fill="black"/> <path d="M12.8201 14.986C12.8201 14.986 12.8201 14.986 12.8201 14.9709C12.6083 14.3921 12.224 13.8924 11.7192 13.5393C11.2143 13.1862 10.6133 12.9969 9.99749 12.9969C9.38164 12.9969 8.78066 13.1862 8.27583 13.5393C7.771 13.8924 7.38669 14.3921 7.17489 14.9709C7.17489 14.9709 7.17489 14.9709 7.17489 14.986C6.93836 15.6391 6.93836 16.3547 7.17489 17.0079C7.17489 17.0079 7.17489 17.0079 7.17489 17.0229C7.38669 17.6017 7.771 18.1015 8.27583 18.4545C8.78066 18.8076 9.38164 18.9969 9.99749 18.9969C10.6133 18.9969 11.2143 18.8076 11.7192 18.4545C12.224 18.1015 12.6083 17.6017 12.8201 17.0229C12.8201 17.0229 12.8201 17.0229 12.8201 17.0079C13.0566 16.3547 13.0566 15.6391 12.8201 14.986ZM7.66486 16.5987C7.56062 16.2043 7.56062 15.7895 7.66486 15.3952H8.22397C8.17589 15.7949 8.17589 16.1989 8.22397 16.5987H7.66486ZM7.91135 17.2004H8.33219C8.40274 17.4688 8.50359 17.7282 8.63278 17.9737C8.33799 17.7727 8.09156 17.5085 7.91135 17.2004ZM8.33219 14.7934H7.91135C8.08897 14.4862 8.33225 14.2222 8.62377 14.0201C8.49768 14.266 8.39986 14.5254 8.33219 14.7934ZM9.69088 18.3137C9.32168 18.0425 9.06238 17.6473 8.96043 17.2004H9.69088V18.3137ZM9.69088 16.5987H8.83118C8.77508 16.1995 8.77508 15.7944 8.83118 15.3952H9.69088V16.5987ZM9.69088 14.7934H8.96043C9.06238 14.3465 9.32168 13.9513 9.69088 13.6802V14.7934ZM12.0716 14.7934H11.6508C11.5802 14.5251 11.4794 14.2656 11.3502 14.0201C11.645 14.2212 11.8914 14.4853 12.0716 14.7934ZM10.2921 13.6802C10.6613 13.9513 10.9206 14.3465 11.0225 14.7934H10.2921V13.6802ZM10.2921 18.3137V17.2004H11.0225C10.9206 17.6473 10.6613 18.0425 10.2921 18.3137ZM11.1518 16.5987H10.2921V15.3952H11.1518C11.2079 15.7944 11.2079 16.1995 11.1518 16.5987ZM11.3592 17.9737C11.4884 17.7282 11.5892 17.4688 11.6598 17.2004H12.0806C11.9004 17.5085 11.654 17.7727 11.3592 17.9737ZM12.3181 16.5987H11.759C11.7834 16.399 11.7955 16.1981 11.7951 15.9969C11.7954 15.7958 11.7833 15.5948 11.759 15.3952H12.3181C12.4223 15.7895 12.4223 16.2043 12.3181 16.5987Z"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB