debian-mirror-gitlab/app/assets/stylesheets/framework/buttons.scss

489 lines
8.6 KiB
SCSS
Raw Normal View History

2018-03-17 18:26:18 +05:30
@mixin btn-comment-icon {
border-radius: 50%;
2020-04-22 19:07:51 +05:30
background: $white;
2019-09-04 21:01:54 +05:30
padding: 1px;
2018-03-17 18:26:18 +05:30
font-size: 12px;
color: $blue-500;
2019-09-04 21:01:54 +05:30
border: 1px solid $blue-500;
2018-03-17 18:26:18 +05:30
width: 24px;
height: 24px;
&:hover,
&.inverted {
background: $blue-500;
border-color: $blue-600;
2020-04-22 19:07:51 +05:30
color: $white;
2018-03-17 18:26:18 +05:30
}
&:active {
outline: 0;
}
}
2015-10-24 18:46:33 +05:30
@mixin btn-default {
2019-09-04 21:01:54 +05:30
border-radius: $border-radius-default;
font-size: $gl-font-size;
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-normal;
2016-04-02 18:10:28 +05:30
padding: $gl-vert-padding $gl-btn-padding;
2015-10-24 18:46:33 +05:30
&:focus,
&:active {
2016-06-02 11:05:42 +05:30
background-color: $btn-active-gray;
2020-03-13 15:44:24 +05:30
box-shadow: none;
2015-10-24 18:46:33 +05:30
}
}
@mixin btn-middle {
@include btn-default;
}
2019-09-04 21:01:54 +05:30
@mixin btn-outline($background, $text, $border, $hover-background, $hover-text, $hover-border, $active-background, $active-border, $active-text) {
background-color: $background;
color: $text;
border-color: $border;
2019-03-02 22:35:43 +05:30
&.btn-border-color {
border-color: $border-color;
}
2017-09-10 17:25:29 +05:30
> .icon {
color: $text;
}
&:hover,
&:focus {
background-color: $hover-background;
2016-11-03 12:29:30 +05:30
border-color: $hover-border;
2017-08-17 22:00:37 +05:30
color: $hover-text;
2017-09-10 17:25:29 +05:30
> .icon {
color: $hover-text;
}
2017-08-17 22:00:37 +05:30
}
2019-09-04 21:01:54 +05:30
&:focus {
box-shadow: 0 0 4px 1px $blue-300;
}
2017-08-17 22:00:37 +05:30
&:active {
background-color: $active-background;
border-color: $active-border;
2019-09-04 21:01:54 +05:30
box-shadow: inset 0 2px 4px 0 rgba($black, 0.2);
color: $active-text;
2017-09-10 17:25:29 +05:30
> .icon {
2019-09-04 21:01:54 +05:30
color: $active-text;
}
&:focus {
box-shadow: inset 0 2px 4px 0 rgba($black, 0.2);
2017-09-10 17:25:29 +05:30
}
}
}
2015-10-24 18:46:33 +05:30
@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;
}
2016-06-02 11:05:42 +05:30
&:active,
&.active {
2015-10-24 18:46:33 +05:30
background-color: $dark;
border-color: $border-dark;
color: $color;
}
}
@mixin btn-green {
2020-04-22 19:07:51 +05:30
@include btn-color($green-500, $green-600, $green-600, $green-700, $green-700, $green-800, $white);
2015-10-24 18:46:33 +05:30
}
@mixin btn-blue {
2020-04-22 19:07:51 +05:30
@include btn-color($blue-500, $blue-600, $blue-600, $blue-700, $blue-700, $blue-800, $white);
}
2015-10-24 18:46:33 +05:30
@mixin btn-orange {
2020-11-24 15:15:51 +05:30
@include btn-color($orange-500, $orange-600, $orange-500, $orange-600, $orange-600, $orange-800, $white);
2015-10-24 18:46:33 +05:30
}
@mixin btn-red {
2020-04-22 19:07:51 +05:30
@include btn-color($red-500, $red-600, $red-600, $red-700, $red-700, $red-800, $white);
2015-10-24 18:46:33 +05:30
}
@mixin btn-white {
2020-04-22 19:07:51 +05:30
@include btn-color($white, $border-color, $white-normal, $border-white-normal, $white-dark, $border-white-normal, $gl-text-color);
2015-10-24 18:46:33 +05:30
}
@mixin btn-with-margin {
margin-left: $btn-side-margin;
float: left;
&.inline {
float: none;
}
&.btn-sm {
margin-left: $btn-sm-side-margin;
}
}
2018-03-17 18:26:18 +05:30
@mixin btn-svg {
height: $gl-padding;
width: $gl-padding;
top: 0;
vertical-align: text-top;
}
2015-10-24 18:46:33 +05:30
.btn {
@include btn-default;
@include btn-white;
2016-06-02 11:05:42 +05:30
color: $gl-text-color;
2019-07-07 11:18:12 +05:30
white-space: nowrap;
2016-06-02 11:05:42 +05:30
&:focus:active {
outline: 0;
}
2015-10-24 18:46:33 +05:30
&.btn-sm {
padding: 4px 10px;
2019-02-15 15:39:39 +05:30
font-size: $gl-btn-small-font-size;
line-height: $gl-btn-small-line-height;
}
&.btn-xs {
padding: 2px $gl-btn-padding;
font-size: $gl-btn-xs-font-size;
line-height: $gl-btn-xs-line-height;
}
2021-02-22 17:27:13 +05:30
&.btn-success {
2015-10-24 18:46:33 +05:30
@include btn-green;
}
2020-07-28 23:09:34 +05:30
&.btn-inverted:not(.disabled):not(:disabled) {
2018-12-05 23:21:45 +05:30
&.btn-success {
2020-04-22 19:07:51 +05:30
@include btn-outline($white, $green-600, $green-500, $green-100, $green-700, $green-500, $green-200, $green-600, $green-800);
2017-08-17 22:00:37 +05:30
}
2019-07-07 11:18:12 +05:30
&.btn-danger {
2020-04-22 19:07:51 +05:30
@include btn-outline($white, $red-500, $red-500, $red-100, $red-700, $red-500, $red-200, $red-600, $red-800);
2016-09-13 17:45:13 +05:30
}
2018-03-17 18:26:18 +05:30
2018-11-20 20:47:30 +05:30
&.btn-warning {
2020-11-24 15:15:51 +05:30
@include btn-outline($white, $orange-500, $orange-500, $orange-50, $orange-600, $orange-600, $orange-100, $orange-700, $orange-700);
2018-11-20 20:47:30 +05:30
}
2018-03-17 18:26:18 +05:30
&.btn-primary,
&.btn-info {
2020-04-22 19:07:51 +05:30
@include btn-outline($white, $blue-500, $blue-500, $blue-100, $blue-700, $blue-500, $blue-200, $blue-600, $blue-800);
2018-03-17 18:26:18 +05:30
}
2016-09-13 17:45:13 +05:30
}
2016-11-03 12:29:30 +05:30
&.btn-info,
2018-11-20 20:47:30 +05:30
&.btn-primary {
2015-10-24 18:46:33 +05:30
@include btn-blue;
}
&.btn-warning {
@include btn-orange;
}
2021-02-22 17:27:13 +05:30
&.btn-close {
2020-11-24 15:15:51 +05:30
@include btn-outline($white, $orange-500, $orange-500, $orange-50, $orange-600, $orange-600, $orange-100, $orange-700, $orange-700);
}
2021-02-22 17:27:13 +05:30
&.btn-danger {
2015-10-24 18:46:33 +05:30
@include btn-red;
}
&.btn-cancel {
float: right;
}
&.btn-grouped {
@include btn-with-margin;
}
2018-12-13 13:39:08 +05:30
&.btn-icon {
2020-11-24 15:15:51 +05:30
color: $gray-700;
2018-12-13 13:39:08 +05:30
}
&.btn-text-field {
width: 100%;
text-align: left;
padding: 6px 16px;
border-color: $border-color;
color: $gray-darkest;
2020-04-22 19:07:51 +05:30
background-color: $white;
2018-12-13 13:39:08 +05:30
&:hover,
&:active,
&:focus {
cursor: text;
box-shadow: none;
border-color: lighten($blue-300, 20%);
color: $gray-darkest;
}
}
2018-03-17 18:26:18 +05:30
&.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;
}
2016-08-24 12:49:21 +05:30
svg {
height: 15px;
2016-09-13 17:45:13 +05:30
width: 15px;
2016-08-24 12:49:21 +05:30
}
2016-09-29 09:46:39 +05:30
2021-02-22 17:27:13 +05:30
svg:not(:last-child) {
margin-right: 5px;
2016-09-29 09:46:39 +05:30
}
2016-06-02 11:05:42 +05:30
}
2017-08-17 22:00:37 +05:30
.btn-terminal {
svg {
height: 14px;
2018-11-20 20:47:30 +05:30
width: $default-icon-size;
2017-08-17 22:00:37 +05:30
}
}
2016-06-02 11:05:42 +05:30
.btn-lg {
padding: 12px 20px;
}
.btn-transparent {
2017-08-17 22:00:37 +05:30
color: $gl-text-color-secondary;
2016-06-02 11:05:42 +05:30
background-color: transparent;
border: 0;
&:hover,
&:active,
&:focus {
background-color: transparent;
box-shadow: none;
}
2015-10-24 18:46:33 +05:30
}
.btn-block {
width: 100%;
margin: 0;
margin-bottom: 15px;
2016-11-03 12:29:30 +05:30
2015-10-24 18:46:33 +05:30
&.btn {
padding: 6px 0;
}
}
2018-03-17 18:26:18 +05:30
.btn-align-content {
display: flex;
justify-content: center;
align-items: center;
}
2015-10-24 18:46:33 +05:30
.btn-group {
&.btn-grouped {
@include btn-with-margin;
2015-10-24 18:46:33 +05:30
}
}
.btn-clipboard {
2018-03-17 18:26:18 +05:30
border: 0;
padding: 0 5px;
2018-11-18 11:00:15 +05:30
svg {
top: auto;
2019-09-04 21:01:54 +05:30
width: 16px;
height: 16px;
2018-11-18 11:00:15 +05:30
}
}
2018-11-08 19:23:39 +05:30
.input-group-prepend,
.input-group-append {
2015-10-24 18:46:33 +05:30
.btn {
@include btn-middle;
&:hover {
outline: none;
2015-11-26 14:37:03 +05:30
}
&:active {
outline: none;
}
2015-11-26 14:37:03 +05:30
&.btn-clipboard {
padding-left: 15px;
padding-right: 15px;
2015-10-24 18:46:33 +05:30
}
}
2015-11-26 14:37:03 +05:30
.active {
2016-11-03 12:29:30 +05:30
box-shadow: $gl-btn-active-background;
2020-04-22 19:07:51 +05:30
border: 1px solid $border-white-normal !important;
2017-08-17 22:00:37 +05:30
background-color: $btn-active-gray-light !important;
}
2015-11-26 14:37:03 +05:30
}
2016-06-02 11:05:42 +05:30
.btn-loading {
2020-04-08 14:13:33 +05:30
&:not(.disabled) {
.spinner {
display: none;
}
2016-06-02 11:05:42 +05:30
}
}
2016-08-24 12:49:21 +05:30
.clone-dropdown-btn a {
2020-11-24 15:15:51 +05:30
color: $gray-700;
2016-11-03 12:29:30 +05:30
2016-08-24 12:49:21 +05:30
&:hover {
text-decoration: none;
}
}
.btn-static {
2017-08-17 22:00:37 +05:30
background-color: $gray-light !important;
border: 1px solid $border-gray-normal;
2016-08-24 12:49:21 +05:30
cursor: default;
2016-11-03 12:29:30 +05:30
2016-08-24 12:49:21 +05:30
&:active {
2020-04-22 19:07:51 +05:30
box-shadow: inset 0 0 0 $white;
2017-08-17 22:00:37 +05:30
}
}
.btn-inverted {
&-secondary {
2020-04-22 19:07:51 +05:30
@include btn-outline($white, $blue-500, $blue-500, $blue-100, $blue-700, $blue-500, $blue-200, $blue-600, $blue-800);
2016-08-24 12:49:21 +05:30
}
}
2016-11-03 12:29:30 +05:30
2017-08-17 22:00:37 +05:30
.btn-blank {
padding: 0;
background: transparent;
border: 0;
2018-03-17 18:26:18 +05:30
border-radius: 0;
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
&:hover,
&:active,
2017-08-17 22:00:37 +05:30
&:focus {
outline: 0;
2018-03-17 18:26:18 +05:30
background: transparent;
box-shadow: none;
}
}
2018-10-15 14:42:47 +05:30
.btn-link {
padding: 0;
background-color: transparent;
color: $blue-600;
font-weight: normal;
border-radius: 0;
border-color: transparent;
2020-04-22 19:07:51 +05:30
border-width: 0;
2018-03-17 18:26:18 +05:30
&:hover,
&:active,
&:focus {
2018-10-15 14:42:47 +05:30
color: $blue-800;
text-decoration: underline;
background-color: transparent;
border-color: transparent;
2018-03-17 18:26:18 +05:30
}
2019-07-07 11:18:12 +05:30
&.btn-secondary-hover-link,
&.btn-default-hover-link {
2018-10-15 14:42:47 +05:30
color: $gl-text-color-secondary;
2018-03-17 18:26:18 +05:30
2018-10-15 14:42:47 +05:30
&:hover,
&:active,
&:focus {
2018-11-20 20:47:30 +05:30
color: $blue-600;
2018-10-15 14:42:47 +05:30
text-decoration: none;
}
}
&.btn-primary-hover-link {
color: inherit;
&:hover,
&:active,
&:focus {
2018-11-20 20:47:30 +05:30
color: $blue-600;
2018-10-15 14:42:47 +05:30
text-decoration: none;
}
2018-03-17 18:26:18 +05:30
}
}
2020-10-24 23:57:45 +05:30
// The .btn-svg class is available for legacy icon buttons to
// preserve a 34px height and have 16x16 icons at the same time.
// Once a button is migrated (to the current 32px height)
// please remove this class from the new button.
2018-03-17 18:26:18 +05:30
.btn-svg svg {
@include btn-svg;
}
// All disabled buttons, regardless of color, type, etc
%disabled {
2020-07-28 23:09:34 +05:30
background-color: $gray-light;
border-color: $gray-100;
color: $gl-text-color-disabled;
opacity: 1;
text-decoration: none;
cursor: default;
2018-03-17 18:26:18 +05:30
2020-05-24 23:13:21 +05:30
&.cursor-not-allowed {
2020-07-28 23:09:34 +05:30
cursor: not-allowed;
2020-05-24 23:13:21 +05:30
}
2018-03-17 18:26:18 +05:30
i {
2020-07-28 23:09:34 +05:30
color: $gl-text-color-disabled;
2018-03-17 18:26:18 +05:30
}
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn,
.dropdown-toggle[disabled],
[disabled].dropdown-menu-toggle {
@extend %disabled;
&:hover {
@extend %disabled;
2017-08-17 22:00:37 +05:30
}
2020-07-28 23:09:34 +05:30
&.btn-link {
background-color: transparent;
}
2017-08-17 22:00:37 +05:30
}
2018-05-09 12:01:36 +05:30
2018-11-08 19:23:39 +05:30
[readonly] {
cursor: default;
}
2018-05-09 12:01:36 +05:30
.btn-no-padding {
padding: 0;
}
2020-11-24 15:15:51 +05:30
// This class helps convert `.gl-button` children so that they consistently
// match the style of `.btn` elements which might be around them. Ideally we
// wouldn't need this class.
//
// Remove by upgrading all buttons in a container to use the new `.gl-button` style.
.gl-button-deprecated-adapter .gl-button {
box-shadow: none;
border-width: 1px;
}