2019-11-27 15:31:49 +07:00
|
|
|
|
/**
|
|
|
|
|
* Button
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2020-09-11 23:22:50 +07:00
|
|
|
|
// 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
|
2019-11-27 15:31:49 +07:00
|
|
|
|
// ––––––––––––––––––––
|
|
|
|
|
|
2020-09-11 23:22:50 +07:00
|
|
|
|
// 1. Change the font styles in all browsers
|
2019-11-27 15:31:49 +07:00
|
|
|
|
// 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
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-11 23:22:50 +07:00
|
|
|
|
// Correct the inability to style clickable types in iOS and Safari
|
2019-11-27 15:31:49 +07:00
|
|
|
|
button,
|
|
|
|
|
[type="button"],
|
|
|
|
|
[type="reset"],
|
|
|
|
|
[type="submit"] {
|
|
|
|
|
-webkit-appearance: button;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-11 23:22:50 +07:00
|
|
|
|
// Remove the inner border and padding in Firefox
|
2019-11-27 15:31:49 +07:00
|
|
|
|
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%;
|
2020-09-29 08:38:35 +07:00
|
|
|
|
margin-bottom: var(--spacing-typography);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a[role="button"] {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button,
|
|
|
|
|
input[type="submit"],
|
2020-09-24 22:35:30 +07:00
|
|
|
|
input[type="button"],
|
2020-09-29 08:38:35 +07:00
|
|
|
|
input[type="reset"],
|
2020-09-24 22:35:30 +07:00
|
|
|
|
[type="file"]::-webkit-file-upload-button,
|
2019-11-27 15:31:49 +07:00
|
|
|
|
a[role="button"] {
|
2020-09-29 08:38:35 +07:00
|
|
|
|
padding: var(--button-spacing-vertical) var(--button-spacing-horizontal);
|
|
|
|
|
border: var(--button-border-width) solid var(--primary-border);
|
|
|
|
|
border-radius: var(--button-round);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
outline: none;
|
|
|
|
|
background-color: var(--primary);
|
2020-09-29 08:38:35 +07:00
|
|
|
|
box-shadow: var(--button-shadow);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
color: var(--primary-inverse);
|
|
|
|
|
font-size: 1rem;
|
2020-09-29 08:38:35 +07:00
|
|
|
|
font-weight: var(--buttons-weight);
|
|
|
|
|
line-height: var(--line-height);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
text-align: center;
|
|
|
|
|
cursor: pointer;
|
2019-12-02 23:22:13 +07:00
|
|
|
|
|
|
|
|
|
@if $enable-transitions {
|
|
|
|
|
transition:
|
2020-09-29 08:38:35 +07:00
|
|
|
|
background-color var(--transition),
|
|
|
|
|
border-color var(--transition),
|
|
|
|
|
color var(--transition),
|
|
|
|
|
box-shadow var(--transition);
|
2019-12-02 23:22:13 +07:00
|
|
|
|
}
|
2019-11-27 15:31:49 +07:00
|
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
|
&:active,
|
|
|
|
|
&:focus {
|
2020-09-29 08:38:35 +07:00
|
|
|
|
border-color: var(--primary-hover-border);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
background-color: var(--primary-hover);
|
2020-09-29 08:38:35 +07:00
|
|
|
|
box-shadow: var(--button-hover-shadow);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:focus {
|
2020-09-29 08:38:35 +07:00
|
|
|
|
box-shadow: var(--button-hover-shadow), 0 0 0 var(--button-outline-width) var(--primary-focus);
|
2019-11-27 15:31:49 +07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Input [type="reset"]
|
|
|
|
|
input[type="reset"] {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Button [disabled]
|
|
|
|
|
button,
|
|
|
|
|
input[type="submit"],
|
2020-09-24 22:35:30 +07:00
|
|
|
|
input[type="button"],
|
2019-11-27 15:31:49 +07:00
|
|
|
|
input[type="reset"],
|
|
|
|
|
a[role="button"] {
|
|
|
|
|
|
|
|
|
|
&[disabled] {
|
|
|
|
|
opacity: .5;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
|
|
|
|
}
|