1
0
mirror of https://github.com/tabler/tabler.git synced 2026-08-10 21:32:22 +04:00

button color fixes

This commit is contained in:
codecalm
2022-10-18 22:42:29 +02:00
parent 1c813dba18
commit f180e0417d
14 changed files with 32 additions and 27 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ Add the `.btn-icon` class to remove unnecessary padding from your button and use
{% include ui/button.html icon="star" color="warning" icon-only=true %} {% include ui/button.html icon="star" color="warning" icon-only=true %}
{% include ui/button.html icon="trash" color="danger" icon-only=true %} {% include ui/button.html icon="trash" color="danger" icon-only=true %}
{% include ui/button.html icon="chart-bar" color="purple" icon-only=true %} {% include ui/button.html icon="chart-bar" color="purple" icon-only=true %}
{% include ui/button.html icon="git-merge" color="white" icon-only=true %} {% include ui/button.html icon="git-merge" icon-only=true %}
{% endcapture %} {% endcapture %}
{% include example.html code=code wrapper="btn-list" centered=true %} {% include example.html code=code wrapper="btn-list" centered=true %}
+1 -1
View File
@@ -116,7 +116,7 @@ Make your dropdown suit the dark mode of your website or software.
Use a dropdown with card content to make it easy for users to get more information on a given subject and avoid ovewhelming them with too much content at once. Use a dropdown with card content to make it easy for users to get more information on a given subject and avoid ovewhelming them with too much content at once.
{% capture code %} {% capture code %}
{% include ui/button.html color="white" text="Button" %} {% include ui/button.html text="Button" %}
<div class="dropdown{% hide %} show{% endhide %}"> <div class="dropdown{% hide %} show{% endhide %}">
<a href="#" class="btn btn-primary dropdown-toggle">Dropdown</a> <a href="#" class="btn btn-primary dropdown-toggle">Dropdown</a>
<div class="dropdown-menu dropdown-menu-card{% hide %} show position-static{% endhide %}" style="max-width: 20rem;"> <div class="dropdown-menu dropdown-menu-card{% hide %} show position-static{% endhide %}" style="max-width: 20rem;">
+1 -1
View File
@@ -69,7 +69,7 @@ Use buttons with spinners to notify users that an action they have taken by clic
{% include ui/button.html spinner=true text="Button" color="danger" %} {% include ui/button.html spinner=true text="Button" color="danger" %}
{% include ui/button.html spinner=true text="Button" color="warning" %} {% include ui/button.html spinner=true text="Button" color="warning" %}
{% include ui/button.html spinner=true text="Button" color="success" %} {% include ui/button.html spinner=true text="Button" color="success" %}
{% include ui/button.html spinner=true text="Button" color="white" %} {% include ui/button.html spinner=true text="Button" %}
{% endcapture %} {% endcapture %}
{% include example.html code=code %} {% include example.html code=code %}
@@ -2,7 +2,7 @@
<div class="card-header"> <div class="card-header">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" placeholder="Message"> <input type="text" class="form-control" placeholder="Message">
{% include ui/button.html icon="camera" icon-only=true color="white" %} {% include ui/button.html icon="camera" icon-only=true %}
</div> </div>
</div> </div>
<ul class="list-group card-list-group"> <ul class="list-group card-list-group">
+2 -2
View File
@@ -9,8 +9,8 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col">{% include ui/button.html color="white" block=true icon="brand-github" icon-color="github" text="Login with Github" %}</div> <div class="col">{% include ui/button.html block=true icon="brand-github" icon-color="github" text="Login with Github" %}</div>
<div class="col">{% include ui/button.html color="white" block=true icon="brand-twitter" icon-color="twitter" text="Login with Twitter" %}</div> <div class="col">{% include ui/button.html block=true icon="brand-twitter" icon-color="twitter" text="Login with Twitter" %}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -43,7 +43,7 @@
<div class="btn-group w-100"> <div class="btn-group w-100">
{% assign icons = "bold,italic,underline,copy,scissors,file-plus,file-minus" | split: ',' %} {% assign icons = "bold,italic,underline,copy,scissors,file-plus,file-minus" | split: ',' %}
{% for icon in icons %} {% for icon in icons %}
{% include ui/button.html color="white" icon=icon icon-only=true %} {% include ui/button.html icon=icon icon-only=true %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
@@ -23,10 +23,10 @@
<label class="form-label">Form buttons</label> <label class="form-label">Form buttons</label>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
{% include ui/button.html color="white" block=true icon="brand-github" icon-color="github" text="Login with Github" %} {% include ui/button.html block=true icon="brand-github" icon-color="github" text="Login with Github" %}
</div> </div>
<div class="col"> <div class="col">
{% include ui/button.html color="white" block=true icon="brand-twitter" icon-color="twitter" text="Login with Twitter" %} {% include ui/button.html block=true icon="brand-twitter" icon-color="twitter" text="Login with Twitter" %}
</div> </div>
</div> </div>
</div> </div>
@@ -3,7 +3,7 @@
{% if page.layout-navbar-overlap and page.layout-navbar-dark %} {% if page.layout-navbar-overlap and page.layout-navbar-dark %}
{% include ui/button.html text="New view" color="dark" %} {% include ui/button.html text="New view" color="dark" %}
{% else %} {% else %}
{% include ui/button.html text="New view" color="white" %} {% include ui/button.html text="New view" %}
{% endif %} {% endif %}
</span> </span>
{% include ui/button.html icon="plus" text="Create new report" color="primary" class="d-none d-sm-inline-block" modal-id="report" %} {% include ui/button.html icon="plus" text="Create new report" color="primary" class="d-none d-sm-inline-block" modal-id="report" %}
@@ -5,7 +5,7 @@
<input type="text" class="form-control" placeholder="Search for…"> <input type="text" class="form-control" placeholder="Search for…">
</div> </div>
<div class="col-auto"> <div class="col-auto">
{% include ui/button.html icon="search" icon-only=true color="white" %} {% include ui/button.html icon="search" icon-only=true %}
</div> </div>
</div> </div>
</div> </div>
+6 -3
View File
@@ -270,6 +270,7 @@ $dark-mode-darken: darken($dark, 2%) !default;
$dark-mode-lighten: lighten($dark, 2%) !default; $dark-mode-lighten: lighten($dark, 2%) !default;
$dark-mode-border-color: lighten($dark, 4%) !default; $dark-mode-border-color: lighten($dark, 4%) !default;
$dark-mode-border-color-light: lighten($dark, 4%) !default; $dark-mode-border-color-light: lighten($dark, 4%) !default;
$dark-mode-border-color-active: lighten($dark, 12%) !default;
$dark-mode-text: $light; $dark-mode-text: $light;
// Borders // Borders
@@ -461,6 +462,7 @@ $input-color: inherit !default;
$input-focus-color: inherit !default; $input-focus-color: inherit !default;
// Buttons // Buttons
$btn-disabled-opacity: .4 !default;
$btn-padding-x: 1rem !default; $btn-padding-x: 1rem !default;
$btn-font-weight: var(--#{$prefix}font-weight-medium) !default; $btn-font-weight: var(--#{$prefix}font-weight-medium) !default;
$btn-border-radius: var(--#{$prefix}border-radius) !default; $btn-border-radius: var(--#{$prefix}border-radius) !default;
@@ -557,8 +559,9 @@ $modal-backdrop-blur: 4px !default;
$modal-fade-transform: translate(0, -1rem) !default; $modal-fade-transform: translate(0, -1rem) !default;
$modal-content-border-color: transparent !default; $modal-content-border-color: transparent !default;
$modal-content-bg: $gray-50 !default; $modal-content-bg: var(--#{$prefix}bg-surface) !default;
$modal-content-border-radius: var(--#{$prefix}border-radius) !default; $modal-content-border-radius: var(--#{$prefix}border-radius-lg) !default;
$modal-content-inner-border-radius: subtract(var(--#{$prefix}modal-border-radius), 1px) !default;
$modal-header-padding: 1.5rem !default; $modal-header-padding: 1.5rem !default;
$modal-header-height: 3.5rem !default; $modal-header-height: 3.5rem !default;
@@ -789,7 +792,7 @@ $payment-sizes: $avatar-sizes !default;
// Offcanvas // Offcanvas
$offcanvas-bg-color: var(--#{$prefix}bg-surface) !default; $offcanvas-bg-color: var(--#{$prefix}bg-surface) !default;
$offcanvas-border-color: var(--#{$prefix}border-color-translucent) !default; $offcanvas-border-color: var(--#{$prefix}border-color) !default;
// Placeholder // Placeholder
$placeholder-opacity-min: .1 !default; $placeholder-opacity-min: .1 !default;
+1 -6
View File
@@ -33,6 +33,7 @@ body:not(.theme-dark) .hide-theme-light {
--#{$prefix}border-color: #{$dark-mode-border-color}; --#{$prefix}border-color: #{$dark-mode-border-color};
--#{$prefix}border-color-light: #{$dark-mode-border-color-light}; --#{$prefix}border-color-light: #{$dark-mode-border-color-light};
--#{$prefix}border-color-active: #{$dark-mode-border-color-active};
--#{$prefix}btn-color: #{$dark-mode-darken}; --#{$prefix}btn-color: #{$dark-mode-darken};
@@ -87,12 +88,6 @@ body:not(.theme-dark) .hide-theme-light {
color: inherit; color: inherit;
} }
.btn-white,
.form-file-button {
//@include button-variant($dark-mode-lighten, $border-color, $dark-mode-text, rgba($dark, 0), $border-color, $dark-mode-text);
background-image: none;
}
.form-check-input:not(:checked), .form-check-input:not(:checked),
.form-select, .form-select,
.form-file-text, .form-file-text,
+1
View File
@@ -17,6 +17,7 @@
--#{$prefix}border-color: #{$border-color}; --#{$prefix}border-color: #{$border-color};
--#{$prefix}border-color-light: #{$border-color-light}; --#{$prefix}border-color-light: #{$border-color-light};
--#{$prefix}border-color-active: #{$border-color-active};
--#{$prefix}icon-color: #{$icon-color}; --#{$prefix}icon-color: #{$icon-color};
+1
View File
@@ -86,6 +86,7 @@
$active-color: color-contrast($active-background) $active-color: color-contrast($active-background)
) { ) {
--#{$prefix}btn-color: #{$color}; --#{$prefix}btn-color: #{$color};
--#{$prefix}btn-bg: transparent;
--#{$prefix}btn-border-color: transparent; --#{$prefix}btn-border-color: transparent;
--#{$prefix}btn-hover-color: #{$color-hover}; --#{$prefix}btn-hover-color: #{$color-hover};
--#{$prefix}btn-hover-bg: #{$active-background}; --#{$prefix}btn-hover-bg: #{$active-background};
+12 -7
View File
@@ -3,8 +3,11 @@
// //
.btn { .btn {
--#{$prefix}btn-icon-size: #{$icon-size}; --#{$prefix}btn-icon-size: #{$icon-size};
--#{$prefix}btn-bg: var(--#{$prefix}bg-surface);
--#{$prefix}btn-color: var(--#{$prefix}body-color); --#{$prefix}btn-color: var(--#{$prefix}body-color);
--#{$prefix}btn-border-color: var(--#{$prefix}border-color); --#{$prefix}btn-border-color: var(--#{$prefix}border-color);
--#{$prefix}btn-hover-bg: var(--#{$prefix}bg-surface);
--#{$prefix}btn-hover-border-color: var(--#{$prefix}border-color-active);
--#{$prefix}btn-box-shadow: var(--#{$prefix}shadow-button); --#{$prefix}btn-box-shadow: var(--#{$prefix}shadow-button);
display: inline-flex; display: inline-flex;
@@ -56,11 +59,6 @@
// //
// Button color variations // Button color variations
// //
.btn-white {
--#{$prefix}btn-bg: var(--#{$prefix}card-bg, var(--#{$prefix}bg-surface));
--#{$prefix}btn-hover-bg: var(--#{$prefix}card-bg-hover, var(--#{$prefix}bg-surface));
}
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
.btn-#{$color} { .btn-#{$color} {
--#{$prefix}btn-border-color: transparent; --#{$prefix}btn-border-color: transparent;
@@ -72,15 +70,22 @@
--#{$prefix}btn-active-border-color: transparent; --#{$prefix}btn-active-border-color: transparent;
--#{$prefix}btn-active-color: var(--#{$prefix}#{$color}-fg); --#{$prefix}btn-active-color: var(--#{$prefix}#{$color}-fg);
--#{$prefix}btn-active-bg: rgba(var(--#{$prefix}#{$color}-rgb), .8); --#{$prefix}btn-active-bg: rgba(var(--#{$prefix}#{$color}-rgb), .8);
--#{$prefix}btn-disabled-bg: rgba(var(--#{$prefix}#{$color}-rgb), .5); --#{$prefix}btn-disabled-bg: var(--#{$prefix}#{$color});
--#{$prefix}btn-disabled-color: var(--#{$prefix}#{$color}-fg); --#{$prefix}btn-disabled-color: var(--#{$prefix}#{$color}-fg);
--#{$prefix}btn-box-shadow: var(--#{$prefix}shadow-button), var(--#{$prefix}shadow-button-inset); --#{$prefix}btn-box-shadow: var(--#{$prefix}shadow-button), var(--#{$prefix}shadow-button-inset);
} }
.btn-outline-#{$color} { .btn-outline-#{$color} {
--#{$prefix}btn-color: var(--#{$prefix}#{$color}); --#{$prefix}btn-color: var(--#{$prefix}#{$color});
--#{$prefix}btn-bg: transparent;
--#{$prefix}btn-border-color: var(--#{$prefix}#{$color}); --#{$prefix}btn-border-color: var(--#{$prefix}#{$color});
--#{$prefix}btn-active-color: var(--#{$prefix}#{$color}); --#{$prefix}btn-hover-color: var(--#{$prefix}#{$color}-fg);
--#{$prefix}btn-hover-border-color: transparent;
--#{$prefix}btn-hover-bg: var(--#{$prefix}#{$color});
--#{$prefix}btn-active-color: var(--#{$prefix}#{$color}-fg);
--#{$prefix}btn-active-bg: var(--#{$prefix}#{$color});
--#{$prefix}btn-disabled-color: var(--#{$prefix}#{$color});
--#{$prefix}btn-disabled-border-color: var(--#{$prefix}#{$color});
} }
} }