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

515 lines
8.8 KiB
SCSS
Raw Normal View History

2018-03-17 18:26:18 +05:30
@mixin btn-comment-icon {
border-radius: 50%;
background: $white-light;
padding: 1px 5px;
font-size: 12px;
color: $blue-500;
width: 24px;
height: 24px;
border: 1px solid $blue-500;
&:hover,
&.inverted {
background: $blue-500;
border-color: $blue-600;
color: $white-light;
}
&:active {
outline: 0;
}
}
2015-10-24 18:46:33 +05:30
@mixin btn-default {
2016-11-03 12:29:30 +05:30
border-radius: 3px;
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;
2016-11-03 12:29:30 +05:30
box-shadow: $gl-btn-active-background;
2015-10-24 18:46:33 +05:30
}
}
@mixin btn-middle {
@include btn-default;
}
2017-08-17 22:00:37 +05:30
@mixin btn-outline($background, $text, $border, $hover-background, $hover-text, $hover-border, $active-background, $active-border) {
background-color: $background;
color: $text;
border-color: $border;
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
}
&:active {
background-color: $active-background;
border-color: $active-border;
color: $hover-text;
2017-09-10 17:25:29 +05:30
> .icon {
color: $hover-text;
}
}
}
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 {
2016-11-03 12:29:30 +05:30
box-shadow: $gl-btn-active-background;
2015-10-24 18:46:33 +05:30
background-color: $dark;
border-color: $border-dark;
color: $color;
}
}
@mixin btn-green {
2017-08-17 22:00:37 +05:30
@include btn-color($green-500, $green-600, $green-600, $green-700, $green-700, $green-800, $white-light);
2015-10-24 18:46:33 +05:30
}
@mixin btn-blue {
2017-08-17 22:00:37 +05:30
@include btn-color($blue-500, $blue-600, $blue-600, $blue-700, $blue-700, $blue-800, $white-light);
}
2015-10-24 18:46:33 +05:30
@mixin btn-orange {
2017-08-17 22:00:37 +05:30
@include btn-color($orange-500, $orange-600, $orange-600, $orange-700, $orange-700, $orange-800, $white-light);
2015-10-24 18:46:33 +05:30
}
@mixin btn-red {
2017-08-17 22:00:37 +05:30
@include btn-color($red-500, $red-600, $red-600, $red-700, $red-700, $red-800, $white-light);
2015-10-24 18:46:33 +05:30
}
@mixin btn-white {
2017-08-17 22:00:37 +05:30
@include btn-color($white-light, $border-color, $white-normal, $border-white-normal, $white-dark, $border-gray-dark, $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;
&:focus:active {
outline: 0;
}
2015-10-24 18:46:33 +05:30
&.btn-sm {
padding: 4px 10px;
2018-12-23 12:14:25 +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;
}
2015-10-24 18:46:33 +05:30
&.btn-success,
2018-11-20 20:47:30 +05:30
&.btn-register {
2015-10-24 18:46:33 +05:30
@include btn-green;
}
2016-09-13 17:45:13 +05:30
&.btn-inverted {
2018-12-05 23:21:45 +05:30
&.btn-success {
2017-08-17 22:00:37 +05:30
@include btn-outline($white-light, $green-600, $green-500, $green-500, $white-light, $green-600, $green-600, $green-700);
}
&.btn-remove {
@include btn-outline($white-light, $red-500, $red-500, $red-500, $white-light, $red-600, $red-600, $red-700);
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 {
@include btn-outline($white-light, $orange-500, $orange-500, $orange-500, $white-light, $orange-600, $orange-600, $orange-700);
}
2018-03-17 18:26:18 +05:30
&.btn-primary,
&.btn-info {
@include btn-outline($white-light, $blue-500, $blue-500, $blue-500, $white-light, $blue-600, $blue-600, $blue-700);
}
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;
}
2017-09-10 17:25:29 +05:30
&.btn-close,
&.btn-close-color {
2017-08-17 22:00:37 +05:30
@include btn-outline($white-light, $orange-600, $orange-500, $orange-500, $white-light, $orange-600, $orange-600, $orange-700);
}
2016-09-13 17:45:13 +05:30
&.btn-spam {
2017-08-17 22:00:37 +05:30
@include btn-outline($white-light, $red-500, $red-500, $red-500, $white-light, $red-600, $red-600, $red-700);
2016-09-13 17:45:13 +05:30
}
2015-10-24 18:46:33 +05:30
&.btn-danger,
&.btn-remove,
&.btn-red {
@include btn-red;
}
&.btn-cancel {
float: right;
}
2017-09-10 17:25:29 +05:30
&.btn-reopen,
.btn-reopen-color {
/* should be same as parent class for now */
2015-10-24 18:46:33 +05:30
}
&.btn-grouped {
@include btn-with-margin;
}
2018-12-13 13:39:08 +05:30
&.btn-icon {
color: $gl-gray-700;
}
2016-11-03 12:29:30 +05:30
.fa-caret-down,
2017-08-17 22:00:37 +05:30
.fa-chevron-down {
2016-06-02 11:05:42 +05:30
margin-left: 5px;
}
2016-08-24 12:49:21 +05:30
2016-11-03 12:29:30 +05:30
&.dropdown-toggle {
.fa-caret-down {
margin-left: 3px;
}
}
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;
background-color: $gray-light;
&:hover,
&:active,
&:focus {
cursor: text;
box-shadow: none;
border-color: lighten($blue-300, 20%);
color: $gray-darkest;
background-color: $gray-light;
}
}
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
position: relative;
top: 2px;
}
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
svg,
.fa {
2016-09-29 09:46:39 +05:30
&:not(:last-child) {
2017-08-17 22:00:37 +05:30
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;
}
}
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;
2017-08-17 22:00:37 +05:30
border: 1px solid $border-gray-dark !important;
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 {
&:not(.disabled) .fa {
display: none;
}
.fa {
margin-right: 5px;
}
}
.btn-build {
margin-left: 10px;
2016-11-03 12:29:30 +05:30
2016-06-02 11:05:42 +05:30
i {
2017-08-17 22:00:37 +05:30
color: $gl-text-color-secondary;
2016-06-02 11:05:42 +05:30
}
2018-12-05 23:21:45 +05:30
svg {
fill: $gl-text-color-secondary;
}
2016-06-02 11:05:42 +05:30
}
2016-08-24 12:49:21 +05:30
.clone-dropdown-btn a {
2018-12-05 23:21:45 +05:30
color: $gl-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 {
2017-08-17 22:00:37 +05:30
-moz-box-shadow: inset 0 0 0 $white-light;
-webkit-box-shadow: inset 0 0 0 $white-light;
box-shadow: inset 0 0 0 $white-light;
}
}
.btn-inverted {
&-secondary {
@include btn-outline($white-light, $blue-500, $blue-500, $blue-500, $white-light, $blue-600, $blue-600, $blue-700);
2016-08-24 12:49:21 +05:30
}
}
2016-11-03 12:29:30 +05:30
2018-11-08 19:23:39 +05:30
@include media-breakpoint-down(xs) {
2016-11-03 12:29:30 +05:30
.btn-wide-on-xs {
width: 100%;
}
}
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;
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
}
2018-10-15 14:42:47 +05:30
&.btn-secondary-hover-link {
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
}
}
2018-03-27 19:54:05 +05:30
.btn-missing {
2018-11-20 20:47:30 +05:30
color: $gl-text-color-secondary;
2018-03-27 19:54:05 +05:30
border: 1px dashed $border-gray-normal-dashed;
border-radius: $border-radius-default;
&:hover,
&:active,
&:focus {
2018-11-20 20:47:30 +05:30
color: $gl-text-color-secondary;
2018-03-27 19:54:05 +05:30
background-color: $white-normal;
}
}
2018-03-17 18:26:18 +05:30
.btn-svg svg {
@include btn-svg;
}
// All disabled buttons, regardless of color, type, etc
%disabled {
background-color: $gray-light !important;
border-color: $theme-gray-200 !important;
color: $gl-text-color-disabled !important;
opacity: 1 !important;
cursor: default !important;
i {
color: $gl-text-color-disabled !important;
}
}
.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
}
}
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;
}