mirror of
https://github.com/tabler/tabler.git
synced 2026-08-02 08:25:32 +04:00
colors table fixes
This commit is contained in:
+7
-46
@@ -3,49 +3,10 @@ title: Colors
|
||||
menu: docs.colors
|
||||
---
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Default colors
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-unstyled">
|
||||
{% for color in site.colors %}
|
||||
<li class="d-flex align-items-center mb-3">
|
||||
<div class="stamp bg-{{ color[0] }} text-white mr-3">{{ color[1].name | first_letters | upcase }}</div>
|
||||
<div>
|
||||
<strong>{{ color[1].name }}</strong><br />
|
||||
<code>.bg-{{ color[0] }}</code>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Light colors
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-unstyled">
|
||||
{% for color in site.colors %}
|
||||
<li class="d-flex align-items-center mb-3">
|
||||
<div class="stamp bg-{{ color[0] }}-lt mr-3">{{ color[1].name | first_letters | upcase }}</div>
|
||||
<div>
|
||||
<strong>{{ color[1].name }} lite</strong><br />
|
||||
<code class="bg-{{ color[0] }}-lt">.bg-{{ color[0] }}-lt</code>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
## Base colors
|
||||
|
||||
{% include example/colors-table.html %}
|
||||
|
||||
## Light colors
|
||||
|
||||
{% include example/colors-table.html light=true %}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{% assign colors = include.colors | default: site.colors %}
|
||||
{% assign light = include.light %}
|
||||
|
||||
<div class="example">
|
||||
<div class="mb-n3">
|
||||
{% for color in colors %}
|
||||
<div class="row row-sm mb-3 align-items-center">
|
||||
<div class="col-auto">
|
||||
<div class="stamp bg-{{ color[0] }}{% if light %}-lt{% else %} text-white{% endif %}">{{ color[0] | capitalize | first_letter }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="font-weight-semibold">{{ color[1].title }}</span><br/>
|
||||
<code>bg-{{ color[0] }}{% if light %}-lt{% endif %}</code>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -84,6 +84,11 @@ module Jekyll
|
||||
|
||||
input.gsub re, repl_str
|
||||
end
|
||||
|
||||
def hex_to_rgb(color)
|
||||
r, g, b = color.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/).captures
|
||||
"rgb(#{r.hex}, #{g.hex}, #{b.hex})"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user