Skip to content

Commit c571911

Browse files
authored
logos: optimise SVG images (#2139)
The main motivation for this change was unnecessary double point in the icon path. The top point of the right corner of the icon are in fact two separate points. I’ve used Inkscape’s ‘Join selected nodes’ function to merge them. I’ve then rounded coordinates in the path to two decimal points (again using Inkscape) and finally using a simple regex eliminate unnecessary spaces in the `d` attribute. Working on that I've noticed that the clip paths don’t actually do anything: the paths do not go over the clip paths. I’ve thus removed the clip paths. The styles for the path were over-specified. `fill-opacity: 1`, `fill-rule: nonzero` and `stroke: none` are all initial values of the properties, so I’ve stripped them out. Finally, in the Logo images, the `width` attribute was specified without a unit. To match the `height` and the Icon images, I’ve added `pt` unit. Cc: @jasonlong
2 parents 954ea90 + 4c00c41 commit c571911

30 files changed

+388
-14
lines changed

content/community/logos.html

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,30 @@
99
- /downloads/logos.html
1010
---
1111

12+
<style>
13+
.light-theme-logo { background: var(--light-theme-logo-bg, none) }
14+
.dark-theme-logo { background: var(--dark-theme-logo-bg, none) }
15+
16+
@media screen and (prefers-color-scheme: light) {
17+
:root { --dark-theme-logo-bg: #333; }
18+
}
19+
@media screen and (prefers-color-scheme: dark) {
20+
:root { --light-theme-logo-bg: #fcfcfa; }
21+
}
22+
:root[data-theme="light"] { --light-theme-logo-bg: none; --dark-theme-logo-bg: #333 }
23+
:root[data-theme="dark"] { --light-theme-logo-bg: #fcfcfa; --dark-theme-logo-bg: none }
24+
</style>
25+
1226
<div id="main">
1327
<h1>Logos</h1>
1428
<div class="two-column">
1529
<div class="column-left">
1630
<ul class="content-list">
1731
<li>
18-
<img src="{{< relurl "images/logos/2color-lightbg@2x.png" >}}" width="294" height="100">
32+
<svg width="294" height="100" viewBox="-10 -10 239 112" class="light-theme-logo">
33+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#f03c2e"/>
34+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#text" fill="#362701"/>
35+
</svg>
1936
<h4>Full color Git logo for light backgrounds</h4>
2037
<p class="description">
2138
<a href="{{< relurl "images/logos/downloads/Git-Logo-2Color.png" >}}">PNG (bitmap)</a>
@@ -26,7 +43,10 @@ <h4>Full color Git logo for light backgrounds</h4>
2643
</p>
2744
</li>
2845
<li>
29-
<img src="{{< relurl "images/logos/1color-orange-lightbg@2x.png" >}}" width="294" height="100">
46+
<svg width="294" height="100" viewBox="-10 -10 239 112" class="light-theme-logo">
47+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#f03c2e"/>
48+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#text" fill="#f03c2e"/>
49+
</svg>
3050
<h4>Orange Git logo for light backgrounds</h4>
3151
<p class="description">
3252
<a href="{{< relurl "images/logos/downloads/Git-Logo-1788C.png" >}}">PNG (bitmap)</a>
@@ -37,7 +57,10 @@ <h4>Orange Git logo for light backgrounds</h4>
3757
</p>
3858
</li>
3959
<li>
40-
<img src="{{< relurl "images/logos/1color-lightbg@2x.png" >}}" width="294" height="100">
60+
<svg width="294" height="100" viewBox="-10 -10 239 112" class="light-theme-logo">
61+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#100f0d"/>
62+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#text" fill="#100f0d"/>
63+
</svg>
4164
<h4>One color Git logo for light backgrounds</h4>
4265
<p class="description">
4366
<a href="{{< relurl "images/logos/downloads/Git-Logo-Black.png" >}}">PNG (bitmap)</a>
@@ -48,7 +71,10 @@ <h4>One color Git logo for light backgrounds</h4>
4871
</p>
4972
</li>
5073
<li>
51-
<img src="{{< relurl "images/logos/1color-darkbg@2x.png" >}}" width="294" height="100">
74+
<svg width="294" height="100" viewBox="-10 -10 239 112" class="dark-theme-logo">
75+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#fff"/>
76+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#text" fill="#fff"/>
77+
</svg>
5278
<h4>One color Git logo for dark backgrounds</h4>
5379
<p class="description">
5480
<a href="{{< relurl "images/logos/downloads/Git-Logo-White.png" >}}">PNG (bitmap)</a>
@@ -63,7 +89,9 @@ <h4>One color Git logo for dark backgrounds</h4>
6389
<div class="column-right">
6490
<ul class="content-list">
6591
<li>
66-
<img src="{{< relurl "images/logos/logomark-orange@2x.png" >}}" width="100" height="100">
92+
<svg width="294" height="100" viewBox="-10 -10 112 112" class="light-theme-logo">>
93+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#f03c2e"/>
94+
</svg>
6795
<h4>Orange logomark for light backgrounds</h4>
6896
<p class="description">
6997
<a href="{{< relurl "images/logos/downloads/Git-Icon-1788C.png" >}}">PNG (bitmap)</a>
@@ -74,7 +102,9 @@ <h4>Orange logomark for light backgrounds</h4>
74102
</p>
75103
</li>
76104
<li>
77-
<img src="{{< relurl "images/logos/logomark-black@2x.png" >}}" width="100" height="100">
105+
<svg width="294" height="100" viewBox="-10 -10 112 112" class="light-theme-logo">>
106+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#100f0d"/>
107+
</svg>
78108
<h4>Black logomark for light backgrounds</h4>
79109
<p class="description">
80110
<a href="{{< relurl "images/logos/downloads/Git-Icon-Black.png" >}}">PNG (bitmap)</a>
@@ -85,7 +115,9 @@ <h4>Black logomark for light backgrounds</h4>
85115
</p>
86116
</li>
87117
<li>
88-
<img src="{{< relurl "images/logos/logomark-white@2x.png" >}}" width="100" height="100">
118+
<svg width="294" height="100" viewBox="-10 -10 112 112" class="dark-theme-logo">
119+
<use href="{{< relurl "images/logos/downloads/Git-Logo-Black.svg" >}}#icon" fill="#fff"/>
120+
</svg>
89121
<h4>White logomark for dark backgrounds</h4>
90122
<p class="description">
91123
<a href="{{< relurl "images/logos/downloads/Git-Icon-White.png" >}}">PNG (bitmap)</a>

0 commit comments

Comments
 (0)