vue-material/src/components/mdButton/mdButton.scss

257 lines
4.5 KiB
SCSS
Raw Normal View History

@import '../../core/stylesheets/variables.scss';
2016-06-22 01:45:49 +00:00
$button-width: 88px;
$button-height: 36px;
2016-06-22 04:58:04 +00:00
$button-radius: 2px;
2016-07-18 04:14:47 +00:00
$button-fab-size: 56px;
$button-fab-size-mini: 40px;
2017-01-11 02:01:34 +00:00
$button-fab-space: 24px;
2016-07-18 04:14:47 +00:00
2016-06-22 04:58:04 +00:00
$button-dense-height: 32px;
2016-06-22 01:45:49 +00:00
$button-icon-size: 40px;
2016-06-21 06:54:17 +00:00
.md-button {
2016-06-22 01:45:49 +00:00
min-width: $button-width;
min-height: $button-height;
margin: 6px 8px;
padding: 0 16px;
2016-06-22 01:45:49 +00:00
display: inline-block;
position: relative;
overflow: hidden;
user-select: none;
cursor: pointer;
outline: none;
background: none;
border: 0;
2016-06-22 04:58:04 +00:00
border-radius: $button-radius;
transition: $swift-ease-out;
2016-06-22 01:45:49 +00:00
color: currentColor;
font-family: inherit;
font-size: 14px;
font-style: inherit;
font-variant: inherit;
font-weight: 500;
2016-11-12 16:00:15 +00:00
letter-spacing: inherit;
2016-06-22 01:45:49 +00:00
line-height: $button-height;
text-align: center;
text-transform: uppercase;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
&:focus {
outline: none;
}
2016-11-21 06:01:49 +00:00
2016-11-10 16:24:39 +00:00
&::-moz-focus-inner {
border:0;
}
2016-06-22 01:45:49 +00:00
2016-06-22 04:58:04 +00:00
&:hover {
&:not([disabled]) {
&:not(.md-raised) {
background-color: rgba(#999, .2);
text-decoration: none;
}
&.md-raised {
background-color: rgba(#000, .12);
}
}
}
&:active:not([disabled]) {
background-color: rgba(#999, .4);
2016-06-22 01:45:49 +00:00
}
2016-07-18 16:00:51 +00:00
&.md-raised:not([disabled]) {
box-shadow: $material-shadow-2dp;
2016-06-22 01:45:49 +00:00
}
2016-10-17 23:03:17 +00:00
&.md-dense {
min-height: $button-dense-height;
line-height: $button-dense-height;
font-size: 13px;
}
&.md-icon-button,
&.md-fab {
.md-icon {
position: absolute;
2017-01-11 02:01:34 +00:00
top: 1px;
right: 0;
bottom: 0;
left: 0;
2016-10-17 23:03:17 +00:00
}
}
2016-06-22 01:45:49 +00:00
&.md-icon-button {
width: $button-icon-size;
2016-07-18 20:05:08 +00:00
min-width: $button-icon-size;
2016-06-22 01:45:49 +00:00
height: $button-icon-size;
margin: 0 6px;
padding: 8px;
border-radius: 50%;
line-height: 24px;
2016-07-18 03:31:37 +00:00
&:not([disabled]) {
&:hover {
background: none;
}
}
2016-07-18 16:00:51 +00:00
&.md-dense {
width: $button-dense-height;
2016-09-19 03:45:48 +00:00
min-width: $button-dense-height;
2016-07-18 16:00:51 +00:00
height: $button-dense-height;
min-height: $button-dense-height;
2016-10-17 23:03:17 +00:00
padding: 4px;
2016-07-18 16:00:51 +00:00
line-height: $button-dense-height;
}
2016-06-22 04:58:04 +00:00
.md-ink-ripple {
border-radius: 50%;
2016-08-04 03:11:23 +00:00
.md-ripple {
top: 0 !important;
right: 0 !important;
bottom: 0 !important;
left: 0 !important;
}
2016-06-22 04:58:04 +00:00
}
2016-06-22 01:45:49 +00:00
2016-06-22 04:58:04 +00:00
.md-ripple.md-active {
animation-duration: .9s;
}
2016-06-22 01:45:49 +00:00
}
&.md-fab {
2016-07-18 04:14:47 +00:00
width: $button-fab-size;
height: $button-fab-size;
2017-01-11 02:01:34 +00:00
padding: 0;
2016-07-18 04:14:47 +00:00
min-width: 0;
overflow: hidden;
box-shadow: $material-shadow-2dp;
border-radius: $button-fab-size;
line-height: $button-fab-size;
background-clip: padding-box;
2016-12-05 07:19:01 +00:00
transition: $swift-ease-out;
2016-07-18 04:14:47 +00:00
transition-property: background-color,
box-shadow,
transform;
2016-06-22 01:45:49 +00:00
2016-07-18 04:14:47 +00:00
&:hover,
&:focus {
box-shadow: $material-shadow-5dp;
}
2016-06-22 01:45:49 +00:00
&.md-mini {
2016-07-18 04:14:47 +00:00
width: $button-fab-size-mini;
height: $button-fab-size-mini;
line-height: $button-fab-size-mini;
}
.md-ink-ripple {
border-radius: $button-fab-size;
2016-06-22 01:45:49 +00:00
}
}
2016-09-19 03:45:48 +00:00
&[disabled] {
color: rgba(#000, .26);
cursor: default;
2017-02-04 20:56:49 +00:00
pointer-events: none;
2016-09-19 03:45:48 +00:00
&.md-raised,
&.md-fab {
background-color: rgba(#000, .12);
}
&.md-fab {
box-shadow: none;
}
}
&:after {
transition: $swift-ease-out;
}
2016-06-22 01:47:45 +00:00
.md-ink-ripple {
2016-06-22 04:58:04 +00:00
border-radius: $button-radius;
2016-06-22 01:45:49 +00:00
background-clip: padding-box;
overflow: hidden;
}
2016-06-21 06:54:17 +00:00
}
2016-06-22 04:58:04 +00:00
.md-button.md-icon-button,
.md-button.md-fab {
.md-icon {
2016-06-22 04:58:04 +00:00
display: block;
}
}
2016-11-21 06:03:02 +00:00
2017-01-11 02:01:34 +00:00
.md-fab,
.md-speed-dial {
&.md-fab-top-left,
&.md-fab-top-center,
&.md-fab-top-right,
&.md-fab-bottom-left,
&.md-fab-bottom-center,
&.md-fab-bottom-right {
margin: 0;
position: absolute;
z-index: 10;
}
&.md-fab-top-left {
top: $button-fab-space;
left: $button-fab-space;
}
&.md-fab-top-center {
top: $button-fab-space;
left: 50%;
transform: translateX(-50%);
}
&.md-fab-top-right {
top: $button-fab-space;
right: $button-fab-space;
}
&.md-fab-bottom-left {
bottom: $button-fab-space;
left: $button-fab-space;
}
&.md-fab-bottom-center {
bottom: $button-fab-space;
left: 50%;
transform: translateX(-50%);
}
&.md-fab-bottom-right {
right: $button-fab-space;
bottom: $button-fab-space;
}
}
2016-11-21 06:03:02 +00:00
.md-button-tooltip {
&.md-tooltip-top {
margin-top: -8px;
}
&.md-tooltip-right {
margin-left: 8px;
}
&.md-tooltip-bottom {
margin-top: 8px;
}
&.md-tooltip-left {
margin-left: -8px;
}
}