five-for-the-future/themes/pub/wporg/css/objects/_buttons.scss

358 lines
7.4 KiB
SCSS
Raw Normal View History

// /* ----------------------------------------------------------------------------
//
// NOTE: If you edit this file, you should make sure that the CSS rules for
// buttons in the following files are updated.
//
// * jquery-ui-dialog.css
// * editor.css
//
// WordPress-style Buttons
// =======================
// Create a button by adding the `.button` class to an element. For backwards
// compatibility, we support several other classes (such as `.button-secondary`),
// but these will *not* work with the stackable classes described below.
//
// Button Styles
// -------------
// To display a primary button style, add the `.button-primary` class to a button.
//
// Button Sizes
// ------------
// Adjust a button's size by adding the `.button-large` or `.button-small` class.
//
// Button States
// -------------
// Lock the state of a button by adding the name of the pseudoclass as
// an actual class (e.g. `.hover` for `:hover`).
//
//
// TABLE OF CONTENTS:
// ------------------
// 1.0 - Button Layouts
// 2.0 - Default Button Style
// 3.0 - Primary Button Style
// 4.0 - Button Groups
// 5.0 - Responsive Button Styles
//
//---------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------
1.0 - Button Layouts
---------------------------------------------------------------------------- */
.button,
.button-primary,
.button-secondary,
.plugin-upload-form .button-primary {
border: 1px solid;
border-radius: 3px;
box-sizing: border-box;
cursor: pointer;
display: inline-block;
font-size: ms( -2 );
height: ms( 4 );
line-height: 1;
margin: 0;
padding: 0 0.8rem;
text-decoration: none;
white-space: nowrap;
-webkit-appearance: none;
}
/* Remove the dotted border on :focus and the extra padding in Firefox */
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner {
border: 0 none;
padding: 0;
}
.button.button-xl,
.button-group.button-xl .button {
font-size: ms( 0 );
height: ms( 8 );
line-height: 1;
padding: 0 1.5rem;
}
.button.button-large,
.button-group.button-large .button {
height: ms( 6 );
line-height: 1;
padding: 0 1rem;
}
.button.button-small,
.button-group.button-small .button {
font-size: ms( -4 );
height: ms( 2 );
line-height: 1;
padding: 0 0.5rem;
}
a.button,
a.button-primary,
a.button-secondary {
line-height: ms( 4 );
}
a.button.button-large,
.button-group.button-large a.button {
line-height: ms( 6 );
}
a.button.button-xl,
.button-group.button-xl a.button {
line-height: ms( 8 );
}
a.button.button-small,
.button-group.button-small a.button {
line-height: ms( 2 );
}
.button:active,
.button:focus {
outline: none;
}
.button.hidden {
display: none;
}
/* Style Reset buttons as simple text links */
input[type="reset"],
input[type="reset"]:hover,
input[type="reset"]:active,
input[type="reset"]:focus {
background: none;
border: none;
box-shadow: none;
padding: 0 2px 1px;
width: auto;
}
/* ----------------------------------------------------------------------------
2.0 - Default Button Style
---------------------------------------------------------------------------- */
.button,
.button:visited,
.button-secondary {
background: #f7f7f7;
border-color: #cccccc;
box-shadow: 0 1px 0 #cccccc;
color: #555;
vertical-align: top;
}
p .button {
vertical-align: baseline;
}
.button.hover,
.button:hover,
.button-secondary:hover,
.button.focus,
.button:focus,
.button-secondary:focus {
background: #fafafa;
border-color: #999;
color: #23282d;
}
.button.focus,
.button:focus,
.button-secondary:focus,
.button-link:focus {
border-color: #5b9dd9;
box-shadow: 0 0 3px rgba( 0, 115, 170, 0.8 );
}
.button.active,
.button.active:hover,
.button:active,
.button-secondary:active {
background: #eee;
border-color: #999;
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
transform: translateY(1px);
}
.button.active:focus {
border-color: #5b9dd9;
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ), 0 0 3px rgba( 0, 115, 170, 0.8 );
}
.button[disabled],
.button:disabled,
.button.disabled,
.button-secondary[disabled],
.button-secondary:disabled,
.button-secondary.disabled,
.button-disabled {
background: #f7f7f7 !important;
border-color: #ddd !important;
box-shadow: none !important;
color: #a0a5aa !important;
cursor: default;
text-shadow: 0 1px 0 #fff !important;
transform: none !important;
}
/* Buttons that look like links, for a cross of good semantics with the visual */
.button-link {
background: none;
border: 0;
border-radius: 0;
box-shadow: none;
cursor: pointer;
margin: 0;
outline: none;
padding: 0;
}
.button-link:focus {
outline: #5b9dd9 solid 1px;
}
/* ----------------------------------------------------------------------------
3.0 - Primary Button Style
---------------------------------------------------------------------------- */
.button-primary,
.download-button,
.plugin-upload-form .button-primary {
background: #0085ba;
border-color: #0073aa #006799 #006799;
box-shadow: 0 1px 0 #006799;
color: #fff;
text-decoration: none;
text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
&:visited {
background: #0085ba;
border-color: #0073aa #006799 #006799;
box-shadow: 0 1px 0 #006799;
color: #fff;
}
&.hover,
&:hover,
&.focus,
&:focus {
background: #008ec2;
border-color: #006799;
box-shadow: 0 1px 0 #006799;
color: #fff;
}
&.focus,
&:focus {
box-shadow: 0 1px 0 #0073aa, 0 0 2px 1px #33b3db;
}
&.active,
&.active:hover,
&.active:focus,
&:active {
background: $color__wp-blue;
border-color: #006799;
box-shadow: inset 0 2px 0 #006799;
vertical-align: top;
}
&[disabled],
&:disabled,
&.disabled {
background: #008ec2 !important;
border-color: #007cb2 !important;
box-shadow: none !important;
color: #66c6e4 !important;
cursor: default;
text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.1 ) !important;
}
&.button.button-hero {
box-shadow: 0 2px 0 #006799;
&.active,
&.active:hover,
&.active:focus,
&:active {
box-shadow: inset 0 3px 0 #006799;
}
}
}
.button-primary-disabled {
background: #008ec2 !important;
border-color: #007cb2 !important;
box-shadow: none !important;
color: #66c6e4 !important;
cursor: default;
text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.1 ) !important;
}
/* ----------------------------------------------------------------------------
4.0 - Button Groups
---------------------------------------------------------------------------- */
.button-group {
display: inline-block;
font-size: 0;
position: relative;
vertical-align: middle;
white-space: nowrap;
}
.button-group > .button {
border-radius: 0;
display: inline-block;
margin-right: -1px;
z-index: 10;
}
.button-group > .button-primary {
z-index: 100;
}
.button-group > .button:hover {
z-index: 20;
}
.button-group > .button:first-child {
border-radius: 3px 0 0 3px;
}
.button-group > .button:last-child {
border-radius: 0 3px 3px 0;
}
.button-group > .button:focus {
position: relative;
z-index: 1;
}
/* ----------------------------------------------------------------------------
5.0 - Responsive Button Styles
---------------------------------------------------------------------------- */
@media screen and ( max-width: $ms-breakpoint ) {
.button,
.button.button-large,
.button.button-small,
.plugin-upload-form .button-primary {
font-size: 14px;
height: auto;
line-height: normal;
margin-bottom: 4px;
padding: 6px 14px;
vertical-align: middle;
}
}