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

Make button styles more consistent #9264

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
.alert-danger,
.Toastify__toast--error {
background-color: @eos-bc-red-100;
border-left: 5px solid @eos-bc-red-900;
border-left: 5px solid @eos-bc-red-600;
color: @eos-bc-gray-1000;

&:before {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
.alert-danger,
.Toastify__toast--error {
background-color: $eos-bc-red-100;
border-left: 5px solid $eos-bc-red-900;
border-left: 5px solid $eos-bc-red-600;
color: $eos-bc-gray-1000;

&:before {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.btn-success,
.btn-warning,
.btn-danger {
user-select: auto;

i.fa::before {
// No text-decoration for the icon text, see https://stackoverflow.com/a/19529256/1470607
display: inline-block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.btn-success,
.btn-warning,
.btn-danger {
user-select: auto;

i.fa::before {
// No text-decoration for the icon text, see https://stackoverflow.com/a/19529256/1470607
display: inline-block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,15 @@
}
}

.btn-link {
&,
&:active,
&:focus,
&:disabled,
&.disabled {
&,
&:hover {
color: @link-color;
font-weight: normal;
}
.btn {
background: transparent;

&:not(:disabled):not(.disabled):not(.text-muted):hover {
text-decoration: underline;
}
&.disabled,
&:disabled {
border-color: transparent;
}
}

// TODO: Add :active and :focus states for green etc
// NB! Here and below, these are not nested because they're not used consistently along with .btn
.btn-default {
&,
&:active,
Expand All @@ -116,6 +105,7 @@
}
}

// TODO: Make this obsolete and move it into the search module instead
.btn-default-inverse {
&,
&:active,
Expand Down Expand Up @@ -173,6 +163,24 @@
}
}

.btn-info {
&,
&:active,
&:focus,
&:disabled,
&.disabled {
&,
&:hover {
background: @eos-bc-cerulean-400;
border-color: @eos-bc-cerulean-400;

&:not(:disabled):not(.disabled):not(.text-muted):hover::after {
background: @eos-bc-gray-900;
}
}
}
}

// Warning shouldn't currently be used anywhere, but cover it just in case
.btn-warning,
.btn-danger {
Expand All @@ -187,11 +195,6 @@
border-color: @eos-bc-red-500;
color: @eos-bc-white;

&:not(:disabled):not(.disabled):not(.text-muted):hover {
background: @eos-bc-red-900;
border-color: @eos-bc-red-900;
}

&:not(:disabled):not(.disabled):not(.text-muted):hover::after {
background: @eos-bc-gray-900;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
font-weight: bold;
padding: 8px 16px;
position: relative;
border-style: solid;
border-width: 2px;
border: 2px solid transparent;
filter: none;
transition: none;
text-decoration: none;
Expand Down Expand Up @@ -71,8 +70,15 @@
}
}

// TODO: Add :active and :focus states for green etc
// NB! Here and below, these are not nested because they're not used consistently along with .btn
.btn {
background: transparent;

&.disabled,
&:disabled {
border-color: transparent;
}
}

.btn-default {
&,
&:active,
Expand All @@ -92,6 +98,7 @@
}
}

// TODO: Make this obsolete and move it into the search module instead
.btn-default-inverse {
&,
&:active,
Expand Down Expand Up @@ -157,10 +164,11 @@
&.disabled {
&,
&:hover {
border-color: $eos-bc-cerulean-500;
background: $eos-bc-cerulean-400;
border-color: $eos-bc-cerulean-400;

&:not(:disabled):not(.disabled):not(.text-muted):hover {
color: $white;
&:not(:disabled):not(.disabled):not(.text-muted):hover::after {
background: $eos-bc-gray-900;
}
}
}
Expand All @@ -180,11 +188,6 @@
border-color: $eos-bc-red-500;
color: $eos-bc-white;

&:not(:disabled):not(.disabled):not(.text-muted):hover {
background: $eos-bc-red-900;
border-color: $eos-bc-red-900;
}

&:not(:disabled):not(.disabled):not(.text-muted):hover::after {
background: $eos-bc-gray-900;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,92 @@
.btn {
&, &:hover {
color: @body-color;
background: transparent;

&.disabled,
&:disabled {
border-color: transparent;
}
}
}

// These are grandfathered old styles so we're consistent between Bootstrap 3 and 5
.btn-default {
background-image: linear-gradient(to bottom, #fff 0%, #e6e6e6 100%);
border-color: #ccc;;
color: #5F5F5F;
&, &:hover {
background-image: linear-gradient(to bottom, #fff 0%, #e6e6e6 100%);
border-color: #e6e6e6;
color: #5F5F5F;

&:hover {
border-color: #929292;
}

&, &:disabled, &.disabled {
border-color: #ccc;
}
}
}

.btn-primary,
.btn-success {
background-image: linear-gradient(to bottom, #00da92 0%, #00C081 100%);
border-color: #00C081;
color: #fff;
&, &:hover {
background-image: linear-gradient(to bottom, #00da92 0%, #00C081 100%);
color: #fff;

&:hover {
border-color: #009060;
}

&, &:disabled, &.disabled {
border-color: #00C081;
}
}
}

.btn-warning {
&, &:hover {
background-image: linear-gradient(to bottom, #ffb638 0%, #e59409 100%);
color: #fff;

&:hover {
border-color: #b46c00;
}

&, &:disabled, &.disabled {
color: #fff;
border-color: #e59409;
}
}
}

.btn-warning,
.btn-danger {
// Use the default Bootstrap styles
&, &:hover {
background-image: linear-gradient(to bottom, #f53933 0%, #c81b16 100%);
color: #fff;

&:hover {
border-color: #840703;
}

&, &:disabled, &.disabled {
color: #fff;
border-color: #c81b16;
}
}
}

.btn-info {
&, &:hover {
background-image: linear-gradient(to bottom, #59d4f9 0%, #23bdea 100%);
color: #fff;

&:hover {
border-color: #047fa4;
}

&, &:disabled, &.disabled {
color: #fff;
border-color: #23bdea;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,90 @@
border: 1px solid;
}

.btn {
&.disabled,
&:disabled {
border-color: transparent;
}
}

// These are grandfathered old styles so we're consistent between Bootstrap 3 and 5
.btn-default {
background-image: linear-gradient(to bottom, #fff 0%, #e6e6e6 100%);
color: #5F5F5F;
&, &:hover {
background-image: linear-gradient(to bottom, #fff 0%, #e6e6e6 100%);
border-color: #e6e6e6;
color: #5F5F5F;

&, &:disabled, &.disabled {
border-color: #ccc;
&:hover {
border-color: #929292;
}

&, &:disabled, &.disabled {
border-color: #ccc;
}
}
}

.btn-primary,
.btn-success {
background-image: linear-gradient(to bottom, #00da92 0%, #00C081 100%);
color: #fff;
&, &:hover {
background-image: linear-gradient(to bottom, #00da92 0%, #00C081 100%);
color: #fff;

&:hover {
border-color: #009060;
}

&, &:disabled, &.disabled {
border-color: #00C081;
&, &:disabled, &.disabled {
border-color: #00C081;
}
}
}

.btn-warning {
color: #fff;
background: #f0ad4e;
&, &:hover {
background-image: linear-gradient(to bottom, #ffb638 0%, #e59409 100%);
color: #fff;

&:hover {
border-color: #b46c00;
}

&, &:disabled, &.disabled {
border-color: #eea236;
&, &:disabled, &.disabled {
color: #fff;
border-color: #e59409;
}
}
}

.btn-danger {
color: #fff;
background: #d9534f;
&, &:hover {
background-image: linear-gradient(to bottom, #f53933 0%, #c81b16 100%);
color: #fff;

&, &:disabled, &.disabled {
border-color: #d43f3a;
&:hover {
border-color: #840703;
}

&, &:disabled, &.disabled {
color: #fff;
border-color: #c81b16;
}
}
}

.btn-info {
color: #fff;
background-color: #5bc0de;
border-color: #46b8da;

&:hover{
&, &:hover {
background-image: linear-gradient(to bottom, #59d4f9 0%, #23bdea 100%);
color: #fff;
background-color: #31b0d5;
border-color: #269abc;

&:hover {
border-color: #047fa4;
}

&, &:disabled, &.disabled {
color: #fff;
border-color: #23bdea;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

.label-danger {
color: $white;
background-color: $eos-bc-red-900;
background-color: $eos-bc-red-600;
}
Loading
Loading