bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/button/styles.scss

318 lines
5.9 KiB
SCSS
Raw Normal View History

@import "/imports/ui/stylesheets/variables/_all";
$btn-default-color: $color-gray;
$btn-default-bg: $color-white;
$btn-default-border: $color-white;
2017-07-11 22:08:49 +08:00
$btn-primary-color: $color-white;
$btn-primary-bg: $color-primary;
$btn-primary-border: $color-primary;
$btn-success-color: $color-white;
$btn-success-bg: $color-success;
$btn-success-border: $color-success;
$btn-danger-color: $color-white;
$btn-danger-bg: $color-danger;
$btn-danger-border: $color-danger;
2016-06-02 00:33:19 +08:00
$btn-border-size: $border-size;
$btn-border-radius: $border-radius;
$btn-font-weight: 600;
$btn-spacing: .35rem;
$btn-sm-font-size: $font-size-small * .85;
2016-06-02 00:33:19 +08:00
$btn-sm-padding: $sm-padding-y $sm-padding-x;
$btn-md-font-size: $font-size-base * .85;
2016-06-02 00:33:19 +08:00
$btn-md-padding: $md-padding-y $md-padding-x;
$btn-lg-font-size: $font-size-large * .85;
2016-06-02 00:33:19 +08:00
$btn-lg-padding: $lg-padding-y $lg-padding-x;
2016-10-12 03:04:50 +08:00
$btn-jumbo-font-size: 3rem;
$btn-jumbo-padding: $jumbo-padding-y $jumbo-padding-x;
/* Base
* ==========
*/
.button {
border: none;
outline: none;
overflow: visible;
display: inline-block;
2017-11-10 01:03:32 +08:00
border-radius: $border-size;
font-weight: $btn-font-weight;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
user-select: none;
transition: all .2s ease-in-out;
&:hover,
&:focus {
text-decoration: none;
}
&:active {
background-image: none;
outline: 0;
}
2016-08-03 06:55:20 +08:00
&[aria-disabled="true"] {
cursor: not-allowed;
opacity: .65;
box-shadow: none;
}
2017-09-29 22:54:24 +08:00
&,
&:active {
&:focus {
span:first-of-type::before {
2017-11-10 01:03:32 +08:00
border-radius: $border-size;
2017-09-29 22:54:24 +08:00
}
}
}
}
.buttonWrapper {
border: none;
overflow: visible !important;
display: inline-block;
outline: none;
2017-09-29 22:54:24 +08:00
&,
&:active {
&:focus {
span:first-of-type::before {
border-radius: 50%;
}
}
}
2017-09-15 23:12:58 +08:00
line-height: 1.5;
text-align: center;
white-space: nowrap;
vertical-align: middle;
background: none;
padding: 0 !important;
&[aria-disabled="true"] > span {
2017-10-05 04:49:11 +08:00
cursor: not-allowed;
opacity: .65;
box-shadow: none;
}
}
.label {
.buttonWrapper & {
opacity: .85;
display: block;
margin-top: $btn-spacing;
2017-07-08 00:11:22 +08:00
color: #fff;
font-weight: normal;
line-height: 1.5;
text-align: center;
white-space: nowrap;
vertical-align: middle;
2017-09-15 23:12:58 +08:00
}
.buttonWrapper.sm & {
display: inline-block;
margin-top: 0;
margin-left: $btn-spacing;
}
& + .icon,
& + .button {
margin-left: $btn-spacing;
}
2017-11-21 18:35:21 +08:00
&:hover {
opacity: .5;
}
}
.hideLabel {
font-size: 0;
height: 0;
width: 0;
margin: 0 !important;
padding: 0 !important;
overflow: hidden;
display: block;
}
.icon {
width: 1.28571429em;
text-align: center;
2017-07-08 00:11:22 +08:00
color: #fff;
.buttonWrapper & {
font-size: 125%;
}
& + .label {
margin-left: $btn-spacing;
}
2017-11-21 18:35:21 +08:00
.buttonWrapper:hover & {
opacity: .75;
}
}
/* Colors
* ==========
*/
@mixin button-variant($color, $background, $border) {
$active-background: darken($background, 10%);
$active-border: darken($border, 12%);
color: $color;
background-color: $background;
2017-11-10 01:03:32 +08:00
border: $border-size-large solid transparent;
&:focus,
.buttonWrapper:focus:not([aria-disabled="true"]) & {
outline: none !important;
color: $color;
background-color: $background;
background-clip: padding-box;
2017-11-10 01:03:32 +08:00
border: $border-size-large solid transparent;
box-shadow: 0 0 0 $border-size $border;
}
&:hover,
.buttonWrapper:hover & {
color: $color;
background-color: $active-background;
border-color: $active-border;
2017-11-10 01:03:32 +08:00
border: $border-size-large solid transparent;
}
}
2016-05-21 00:17:39 +08:00
@mixin button-ghost-variant($color, $variant) {
color: $color;
background-image: none;
background-color: transparent;
2017-11-10 01:03:32 +08:00
border: $border-size-large solid transparent;
&:focus,
.buttonWrapper:focus & {
color: $color;
outline: none !important;
background-color: $variant;
background-clip: padding-box;
2017-11-10 01:03:32 +08:00
border: $border-size-large solid transparent;
box-shadow: 0 0 0 $border-size $color;
}
&:hover,
.buttonWrapper:hover & {
color: $color;
background-color: $variant;
border-color: $variant;
2017-11-10 01:03:32 +08:00
border: $border-size-large solid transparent;
}
}
.default {
@include button-variant($btn-default-color, $btn-default-bg, $btn-primary-border);
}
.primary {
@include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border);
}
.success {
@include button-variant($btn-success-color, $btn-success-bg, $btn-success-border);
}
.danger {
@include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border);
}
2016-08-03 06:55:20 +08:00
/* Styles
* ==========
*/
.block {
display: block;
width: 100%;
}
.ghost {
&.default {
2016-05-21 00:17:39 +08:00
@include button-ghost-variant($btn-default-bg, $btn-default-color);
}
&.primary {
2016-05-21 00:17:39 +08:00
@include button-ghost-variant($btn-primary-bg, $btn-primary-color);
}
&.success {
2016-05-21 00:17:39 +08:00
@include button-ghost-variant($btn-success-bg, $btn-success-color);
}
&.danger {
2016-05-21 00:17:39 +08:00
@include button-ghost-variant($btn-danger-bg, $btn-danger-color);
}
}
.circle {
2016-12-06 21:11:47 +08:00
$btn-sm-padding-x: nth($btn-sm-padding, 2) / 2.75;
$btn-md-padding-x: nth($btn-md-padding, 2) / 2.75;
$btn-lg-padding-x: nth($btn-lg-padding, 2) / 2.75;
$btn-jumbo-padding-x: nth($btn-jumbo-padding, 2) / 2.75;
border-radius: 50%;
&.sm {
padding-right: $btn-sm-padding-x;
padding-left: $btn-sm-padding-x;
}
&.md {
padding-right: $btn-md-padding-x;
padding-left: $btn-md-padding-x;
}
&.lg {
padding-right: $btn-lg-padding-x;
padding-left: $btn-lg-padding-x;
}
2016-10-12 03:04:50 +08:00
&.jumbo {
padding-right: $btn-jumbo-padding-x;
padding-left: $btn-jumbo-padding-x;
}
}
/* Sizes
* ==========
*/
.sm {
font-size: $btn-sm-font-size;
padding: $btn-sm-padding;
}
.md {
font-size: $btn-md-font-size;
padding: $btn-md-padding;
}
.lg {
font-size: $btn-lg-font-size;
padding: $btn-lg-padding;
}
2016-10-12 03:04:50 +08:00
.jumbo {
font-size: $btn-jumbo-font-size;
padding: $btn-jumbo-padding;
}