Skip to content

Commit b4442b3

Browse files
authored
Merge pull request #1324 from github/desprite
Replace the license property sprite (green/blue/red circles) with individual icons
2 parents 0569c8f + 21454b2 commit b4442b3

File tree

8 files changed

+49
-39
lines changed

8 files changed

+49
-39
lines changed

_includes/css/responsive.css

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,25 +146,17 @@
146146
font-size: 10px;
147147
}
148148
.license-rules:not(.license-rules-sidebar) li {
149+
padding-left: 14px;
149150
margin-right: 5px;
150151
font-size: 10px;
151152
-webkit-text-size-adjust: none;
152153
}
153-
.license-rules:not(.license-rules-sidebar) li span {
154-
background-size: 44px;
154+
.license-rules:not(.license-rules-sidebar) .license-marker {
155155
width: 10px;
156-
height: 10px;
156+
font-size: 10px;
157+
left: 0;
157158
top: 1px;
158-
position: relative;
159-
}
160-
.license-rules:not(.license-rules-sidebar) .license-conditions span {
161-
background-position: -34px 0;
162-
}
163-
.license-rules:not(.license-rules-sidebar) .license-permissions span {
164-
background-position: -24px 0px;
165-
}
166-
.license-rules:not(.license-rules-sidebar) .license-limitations span {
167-
background-position: -14px 0;
159+
position: absolute;
168160
}
169161

170162
.hint--large::after{

_includes/license-overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h3 class="license-overview-name">
3333
{% assign req = rule_obj.tag %}
3434
{% if license[type] contains req %}
3535
<li class="{{ req }}">
36-
<span class="license-sprite"></span>
36+
<span class="license-marker">{% if type == "permissions" %}✓{% elsif type == "conditions" %}ⓘ{% else %}✕{% endif %}</span>
3737
{{ rule_obj.label }}
3838
</li>
3939
{% endif %}

_includes/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h4 id="optional-steps">Optional steps</h4>
3838

3939
<div class="source">
4040
<a href="https://spdx.org/licenses/{{ page.spdx-id }}{% if lateronly %}-or-later{% endif %}.html">
41-
<span class="license-sprite"></span>
41+
<span class="source-marker" aria-hidden="true"></span>
4242
Source
4343
</a>
4444
</div>

_layouts/license.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{% assign req = rule_obj.tag %}
3333
{% if page[type] contains req %}
3434
<li class="{{ req }}">
35-
<span class="license-sprite"></span>
35+
<span class="license-marker">{% if type == "permissions" %}✓{% elsif type == "conditions" %}ⓘ{% else %}✕{% endif %}</span>
3636
{{ rule_obj.label }}
3737
</li>
3838
{% endif %}

appendix.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ If you're here to choose a license, **[start from the home page](/)** to see a f
4343
{% if r contains req %}
4444
<td class="license-{{ t }}" style="text-align:center">
4545
{% if r contains "--" %}
46-
{% assign lite = " lite" %}
46+
{% assign lite = "lite" %}
4747
{% else %}
4848
{% assign lite = "" %}
4949
{% endif %}
50-
<span class="{{ r | append: lite }}" style="margin: auto;">
51-
<span class="license-sprite {{ r }}"></span>
50+
<span class="{{ lite }}" style="margin: auto;">
51+
<span class="license-marker {{ r }}">{% if t == "permissions" %}✓{% elsif t == "conditions" %}ⓘ{% else %}✕{% endif %}</span>
5252
</span>
5353
</td>
5454
{% assign seen_req = true %}
@@ -66,11 +66,11 @@ If you're here to choose a license, **[start from the home page](/)** to see a f
6666

6767
## Legend
6868

69-
<p>Open source licenses grant to the public <span class="license-permissions"><span class="license-sprite"></span></span> <b>permissions</b> to do things with licensed works which copyright or other "intellectual property" laws might otherwise disallow.</p>
69+
<p>Open source licenses grant to the public <span class="license-permissions"><span class="license-marker">✓</span></span> <b>permissions</b> to do things with licensed works which copyright or other "intellectual property" laws might otherwise disallow.</p>
7070

71-
<p>Most open source licenses' grants of permissions are subject to compliance with <span class="license-conditions"><span class="license-sprite"></span></span> <b>conditions</b>.</p>
71+
<p>Most open source licenses' grants of permissions are subject to compliance with <span class="license-conditions"><span class="license-marker">ⓘ</span></span> <b>conditions</b>.</p>
7272

73-
<p>Most open source licenses also have <span class="license-limitations"><span class="license-sprite"></span></span> <b>limitations</b> that usually disclaim warranty and liability, and sometimes expressly exclude patents or trademarks from licenses' grants.</p>
73+
<p>Most open source licenses also have <span class="license-limitations"><span class="license-marker">✕</span></span> <b>limitations</b> that usually disclaim warranty and liability, and sometimes expressly exclude patents or trademarks from licenses' grants.</p>
7474

7575
{% for type in types %}
7676
### {% if type == "permissions" %}Permissions{% elsif type == "conditions" %}Conditions{% else %}Limitations{% endif %}
@@ -85,8 +85,8 @@ If you're here to choose a license, **[start from the home page](/)** to see a f
8585
{% else %}
8686
{% assign lite = "" %}
8787
{% endif %}
88-
<span class="{{ req | append: lite }}">
89-
<span class="license-sprite {{ req }}"></span>
88+
<span class="{{ lite | strip }}">
89+
<span class="license-marker {{ req }}">{% if type == "permissions" %}✓{% elsif type == "conditions" %}ⓘ{% else %}✕{% endif %}</span>
9090
</span>
9191
{{ rule_obj.description }}
9292
</dd>

assets/css/application.scss

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ strong {
300300
}
301301

302302
.license-rules li {
303+
position: relative;
304+
padding-left: 18px;
303305
margin-right: 15px;
304306
margin-bottom: 5px;
305307
}
@@ -308,17 +310,39 @@ strong {
308310
color: #444;
309311
}
310312

311-
.license-sprite {
312-
background-image: url(../img/license-sprite.png);
313-
background-repeat: no-repeat;
313+
.source-marker {
314+
display: inline-block;
315+
width: 16px;
316+
text-align: center;
317+
margin-right: 4px;
318+
font-size: 0.875rem;
319+
line-height: 1;
320+
}
321+
322+
.license-marker {
314323
display: inline-block;
324+
width: 12px;
325+
text-align: center;
326+
font-weight: 700;
327+
line-height: 1;
328+
}
329+
330+
.license-rules li .license-marker {
331+
position: absolute;
332+
left: 0;
333+
top: 0.1em;
315334
}
335+
.license-types td .license-marker { display: block; margin: 0 auto; }
336+
.license-types td .license-marker,
337+
.license-types dd .license-marker { font-size: 0.8125rem; }
316338

317-
.sidebar .source span { background-position: 0 0; width: 16px; height: 12px; }
318-
.license-limitations span { background-position: -16px 0; width: 12px; height: 12px; }
319-
.license-permissions span { background-position: -28px 0; width: 12px; height: 12px; }
320-
.license-conditions span { background-position: -40px 0; width: 12px; height: 12px; }
321-
.lite span { opacity: 0.5; }
339+
.license-permissions .license-marker { color: #298625; }
340+
.license-conditions .license-marker { color: #0d648a; }
341+
.license-limitations .license-marker { color: #812a28; }
342+
343+
.license-permissions .lite .license-marker { color: rgba(41, 134, 37, 0.5); }
344+
.license-conditions .lite .license-marker { color: rgba(13, 100, 138, 0.5); }
345+
.license-limitations .lite .license-marker { color: rgba(129, 42, 40, 0.5); }
322346

323347
.license-rules-sidebar li {
324348
float: none;
@@ -492,6 +516,7 @@ strong {
492516
// Selecting all the tooltip bodies to increase their font-size
493517
[class*="hint--"][aria-label]:after {
494518
font-size: 0.80rem;
519+
font-weight: 400;
495520
text-shadow: none;
496521
}
497522

@@ -554,13 +579,6 @@ strong {
554579
background-size: 72px 182px;
555580
}
556581

557-
.license-sprite {
558-
background-image: url(../img/license-sprite@2x.png);
559-
-webkit-background-size: 52px 12px;
560-
-moz-background-size: 52px 12px;
561-
background-size: 52px 12px;
562-
}
563-
564582
}
565583

566584
{% include css/responsive.css %}

assets/img/license-sprite.png

-639 Bytes
Binary file not shown.

assets/img/license-sprite@2x.png

-742 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)