1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

Use a CSS sprite for the license images.

-3 HTTP requests.
This commit is contained in:
XhmikosR 2013-12-15 09:21:24 +02:00
parent 84f6e89264
commit 22eae2af38
9 changed files with 29 additions and 22 deletions

View File

@ -36,7 +36,10 @@
{% for rule_obj in rules %}
{% assign req = rule_obj.tag %}
{% if variation[type] contains req %}
<li class="{{ req }}">{{ rule_obj.label }}</li>
<li class="{{ req }}">
<span class="license-sprite"></span>
{{ rule_obj.label }}
</li>
{% endif %}
{% endfor %}
</ul>

View File

@ -14,7 +14,10 @@
</div>
{% if page.source %}
<div class="source">
<a href="{{ page.source }}">Source</a>
<a href="{{ page.source }}">
<span class="license-sprite"></span>
Source
</a>
</div>
{% endif %}
@ -28,7 +31,10 @@
{% for rule_obj in rules %}
{% assign req = rule_obj.tag %}
{% if page[type] contains req %}
<li class="{{ req }}">{{ rule_obj.label }}</li>
<li class="{{ req }}">
<span class="license-sprite"></span>
{{ rule_obj.label }}
</li>
{% endif %}
{% endfor %}
</ul>

View File

@ -263,30 +263,26 @@ strong {
.license-rules .label {
font-weight: bold;
}
.license-rules li {
background-position: 0 1px;
background-repeat: no-repeat;
background-size: 12px 12px;
margin-right: 15px;
margin-bottom: 5px;
padding-left: 16px;
}
.license-rules li:hover {
color: #443a33;
}
.license-required li {
background-image: url(../img/blue-dot@2x.png);
.license-sprite {
background-image: url(../img/license-sprite.png);
background-repeat: no-repeat;
display: inline-block;
}
.license-permitted li {
background-image: url(../img/green-dot@2x.png);
}
.license-forbidden li {
background-image: url(../img/red-dot@2x.png);
}
.sidebar .source span { background-position: 0 0; width: 16px; height: 12px; }
.license-forbidden span { background-position: -16px 0; width: 12px; height: 12px; }
.license-permitted span { background-position: -28px 0; width: 12px; height: 12px; }
.license-required span { background-position: -40px 0; width: 12px; height: 12px; }
.license-rules-sidebar li {
float: none;
@ -346,12 +342,6 @@ strong {
margin-bottom: 30px;
}
.sidebar .source a {
padding-left: 20px;
background: transparent url(../img/source@2x.png) 0 1px no-repeat;
background-size: 16px 12px;
}
.sidebar .boilerplate {
font: 0.7em "Courier new", courier;
}
@ -493,4 +483,12 @@ strong {
-moz-background-size: 72px 198px;
background-size: 72px 198px;
}
.license-sprite {
background-image: url(../img/license-sprite@2x.png);
-webkit-background-size: 52px 12px;
-moz-background-size: 52px 12px;
background-size: 52px 12px;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

BIN
img/license-sprite.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

BIN
img/license-sprite@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B