gitlab-org--gitlab-foss/app/assets/stylesheets/framework/buttons.scss

533 lines
9.0 KiB
SCSS
Raw Normal View History

2017-10-07 04:25:17 +00:00
@mixin btn-comment-icon {
border-radius: 50%;
background: $white;
padding: 1px;
2017-10-07 04:25:17 +00:00
font-size: 12px;
color: $blue-500;
border: 1px solid $blue-500;
width: 24px;
height: 24px;
2017-10-07 04:25:17 +00:00
&:hover,
&.inverted {
background: $blue-500;
border-color: $blue-600;
color: $white;
2017-10-07 04:25:17 +00:00
}
&:active {
outline: 0;
}
}
@mixin btn-default {
border-radius: $border-radius-default;
font-size: $gl-font-size;
font-weight: $gl-font-weight-normal;
padding: $gl-vert-padding $gl-btn-padding;
&:focus,
&:active {
2016-04-01 19:27:39 +00:00
background-color: $btn-active-gray;
box-shadow: none;
}
}
@mixin btn-middle {
@include btn-default;
}
@mixin btn-outline($background, $text, $border, $hover-background, $hover-text, $hover-border, $active-background, $active-border, $active-text) {
2016-05-31 17:14:55 +00:00
background-color: $background;
color: $text;
border-color: $border;
2019-01-29 16:29:21 +00:00
&.btn-border-color {
border-color: $border-color;
}
2017-06-07 13:17:03 +00:00
> .icon {
2017-06-07 10:18:35 +00:00
color: $text;
}
&:hover,
&:focus {
background-color: $hover-background;
border-color: $hover-border;
color: $hover-text;
2017-06-07 10:18:35 +00:00
> .icon {
color: $hover-text;
2017-06-07 10:18:35 +00:00
}
}
&:focus {
box-shadow: 0 0 4px 1px $blue-300;
}
&:active {
background-color: $active-background;
border-color: $active-border;
box-shadow: inset 0 2px 4px 0 rgba($black, 0.2);
color: $active-text;
2017-06-07 10:18:35 +00:00
> .icon {
color: $active-text;
}
&:focus {
box-shadow: inset 0 2px 4px 0 rgba($black, 0.2);
2017-06-07 10:18:35 +00:00
}
2016-05-31 17:14:55 +00:00
}
}
@mixin btn-color($light, $border-light, $normal, $border-normal, $dark, $border-dark, $color) {
background-color: $light;
border-color: $border-light;
color: $color;
&:hover,
&:focus {
background-color: $normal;
border-color: $border-normal;
color: $color;
}
&:active,
&.active {
box-shadow: $gl-btn-active-background;
background-color: $dark;
border-color: $border-dark;
color: $color;
}
}
@mixin btn-green {
@include btn-color($green-500, $green-600, $green-600, $green-700, $green-700, $green-800, $white);
}
@mixin btn-blue {
@include btn-color($blue-500, $blue-600, $blue-600, $blue-700, $blue-700, $blue-800, $white);
2015-12-22 21:33:46 +00:00
}
@mixin btn-orange {
@include btn-color($orange-500, $orange-600, $orange-600, $orange-700, $orange-700, $orange-800, $white);
}
@mixin btn-red {
@include btn-color($red-500, $red-600, $red-600, $red-700, $red-700, $red-800, $white);
}
@mixin btn-white {
@include btn-color($white, $border-color, $white-normal, $border-white-normal, $white-dark, $border-gray-dark, $gl-text-color);
}
@mixin btn-with-margin {
margin-left: $btn-side-margin;
float: left;
&.inline {
float: none;
}
&.btn-sm {
margin-left: $btn-sm-side-margin;
}
}
2017-11-28 19:07:25 +00:00
@mixin btn-svg {
height: $gl-padding;
width: $gl-padding;
top: 0;
vertical-align: text-top;
}
.btn {
@include btn-default;
@include btn-white;
2016-02-20 02:46:18 +00:00
color: $gl-text-color;
white-space: nowrap;
2016-02-20 02:46:18 +00:00
2016-02-22 14:58:04 +00:00
&:focus:active {
outline: 0;
}
&.btn-sm {
padding: 4px 10px;
font-size: $gl-btn-small-font-size;
line-height: $gl-btn-small-line-height;
2015-12-22 20:22:37 +00:00
}
&.btn-xs {
padding: 2px $gl-btn-padding;
font-size: $gl-btn-xs-font-size;
line-height: $gl-btn-xs-line-height;
}
&.btn-success,
&.btn-register {
@include btn-green;
}
&.btn-inverted {
&.btn-success {
@include btn-outline($white, $green-600, $green-500, $green-100, $green-700, $green-500, $green-200, $green-600, $green-800);
}
&.btn-remove,
&.btn-danger {
@include btn-outline($white, $red-500, $red-500, $red-100, $red-700, $red-500, $red-200, $red-600, $red-800);
}
2018-09-03 10:57:41 +00:00
&.btn-warning {
@include btn-outline($white, $orange-500, $orange-500, $orange-100, $orange-700, $orange-500, $orange-200, $orange-600, $orange-800);
2018-09-03 10:57:41 +00:00
}
&.btn-primary,
&.btn-info {
@include btn-outline($white, $blue-500, $blue-500, $blue-100, $blue-700, $blue-500, $blue-200, $blue-600, $blue-800);
}
}
&.btn-info,
&.btn-primary {
@include btn-blue;
}
&.btn-warning {
@include btn-orange;
}
2017-06-07 10:18:35 +00:00
&.btn-close,
&.btn-close-color {
@include btn-outline($white, $orange-600, $orange-500, $orange-100, $orange-700, $orange-500, $orange-200, $orange-600, $orange-800);
2016-05-31 17:14:55 +00:00
}
&.btn-spam {
@include btn-outline($white, $red-500, $red-500, $red-100, $red-700, $red-500, $red-200, $red-600, $red-800);
}
&.btn-danger,
&.btn-remove,
&.btn-red {
@include btn-red;
}
&.btn-cancel {
float: right;
}
2017-06-07 10:18:35 +00:00
&.btn-reopen,
.btn-reopen-color {
/* should be same as parent class for now */
}
&.btn-grouped {
@include btn-with-margin;
}
2018-11-07 11:46:40 +00:00
&.btn-icon {
color: $gl-gray-700;
}
.fa-caret-down,
.fa-chevron-down {
2016-02-20 02:46:18 +00:00
margin-left: 5px;
}
2016-07-14 15:48:01 +00:00
&.dropdown-toggle {
.fa-caret-down {
margin-left: 3px;
}
}
2018-11-08 07:58:45 +00:00
&.btn-text-field {
width: 100%;
text-align: left;
padding: 6px 16px;
border-color: $border-color;
color: $gray-darkest;
background-color: $white;
2018-11-08 07:58:45 +00:00
&:hover,
&:active,
&:focus {
cursor: text;
box-shadow: none;
border-color: lighten($blue-300, 20%);
color: $gray-darkest;
}
}
2017-12-06 00:00:22 +00:00
&.dot-highlight::after {
content: '';
background-color: $blue-500;
width: $gl-padding * 0.5;
height: $gl-padding * 0.5;
display: inline-block;
border-radius: 50%;
margin-left: 3px;
}
2017-09-19 17:40:03 +00:00
svg {
height: 15px;
width: 15px;
position: relative;
top: 2px;
2017-09-19 17:40:03 +00:00
}
svg,
.fa {
2016-08-19 08:39:47 +00:00
&:not(:last-child) {
margin-right: 5px;
2016-08-19 08:39:47 +00:00
}
2016-08-04 22:37:32 +00:00
}
}
2016-12-15 00:59:04 +00:00
.btn-terminal {
svg {
height: 14px;
width: $default-icon-size;
2016-12-15 00:59:04 +00:00
}
}
2016-03-11 16:14:29 +00:00
.btn-lg {
padding: 12px 20px;
}
.btn-transparent {
2016-12-30 20:18:27 +00:00
color: $gl-text-color-secondary;
background-color: transparent;
border: 0;
&:hover,
&:active,
&:focus {
background-color: transparent;
box-shadow: none;
}
}
.btn-block {
width: 100%;
margin: 0;
margin-bottom: 15px;
&.btn {
padding: 6px 0;
}
}
.btn-align-content {
display: flex;
justify-content: center;
align-items: center;
}
.btn-group {
&.btn-grouped {
@include btn-with-margin;
}
}
.btn-clipboard {
2017-11-02 23:59:51 +00:00
border: 0;
padding: 0 5px;
svg {
top: auto;
width: 16px;
height: 16px;
}
}
.input-group-prepend,
.input-group-append {
.btn {
@include btn-middle;
&:hover {
outline: none;
}
&:active {
outline: none;
}
&.btn-clipboard {
padding-left: 15px;
padding-right: 15px;
}
}
.active {
2016-09-09 16:59:36 +00:00
box-shadow: $gl-btn-active-background;
2016-12-12 22:26:21 +00:00
border: 1px solid $border-gray-dark !important;
2016-11-30 13:25:25 +00:00
background-color: $btn-active-gray-light !important;
}
}
.btn-loading {
&:not(.disabled) {
.fa,
.spinner {
display: none;
}
}
.fa {
margin-right: 5px;
}
}
2016-04-01 19:27:39 +00:00
.btn-build {
margin-left: 10px;
2016-04-26 18:20:58 +00:00
i {
2016-12-30 20:18:27 +00:00
color: $gl-text-color-secondary;
2016-04-26 18:20:58 +00:00
}
svg {
fill: $gl-text-color-secondary;
}
2016-04-26 18:20:58 +00:00
}
.clone-dropdown-btn a {
color: $gl-gray-700;
&:hover {
text-decoration: none;
}
}
.btn-static {
2016-12-12 22:26:21 +00:00
background-color: $gray-light !important;
border: 1px solid $border-gray-normal;
cursor: default;
&:active {
box-shadow: inset 0 0 0 $white;
}
}
.btn-inverted {
&-secondary {
@include btn-outline($white, $blue-500, $blue-500, $blue-100, $blue-700, $blue-500, $blue-200, $blue-600, $blue-800);
}
}
2018-04-09 15:26:28 +00:00
@include media-breakpoint-down(xs) {
.btn-wide-on-xs {
width: 100%;
}
}
.btn-blank {
padding: 0;
background: transparent;
border: 0;
2017-11-10 23:41:04 +00:00
border-radius: 0;
2017-09-14 11:01:07 +00:00
&:hover,
&:active,
&:focus {
outline: 0;
2017-09-14 11:01:07 +00:00
background: transparent;
box-shadow: none;
}
}
2017-11-10 23:41:04 +00:00
2018-03-01 18:21:14 +00:00
.btn-link {
2018-04-07 05:16:51 +00:00
padding: 0;
background-color: transparent;
color: $blue-600;
font-weight: normal;
border-radius: 0;
border-color: transparent;
2017-11-10 23:41:04 +00:00
&:hover,
&:active,
&:focus {
2018-04-07 05:16:51 +00:00
color: $blue-800;
text-decoration: underline;
background-color: transparent;
border-color: transparent;
2017-11-10 23:41:04 +00:00
}
&.btn-secondary-hover-link,
&.btn-default-hover-link {
2018-04-09 15:20:39 +00:00
color: $gl-text-color-secondary;
2017-11-10 23:41:04 +00:00
2018-04-09 15:20:39 +00:00
&:hover,
&:active,
&:focus {
2018-08-14 16:44:08 +00:00
color: $blue-600;
2018-04-09 15:20:39 +00:00
text-decoration: none;
}
2018-04-07 05:16:51 +00:00
}
2018-04-09 15:20:39 +00:00
&.btn-primary-hover-link {
color: inherit;
2018-04-09 16:29:24 +00:00
2018-04-09 15:20:39 +00:00
&:hover,
&:active,
&:focus {
2018-08-14 16:44:08 +00:00
color: $blue-600;
2018-04-09 15:20:39 +00:00
text-decoration: none;
}
2017-11-10 23:41:04 +00:00
}
}
2017-11-28 19:07:25 +00:00
.btn-missing {
color: $gl-text-color-secondary;
border: 1px dashed $border-gray-normal-dashed;
border-radius: $border-radius-default;
&:hover,
&:active,
&:focus {
color: $gl-text-color-secondary;
background-color: $white-normal;
}
}
.btn-svg svg {
@include btn-svg;
2017-11-28 19:07:25 +00:00
}
2018-01-16 19:31:17 +00:00
// All disabled buttons, regardless of color, type, etc
%disabled {
background-color: $gray-light !important;
border-color: $gray-200 !important;
color: $gl-text-color-disabled !important;
opacity: 1 !important;
cursor: default !important;
i {
color: $gl-text-color-disabled !important;
}
}
2018-01-16 19:31:17 +00:00
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn,
.dropdown-toggle[disabled],
[disabled].dropdown-menu-toggle {
@extend %disabled;
2018-01-16 19:31:17 +00:00
&:hover {
@extend %disabled;
2018-01-16 19:31:17 +00:00
}
}
[readonly] {
cursor: default;
}
.btn-no-padding {
padding: 0;
}