mirror of
https://github.com/tabler/tabler.git
synced 2026-08-08 12:22:23 +04:00
Refactor colorpicker to use dynamic color values from site.colors
This commit is contained in:
@@ -19,18 +19,9 @@
|
|||||||
{% if format %}format: "{{ format }}",{% endif %}
|
{% if format %}format: "{{ format }}",{% endif %}
|
||||||
{% if include['swatches-only'] %}swatchesOnly: true,{% endif %}
|
{% if include['swatches-only'] %}swatchesOnly: true,{% endif %}
|
||||||
swatches: [
|
swatches: [
|
||||||
"#066fd1",
|
{% for color in site.colors %}
|
||||||
"#45aaf2",
|
"{{ color[1].hex }}",
|
||||||
"#6574cd",
|
{% endfor %}
|
||||||
"#a55eea",
|
|
||||||
"#f66d9b",
|
|
||||||
"#fa4654",
|
|
||||||
"#fd9644",
|
|
||||||
"#f1c40f",
|
|
||||||
"#7bd235",
|
|
||||||
"#5eba00",
|
|
||||||
"#2bcbba",
|
|
||||||
"#17a2b8",
|
|
||||||
],
|
],
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,15 +7,13 @@ layout: default
|
|||||||
permalink: colorpicker.html
|
permalink: colorpicker.html
|
||||||
---
|
---
|
||||||
|
|
||||||
{% assign colors = "#066fd1,#45aaf2,#6574cd,#a55eea,#f66d9b,#fa4654,#fd9644,#f1c40f,#7bd235,#5eba00,#2bcbba,#17a2b8" | split: "," %}
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 class="card-title">Basic</h3>
|
<h3 class="card-title">Basic</h3>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
{% for color in colors %}
|
{% for color in site.colors %}
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<div>{% include "ui/colorpicker.html" value=color id=forloop.index format="hex" %}</div>
|
<div>{% include "ui/colorpicker.html" value=color[1].hex id=forloop.index format="hex" %}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user