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

475 lines
8 KiB
SCSS
Raw Normal View History

2017-10-07 00:25:17 -04:00
@mixin btn-comment-icon {
border-radius: 50%;
background: $white-light;
padding: 1px 5px;
font-size: 12px;
color: $blue-500;
width: 24px;
height: 24px;
2017-10-07 00:25:17 -04:00
border: 1px solid $blue-500;
&:hover,
&.inverted {
background: $blue-500;
border-color: $blue-600;
color: $white-light;
}
&:active {
outline: 0;
}
}
@mixin btn-default {
2016-09-09 12:59:36 -04:00
border-radius: 3px;
font-size: $gl-font-size;
font-weight: $gl-font-weight-normal;
padding: $gl-vert-padding $gl-btn-padding;
&:focus,
&:active {
2016-04-01 15:27:39 -04:00
background-color: $btn-active-gray;
2016-09-09 12:59:36 -04:00
box-shadow: $gl-btn-active-background;
}
}
@mixin btn-middle {
@include btn-default;
}
@mixin btn-outline($background, $text, $border, $hover-background, $hover-text, $hover-border, $active-background, $active-border) {
2016-05-31 13:14:55 -04:00
background-color: $background;
color: $text;
border-color: $border;
2017-06-07 09:17:03 -04:00
> .icon {
2017-06-07 06:18:35 -04:00
color: $text;
}
2016-05-31 13:14:55 -04:00
&:hover,
&:focus {
background-color: $hover-background;
border-color: $hover-border;
color: $hover-text;
2017-06-07 06:18:35 -04:00
2017-06-07 09:17:03 -04:00
> .icon {
2017-06-07 06:18:35 -04:00
color: $hover-text;
}
}
&:active {
background-color: $active-background;
border-color: $active-border;
color: $hover-text;
2017-06-07 06:18:35 -04:00
2017-06-07 09:17:03 -04:00
> .icon {
2017-06-07 06:18:35 -04:00
color: $hover-text;
}
2016-05-31 13:14:55 -04: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;
}
2016-04-01 15:27:39 -04:00
&:active,
&.active {
2016-09-09 12:59:36 -04:00
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-light);
}
@mixin btn-blue {
@include btn-color($blue-500, $blue-600, $blue-600, $blue-700, $blue-700, $blue-800, $white-light);
2015-12-22 16:33:46 -05:00
}
@mixin btn-orange {
@include btn-color($orange-500, $orange-600, $orange-600, $orange-700, $orange-700, $orange-800, $white-light);
}
@mixin btn-red {
@include btn-color($red-500, $red-600, $red-600, $red-700, $red-700, $red-800, $white-light);
}
@mixin btn-gray {
2016-12-30 15:18:27 -05:00
@include btn-color($gray-light, $border-gray-normal, $gray-normal, $border-gray-normal, $gray-dark, $border-gray-dark, $gl-text-color);
}
@mixin btn-white {
2016-12-12 17:26:21 -05:00
@include btn-color($white-light, $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;
}
&.btn-xs {
margin-left: $btn-xs-side-margin;
}
}
2017-11-28 14:07:25 -05: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-19 21:46:18 -05:00
color: $gl-text-color;
2016-02-22 09:58:04 -05:00
&:focus:active {
outline: 0;
}
&.btn-sm {
padding: 4px 10px;
font-size: 13px;
line-height: 18px;
2015-12-22 15:22:37 -05:00
}
&.btn-xs {
padding: 2px 5px;
}
&.btn-success,
&.btn-new,
&.btn-create,
&.btn-save {
@include btn-green;
}
&.btn-inverted {
&.btn-success,
&.btn-new,
&.btn-create,
&.btn-save {
@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);
}
&.btn-primary,
&.btn-info {
@include btn-outline($white-light, $blue-500, $blue-500, $blue-500, $white-light, $blue-600, $blue-600, $blue-700);
}
}
&.btn-gray {
@include btn-gray;
}
&.btn-info,
&.btn-primary,
&.btn-register {
@include btn-blue;
}
&.btn-warning {
@include btn-orange;
}
2017-06-07 06:18:35 -04:00
&.btn-close,
&.btn-close-color {
@include btn-outline($white-light, $orange-600, $orange-500, $orange-500, $white-light, $orange-600, $orange-600, $orange-700);
2016-05-31 13:14:55 -04:00
}
&.btn-spam {
@include btn-outline($white-light, $red-500, $red-500, $red-500, $white-light, $red-600, $red-600, $red-700);
}
&.btn-danger,
&.btn-remove,
&.btn-red {
@include btn-red;
}
&.btn-cancel {
float: right;
}
2017-06-07 06:18:35 -04:00
&.btn-reopen,
.btn-reopen-color {
/* should be same as parent class for now */
}
&.btn-grouped {
@include btn-with-margin;
}
.fa-caret-down,
.fa-chevron-down {
2016-02-19 21:46:18 -05:00
margin-left: 5px;
}
2016-07-14 11:48:01 -04:00
&.dropdown-toggle {
.fa-caret-down {
margin-left: 3px;
}
}
2017-12-05 19:00:22 -05: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 13:40:03 -04:00
svg {
height: 15px;
width: 15px;
position: relative;
top: 2px;
}
svg,
.fa {
2016-08-19 04:39:47 -04:00
&:not(:last-child) {
margin-right: 5px;
2016-08-19 04:39:47 -04:00
}
2016-08-04 18:37:32 -04:00
}
}
2016-12-14 19:59:04 -05:00
.btn-terminal {
svg {
height: 14px;
width: 18px;
}
}
2016-03-11 11:14:29 -05:00
.btn-lg {
padding: 12px 20px;
}
.btn-transparent {
2016-12-30 15:18:27 -05: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 19:59:51 -04:00
border: 0;
padding: 0 5px;
}
.input-group-btn {
.btn {
@include btn-middle;
&:hover {
outline: none;
}
&:active {
outline: none;
}
&.btn-clipboard {
padding-left: 15px;
padding-right: 15px;
}
}
.active {
2016-09-09 12:59:36 -04:00
box-shadow: $gl-btn-active-background;
2016-12-12 17:26:21 -05:00
border: 1px solid $border-gray-dark !important;
2016-11-30 08:25:25 -05:00
background-color: $btn-active-gray-light !important;
}
}
.btn-loading {
&:not(.disabled) .fa {
display: none;
}
.fa {
margin-right: 5px;
}
}
2016-04-01 15:27:39 -04:00
.btn-text-field {
width: 100%;
text-align: left;
padding: 6px 16px;
border-color: $border-color;
2016-12-12 16:49:12 -05:00
color: $gray-darkest;
2016-12-12 17:26:21 -05:00
background-color: $gray-light;
2016-04-01 15:27:39 -04:00
&:hover,
&:active,
&:focus {
cursor: text;
box-shadow: none;
border-color: lighten($dropdown-input-focus-border, 20%);
2016-12-12 16:49:12 -05:00
color: $gray-darkest;
2016-12-12 17:26:21 -05:00
background-color: $gray-light;
2016-04-01 15:27:39 -04:00
}
}
.btn-build {
margin-left: 10px;
2016-04-26 14:20:58 -04:00
i {
2016-12-30 15:18:27 -05:00
color: $gl-text-color-secondary;
2016-04-26 14:20:58 -04:00
}
}
.clone-dropdown-btn a {
2016-06-16 14:27:25 -04:00
color: $dropdown-link-color;
&:hover {
text-decoration: none;
}
}
.btn-static {
2016-12-12 17:26:21 -05:00
background-color: $gray-light !important;
border: 1px solid $border-gray-normal;
cursor: default;
&:active {
2016-11-30 08:25:25 -05:00
-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);
}
}
@media (max-width: $screen-xs-max) {
.btn-wide-on-xs {
width: 100%;
}
}
.btn-blank {
padding: 0;
background: transparent;
border: 0;
2017-11-10 18:41:04 -05:00
border-radius: 0;
2017-09-14 07:01:07 -04:00
&:hover,
&:active,
&:focus {
outline: 0;
2017-09-14 07:01:07 -04:00
background: transparent;
box-shadow: none;
}
}
2017-11-10 18:41:04 -05:00
.btn-link.btn-secondary-hover-link {
color: $gl-text-color-secondary;
&:hover,
&:active,
&:focus {
color: $gl-link-color;
text-decoration: none;
}
}
.btn-link.btn-primary-hover-link {
color: inherit;
&:hover,
&:active,
&:focus {
color: $gl-link-color;
text-decoration: none;
}
}
2017-11-28 14:07:25 -05:00
.btn-svg svg {
@include btn-svg;
}
2018-01-16 14:31:17 -05:00
// 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;
}
}
2018-01-16 14:31:17 -05:00
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn,
.dropdown-toggle[disabled],
[disabled].dropdown-menu-toggle {
@extend %disabled;
2018-01-16 14:31:17 -05:00
&:hover {
@extend %disabled;
2018-01-16 14:31:17 -05:00
}
}