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

274 lines
4.8 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;
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 {
margin-top: 1px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
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;
min-width: 0;
overflow: hidden;
box-shadow: $material-shadow-2dp;
border-radius: $button-fab-size;
line-height: $button-fab-size;
background-clip: padding-box;
transition: $swift-ease-in;
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-fab-top-left {
2016-07-18 04:14:47 +00:00
position: absolute;
top: 16px;
left: 16px;
2016-07-18 04:14:47 +00:00
}
2016-06-22 01:45:49 +00:00
&.md-fab-top-center {
2016-07-18 04:14:47 +00:00
position: absolute;
top: 16px;
left: 50%;
transform: translateX(-50%);
2016-07-18 04:14:47 +00:00
}
2016-06-22 01:45:49 +00:00
&.md-fab-top-right {
2016-07-18 04:14:47 +00:00
position: absolute;
top: 16px;
2016-07-18 04:14:47 +00:00
right: 16px;
}
2016-06-22 01:45:49 +00:00
2016-07-18 04:14:47 +00:00
&.md-fab-bottom-left {
position: absolute;
bottom: 16px;
2016-07-18 04:14:47 +00:00
left: 16px;
}
&.md-fab-bottom-center {
position: absolute;
bottom: 16px;
left: 50%;
transform: translateX(-50%);
}
&.md-fab-bottom-right {
position: absolute;
right: 16px;
2016-07-18 04:14:47 +00:00
bottom: 16px;
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;
&.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-group {
width: auto;
display: flex;
> .md-button {
margin: 0;
overflow: hidden;
border-width: 1px 0 1px 1px;
border-radius: 0;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
&:first-child {
border-radius: 2px 0 0 2px;
}
&:last-child {
border-right-width: 1px;
border-radius: 0 2px 2px 0;
}
.md-ink-ripple {
border-radius: $button-radius;
}
}
}
.md-button.md-icon-button,
.md-button.md-fab {
md-icon {
display: block;
}
}
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;
}
}