1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-21 12:20:10 +01:00

Merge pull request #1257 from mschoettle/consistent-legend

Show muted colors for conditions in legend
This commit is contained in:
Mike Linksvayer 2024-11-25 13:36:20 -08:00 committed by GitHub
commit c9739749fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

@ -88,7 +88,17 @@ If you're here to choose a license, **[start from the home page](/)** to see a f
{% assign rs = site.data.rules[t] | sort: "label" %}
{% for r in rs %}
{% if r.tag == req %}
<dd class="license-{{t}}"><span class="license-sprite"></span> {{ r.description }}</dd>
{% if r.tag contains "--" %}
{% assign lite = " lite" %}
{% else %}
{% assign lite = "" %}
{% endif %}
<dd class="license-{{t}}">
<span class="{{ r.tag | append: lite }}">
<span class="license-sprite {{ r.tag }}"></span>
</span>
{{ r.description }}
</dd>
{% endif %}
{% endfor %}
{% endfor %}

View File

@ -464,7 +464,7 @@ strong {
/* Hint.css Overide */
.orverride-hint-inline {
.override-hint-inline {
display: block;
}

View File

@ -40,14 +40,15 @@ class Choosealicense
# Dynamically add annotations as title attribute to rule list items
for ruletype, rules of window.annotations
for rule in rules
licenseLiElement = $(".license-#{ruletype} .#{rule["tag"]}")
# Only select license elements in table, not legend
licenseLiElement = $("td.license-#{ruletype} .#{rule["tag"]}")
tooltipAttr = @tooltipAttributesMapperByRuleType[ruletype]
licenseLiElement.attr "aria-label", "#{tooltipAttr.heading}: #{rule.description}"
licenseLiElement.addClass("hint--bottom
hint--large
hint--no-animate
#{tooltipAttr.color}
orverride-hint-inline")
override-hint-inline")
# Initializes Clipboard.js
initClipboard: ->