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

389 lines
6.4 KiB
SCSS
Raw Normal View History

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;
2017-08-17 22:00:37 +05:30
font-weight: 400;
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;
}
2016-08-24 12:49:21 +05:30
svg {
path {
fill: $color;
}
use {
stroke: $color;
}
}
2015-10-24 18:46:33 +05:30
}
@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-gray {
2017-08-17 22:00:37 +05:30
@include btn-color($gray-light, $border-gray-normal, $gray-normal, $border-gray-normal, $gray-dark, $border-gray-dark, $gl-text-color);
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;
}
&.btn-xs {
margin-left: $btn-xs-side-margin;
}
}
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;
}
&.btn-small,
2015-10-24 18:46:33 +05:30
&.btn-sm {
padding: 4px 10px;
font-size: 13px;
line-height: 18px;
}
2015-10-24 18:46:33 +05:30
&.btn-xs {
padding: 2px 5px;
2015-10-24 18:46:33 +05:30
}
&.btn-success,
&.btn-new,
&.btn-create,
2016-04-02 18:10:28 +05:30
&.btn-save {
2015-10-24 18:46:33 +05:30
@include btn-green;
}
2016-09-13 17:45:13 +05:30
&.btn-inverted {
&.btn-success,
&.btn-new,
&.btn-create,
&.btn-save {
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
}
}
2015-10-24 18:46:33 +05:30
&.btn-gray {
@include btn-gray;
}
2016-11-03 12:29:30 +05:30
&.btn-info,
2017-08-17 22:00:37 +05:30
&.btn-primary,
2016-11-03 12:29:30 +05:30
&.btn-register {
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;
}
&.disabled {
pointer-events: auto !important;
2015-10-24 18:46:33 +05:30
}
2016-06-02 11:05:42 +05:30
&[disabled] {
pointer-events: none !important;
}
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;
}
}
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;
width: 18px;
}
}
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;
}
}
.btn-group {
&.btn-grouped {
@include btn-with-margin;
2015-10-24 18:46:33 +05:30
}
}
.btn-clipboard {
border: none;
padding: 0 5px;
}
.input-group-btn {
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-text-field {
width: 100%;
text-align: left;
padding: 6px 16px;
border-color: $border-color;
2017-08-17 22:00:37 +05:30
color: $gray-darkest;
background-color: $gray-light;
2016-06-02 11:05:42 +05:30
&:hover,
&:active,
&:focus {
cursor: text;
box-shadow: none;
2017-08-17 22:00:37 +05:30
border-color: lighten($dropdown-input-focus-border, 20%);
color: $gray-darkest;
background-color: $gray-light;
2016-06-02 11:05:42 +05:30
}
}
.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
}
}
2016-08-24 12:49:21 +05:30
.clone-dropdown-btn a {
color: $dropdown-link-color;
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
@media (max-width: $screen-xs-max) {
.btn-wide-on-xs {
width: 100%;
}
}
2017-08-17 22:00:37 +05:30
.btn-blank {
padding: 0;
background: transparent;
border: 0;
&:focus {
outline: 0;
}
}