-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new color picker component using
coloris.js
library (#1575)
- Loading branch information
Showing
13 changed files
with
251 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tabler/core": patch | ||
--- | ||
|
||
Add new color picker component using `coloris.js` library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% assign id = include.id | default: 'default' %} | ||
{% assign alpha = include.alpha | default: false %} | ||
{% assign format = include.format | default: false %} | ||
|
||
<input type="text" class="form-control d-block{% if include.class %} {{ include.class }}{% endif %}" id="colorpicker-{{ id }}" value="{{ include.value }}" /> | ||
|
||
{% capture_global scripts %} | ||
<script> | ||
// @formatter:off | ||
document.addEventListener("DOMContentLoaded", function () { | ||
{% if jekyll.environment == 'development' %} | ||
window.tabler_colorpicker = window.tabler_colorpicker || {}; | ||
{% endif %} | ||
|
||
window.Coloris && ({% if jekyll.environment == 'development' %}window.tabler_colorpicker["colorpicker-{{ id }}"] = {% endif %}Coloris({ | ||
el: "#colorpicker-{{ id }}", | ||
selectInput: false, | ||
alpha: {% if alpha %}true{% else %}false{% endif %}, | ||
{% if format %}format: "{{ format }}",{% endif %} | ||
{% if include['swatches-only'] %}swatchesOnly: true,{% endif %} | ||
swatches: [ | ||
"#206bc4", | ||
"#45aaf2", | ||
"#6574cd", | ||
"#a55eea", | ||
"#f66d9b", | ||
"#fa4654", | ||
"#fd9644", | ||
"#f1c40f", | ||
"#7bd235", | ||
"#5eba00", | ||
"#2bcbba", | ||
"#17a2b8", | ||
], | ||
})) | ||
}) | ||
// @formatter:on | ||
</script> | ||
{% endcapture_global %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: Color picker | ||
page-header: Color picker | ||
menu: base.colorpicker | ||
libs: coloris.js | ||
--- | ||
|
||
{% assign colors = "#206bc4,#45aaf2,#6574cd,#a55eea,#f66d9b,#fa4654,#fd9644,#f1c40f,#7bd235,#5eba00,#2bcbba,#17a2b8" | split: "," %} | ||
|
||
<div class="card"> | ||
<div class="card-body"> | ||
<h3 class="card-title">Basic</h3> | ||
<div class="row g-3"> | ||
{% for color in colors %} | ||
<div class="col-2"> | ||
<div>{% include ui/colorpicker.html value=color id=forloop.index format="hex" %}</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.