diff options
author | silverwind <me@silverwind.io> | 2022-11-21 21:25:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 20:25:26 +0000 |
commit | 2e5ac53bdcbdc796dc4d1597bdf6d717e211bf24 (patch) | |
tree | 7ce8ac430ff01636612fb02e8dbce2f7ac2296fb | |
parent | 2836382f3487ed3f9ebd57b4356b72784fdf97cb (diff) | |
download | gitea-2e5ac53bdcbdc796dc4d1597bdf6d717e211bf24.tar.gz gitea-2e5ac53bdcbdc796dc4d1597bdf6d717e211bf24.zip |
Embed Matrix icon as SVG (#21890)
Embed the SVG icon directly, making further invertion unnecessary
because the icon color can now follow text color.
<img width="240" alt="Screenshot 2022-11-21 at 20 16 32"
src="https://user-images.githubusercontent.com/115237/203142189-89f20de9-c0bd-4d05-92c0-44dadf20d78f.png">
<img width="245" alt="Screenshot 2022-11-21 at 20 16 46"
src="https://user-images.githubusercontent.com/115237/203142191-658239ba-1859-49c6-91ad-10ddf14780d0.png">
-rw-r--r-- | public/img/svg/gitea-matrix.svg | 1 | ||||
-rw-r--r-- | templates/admin/hook_new.tmpl | 2 | ||||
-rw-r--r-- | templates/org/settings/hook_new.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/settings/webhook/base_list.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/settings/webhook/new.tmpl | 2 | ||||
-rw-r--r-- | web_src/less/_base.less | 3 | ||||
-rw-r--r-- | web_src/less/themes/theme-arc-green.less | 4 | ||||
-rw-r--r-- | web_src/svg/gitea-matrix.svg (renamed from public/img/matrix.svg) | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/public/img/svg/gitea-matrix.svg b/public/img/svg/gitea-matrix.svg new file mode 100644 index 0000000000..cc5e08d3c7 --- /dev/null +++ b/public/img/svg/gitea-matrix.svg @@ -0,0 +1 @@ +<svg xml:space="preserve" style="enable-background:new 0 0 520 520" viewBox="0 0 520 520" class="svg gitea-matrix" width="16" height="16" aria-hidden="true"><path d="M13.7 11.9v496.2h35.7V520H0V0h49.4v11.9H13.7zM166.3 169.2v25.1h.7c6.7-9.6 14.8-17 24.2-22.2 9.4-5.3 20.3-7.9 32.5-7.9 11.7 0 22.4 2.3 32.1 6.8 9.7 4.5 17 12.6 22.1 24 5.5-8.1 13-15.3 22.4-21.5 9.4-6.2 20.6-9.3 33.5-9.3 9.8 0 18.9 1.2 27.3 3.6 8.4 2.4 15.5 6.2 21.5 11.5s10.6 12.1 14 20.6c3.3 8.5 5 18.7 5 30.7v124.1h-50.9V249.6c0-6.2-.2-12.1-.7-17.6-.5-5.5-1.8-10.3-3.9-14.3-2.2-4.1-5.3-7.3-9.5-9.7-4.2-2.4-9.9-3.6-17-3.6-7.2 0-13 1.4-17.4 4.1-4.4 2.8-7.9 6.3-10.4 10.8-2.5 4.4-4.2 9.4-5 15.1-.8 5.6-1.3 11.3-1.3 17v103.3h-50.9v-104c0-5.5-.1-10.9-.4-16.3-.2-5.4-1.3-10.3-3.1-14.9-1.8-4.5-4.8-8.2-9-10.9-4.2-2.7-10.3-4.1-18.5-4.1-2.4 0-5.6.5-9.5 1.6-3.9 1.1-7.8 3.1-11.5 6.1-3.7 3-6.9 7.3-9.5 12.9-2.6 5.6-3.9 13-3.9 22.1v107.6h-50.9V169.2h48zM506.3 508.1V11.9h-35.7V0H520v520h-49.4v-11.9h35.7z"/></svg>
\ No newline at end of file diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl index c5196fce4e..407eae9646 100644 --- a/templates/admin/hook_new.tmpl +++ b/templates/admin/hook_new.tmpl @@ -31,7 +31,7 @@ {{else if eq .HookType "feishu"}} <img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png"> {{else if eq .HookType "matrix"}} - <img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg"> + {{svg "gitea-matrix" 26}} {{else if eq .HookType "wechatwork"}} <img width="26" height="26" src="{{AssetUrlPrefix}}/img/wechatwork.png"> {{else if eq .HookType "packagist"}} diff --git a/templates/org/settings/hook_new.tmpl b/templates/org/settings/hook_new.tmpl index 7308cafa20..081f5a2839 100644 --- a/templates/org/settings/hook_new.tmpl +++ b/templates/org/settings/hook_new.tmpl @@ -26,7 +26,7 @@ {{else if eq .HookType "feishu"}} <img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png"> {{else if eq .HookType "matrix"}} - <img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg"> + {{svg "gitea-matrix" 26}} {{else if eq .HookType "wechatwork"}} <img width="26" height="26" src="{{AssetUrlPrefix}}/img/wechatwork.png"> {{else if eq .HookType "packagist"}} diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index fa68e12ce9..f96c48d4cd 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -29,7 +29,7 @@ <img width="20" height="20" src="{{AssetUrlPrefix}}/img/feishu.png">{{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} </a> <a class="item" href="{{.BaseLinkNew}}/matrix/new"> - <img width="20" height="20" src="{{AssetUrlPrefix}}/img/matrix.svg">{{.locale.Tr "repo.settings.web_hook_name_matrix"}} + {{svg "gitea-matrix" 20 "img"}}{{.locale.Tr "repo.settings.web_hook_name_matrix"}} </a> <a class="item" href="{{.BaseLinkNew}}/wechatwork/new"> <img width="20" height="20" src="{{AssetUrlPrefix}}/img/wechatwork.png">{{.locale.Tr "repo.settings.web_hook_name_wechatwork"}} diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl index ea5a3eca3c..2722e099be 100644 --- a/templates/repo/settings/webhook/new.tmpl +++ b/templates/repo/settings/webhook/new.tmpl @@ -24,7 +24,7 @@ {{else if eq .HookType "feishu"}} <img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png"> {{else if eq .HookType "matrix"}} - <img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg"> + {{svg "gitea-matrix" 26}} {{else if eq .HookType "wechatwork"}} <img width="26" height="26" src="{{AssetUrlPrefix}}/img/wechatwork.png"> {{else if eq .HookType "packagist"}} diff --git a/web_src/less/_base.less b/web_src/less/_base.less index f2173d6d2b..e49721f7e0 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -784,6 +784,9 @@ a.commit-statuses-trigger { margin-top: -.25rem; margin-bottom: -.25rem; } +.ui.dropdown .menu > .item > svg.img { + margin-right: .78571429rem; +} .ui.selection.dropdown .menu > .item { border-color: var(--color-secondary); diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index b793f99509..fab1b9c3b4 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -182,7 +182,3 @@ .emoji[aria-label="musical notes"] { filter: invert(100%) hue-rotate(180deg); } - -img[src$="/img/matrix.svg"] { - filter: invert(80%); -} diff --git a/public/img/matrix.svg b/web_src/svg/gitea-matrix.svg index 9a255fd758..63b23fc671 100644 --- a/public/img/matrix.svg +++ b/web_src/svg/gitea-matrix.svg @@ -11,4 +11,4 @@ c-4.2-2.7-10.3-4.1-18.5-4.1c-2.4,0-5.6,0.5-9.5,1.6c-3.9,1.1-7.8,3.1-11.5,6.1c-3.7,3-6.9,7.3-9.5,12.9c-2.6,5.6-3.9,13-3.9,22.1 v107.6h-50.9V169.2H166.3z"/> <path d="M506.3,508.1V11.9h-35.7V0H520v520h-49.4v-11.9H506.3z"/> -</svg> +</svg>
\ No newline at end of file |