mirror of
https://github.com/picocss/pico.git
synced 2025-02-24 00:39:20 -05:00
110 lines
2.4 KiB
SCSS
110 lines
2.4 KiB
SCSS
/**
|
||
* Button
|
||
*/
|
||
|
||
|
||
// Reboot based on :
|
||
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
|
||
// - sanitize.css v12.0.1 | CC0 1.0 Universal | github.com/csstools/sanitize.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: var(--spacing-typography);
|
||
}
|
||
|
||
a[role="button"] {
|
||
display: inline-block;
|
||
text-decoration: none;
|
||
}
|
||
|
||
button,
|
||
input[type="submit"],
|
||
input[type="button"],
|
||
input[type="reset"],
|
||
[type="file"]::-webkit-file-upload-button,
|
||
a[role="button"] {
|
||
padding: var(--button-spacing-vertical) var(--button-spacing-horizontal);
|
||
border: var(--button-border-width) solid var(--primary-border);
|
||
border-radius: var(--button-round);
|
||
outline: none;
|
||
background-color: var(--primary);
|
||
box-shadow: var(--button-shadow);
|
||
color: var(--primary-inverse);
|
||
font-size: 1rem;
|
||
font-weight: var(--buttons-weight);
|
||
line-height: var(--line-height);
|
||
text-align: center;
|
||
cursor: pointer;
|
||
|
||
@if $enable-transitions {
|
||
transition:
|
||
background-color var(--transition),
|
||
border-color var(--transition),
|
||
color var(--transition),
|
||
box-shadow var(--transition);
|
||
}
|
||
|
||
&:hover,
|
||
&:active,
|
||
&:focus {
|
||
border-color: var(--primary-hover-border);
|
||
background-color: var(--primary-hover);
|
||
box-shadow: var(--button-hover-shadow);
|
||
}
|
||
|
||
&:focus {
|
||
box-shadow: var(--button-hover-shadow), 0 0 0 var(--button-outline-width) var(--primary-focus);
|
||
}
|
||
}
|
||
|
||
// Input [type="reset"]
|
||
input[type="reset"] {
|
||
cursor: pointer;
|
||
}
|
||
|
||
// Button [disabled]
|
||
button,
|
||
input[type="submit"],
|
||
input[type="button"],
|
||
input[type="reset"],
|
||
a[role="button"] {
|
||
|
||
&[disabled] {
|
||
opacity: .5;
|
||
pointer-events: none;
|
||
}
|
||
}
|