Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Color - CSS Improvement - Fixes #3789 #3812

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fieldset[disabled] .file-name, fieldset[disabled] .select select, .select fields
.control,
.input,
.textarea,
.select select {
.select {
--bulma-input-h: var(--bulma-scheme-h);
--bulma-input-s: var(--bulma-scheme-s);
--bulma-input-l: var(--bulma-scheme-main-l);
Expand Down Expand Up @@ -1182,6 +1182,7 @@ fieldset[disabled] .file-name, fieldset[disabled] .select select, .select fields
font-size: var(--bulma-size-large);
}

/* Bulma Form */
/* Bulma Base */
/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */
html,
Expand Down
23 changes: 23 additions & 0 deletions docs/assets/css/website.css
Original file line number Diff line number Diff line change
Expand Up @@ -9341,6 +9341,29 @@ button.tag:active,
.select select[disabled]:-ms-input-placeholder, [disabled].input:-ms-input-placeholder, [disabled].textarea:-ms-input-placeholder, fieldset[disabled] .select select:-ms-input-placeholder, .select fieldset[disabled] select:-ms-input-placeholder, fieldset[disabled] .input:-ms-input-placeholder, fieldset[disabled] .textarea:-ms-input-placeholder {
color: var(--bulma-input-disabled-placeholder-color);
}
.select select[type=color], [type=color].input, [type=color].textarea {
-webkit-appearance: none !important;
-moz-appearance: none !important;
appearance: none !important;
background: none !important;
}
.select select[type=color], [type=color].input, [type=color].textarea {
width: var(--bulma-control-height);
min-width: var(--bulma-control-height);
max-width: var(--bulma-control-height);
margin: 0 !important;
padding: 0 !important;
overflow: hidden;
}
.select select[type=color]::-webkit-color-swatch-wrapper, [type=color].input::-webkit-color-swatch-wrapper, [type=color].textarea::-webkit-color-swatch-wrapper {
margin: 0 !important;
padding: 0 !important;
}
.select select[type=color]::-webkit-color-swatch, [type=color].input::-webkit-color-swatch, [type=color].textarea::-webkit-color-swatch {
margin: 0 !important;
padding: 0 !important;
border: none;
}

/* Bulma Form */
.textarea, .input {
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/css/website.min.css

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs/documentation/form/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
{% capture input_example %}
<input class="input" type="text" placeholder="Text input" />
{% endcapture %}
{% capture input_color_example %}
<input class="input" type="color" value="#f5f5f5" />
{% endcapture %}
{% capture rounded_example %}
<input class="input is-rounded" type="text" placeholder="Rounded input" />
{% endcapture %}
Expand Down Expand Up @@ -211,6 +214,7 @@
<li><code>type="password"</code></li>
<li><code>type="email"</code></li>
<li><code>type="tel"</code></li>
<li><code>type="color"</code></li>
</ul>
<p>Several <strong>modifiers</strong> are supported which affect:</p>
<ul>
Expand Down Expand Up @@ -372,6 +376,17 @@ <h4 class="title is-5">Readonly and static inputs</h4>
{{- static_example -}}
{%- endhighlight %}

{% include docs/elements/anchor.html name="Colorpicker" %}

<div class="columns">
<div class="column">{{ input_color_example }}</div>
<div class="column is-half">
{% highlight html -%}
{{- input_color_example -}}
{%- endhighlight %}
</div>
</div>

<!-- Font Awesome Icons -->
{% include docs/elements/anchor.html name="With Font Awesome icons" %}

Expand Down
27 changes: 27 additions & 0 deletions sass/form/shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,31 @@ $input-radius: cv.getVar("radius") !default;

%input {
@include input;

&[type=color] {
-webkit-appearance: none !important;
-moz-appearance: none !important;
appearance: none !important;
background: none !important;
}

&[type="color"] {
width: var(--bulma-control-height);
min-width: var(--bulma-control-height);
max-width: var(--bulma-control-height);
margin: 0 !important;
padding: 0 !important;
overflow: hidden;
}

&[type="color"]::-webkit-color-swatch-wrapper {
margin: 0 !important;
padding: 0 !important;
}

&[type="color"]::-webkit-color-swatch {
margin: 0 !important;
padding: 0 !important;
border: none;
}
}