mirror of
https://github.com/picocss/pico.git
synced 2025-02-24 00:39:20 -05:00
101 lines
1.8 KiB
SCSS
101 lines
1.8 KiB
SCSS
/**
|
||
* Button
|
||
*/
|
||
|
||
|
||
// Reboot
|
||
// Based on normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
|
||
// ––––––––––––––––––––
|
||
|
||
// 1. Change the font styles in all browsers.
|
||
// 2. Remove the margin in Firefox and Safari
|
||
// 3. Show the overflow in Edge
|
||
button {
|
||
margin: 0; // 2
|
||
overflow: visible; // 3
|
||
font-family: inherit; // 1
|
||
text-transform: none; // 1
|
||
}
|
||
|
||
// Correct the inability to style clickable types in iOS and Safari.
|
||
button,
|
||
[type="button"],
|
||
[type="reset"],
|
||
[type="submit"] {
|
||
-webkit-appearance: button;
|
||
}
|
||
|
||
// Remove the inner border and padding in Firefox.
|
||
button::-moz-focus-inner,
|
||
[type="button"]::-moz-focus-inner,
|
||
[type="reset"]::-moz-focus-inner,
|
||
[type="submit"]::-moz-focus-inner {
|
||
padding: 0;
|
||
border-style: none;
|
||
}
|
||
|
||
|
||
// Pico
|
||
// ––––––––––––––––––––
|
||
|
||
button {
|
||
display: block;
|
||
width: 100%;
|
||
margin-bottom: $spacing-typography;
|
||
}
|
||
|
||
a[role="button"] {
|
||
display: inline-block;
|
||
text-decoration: none;
|
||
}
|
||
|
||
button,
|
||
input[type="submit"],
|
||
a[role="button"] {
|
||
border: 1px solid transparent;
|
||
padding: $spacing-input-button;
|
||
border-radius: $round;
|
||
outline: none;
|
||
background-color: var(--primary);
|
||
color: var(--primary-inverse);
|
||
font-size: 1rem;
|
||
font-weight: normal;
|
||
line-height: $line-height;
|
||
text-align: center;
|
||
cursor: pointer;
|
||
|
||
@if $enable-transitions {
|
||
transition:
|
||
background-color $transition,
|
||
color $transition,
|
||
box-shadow $transition;
|
||
}
|
||
|
||
&:hover,
|
||
&:active,
|
||
&:focus {
|
||
background-color: var(--primary-hover);
|
||
}
|
||
|
||
&:focus {
|
||
box-shadow: 0 0 0 0.2rem var(--primary-focus);
|
||
}
|
||
}
|
||
|
||
// Input [type="reset"]
|
||
input[type="reset"] {
|
||
cursor: pointer;
|
||
}
|
||
|
||
// Button [disabled]
|
||
button,
|
||
input[type="submit"],
|
||
input[type="reset"],
|
||
a[role="button"] {
|
||
|
||
&[disabled] {
|
||
opacity: .5;
|
||
pointer-events: none;
|
||
}
|
||
}
|