Ghost/ghost/admin/app/styles/patterns/buttons.css

464 lines
9.9 KiB
CSS
Raw Normal View History

2015-05-14 16:45:37 +03:00
/* Buttons
/* ---------------------------------------------------------- */
2015-05-15 23:18:24 +03:00
/* Base button style */
/* Should only be applied to <a> tags */
.gh-btn {
display: inline-block;
outline: none;
background: var(--white);
box-shadow: 0 2px 5px -3px rgba(0,0,0,.12);
color: color-mod(var(--midgrey) l(-7%));
text-decoration: none !important;
user-select: none;
fill: color-mod(var(--midgrey) l(-7%));
border: 1px solid color-mod(var(--midgrey) l(+35%) s(+10%));
2017-02-17 17:10:02 +03:00
border-radius: 5px;
transition: all 0.2s ease;
transition-property: color, border-color, background, width, height, box-shadow;
-webkit-font-smoothing: subpixel-antialiased;
}
/* ALL buttons must have a span for content */
.gh-btn span {
display: block;
overflow: hidden;
padding: 0 11px;
height: 33px;
font-size: 1.3rem;
line-height: 33px;
font-weight: 400;
2015-05-14 16:45:37 +03:00
text-align: center;
letter-spacing: 0.2px;
2017-02-17 17:10:02 +03:00
border-radius: 4px;
white-space: nowrap;
text-overflow: ellipsis;
2017-02-17 17:10:02 +03:00
}
.gh-btn:hover {
color: var(--darkgrey);
box-shadow: 0 3px 4px -3px rgba(0,0,0,.13);
border-color: color-mod(var(--midgrey) l(+25%) s(+10%));
2015-05-14 16:45:37 +03:00
}
2015-05-15 23:18:24 +03:00
/* When disabled */
.gh-btn.disabled,
.gh-btn[disabled],
fieldset[disabled] .gh-btn {
2015-05-16 14:43:12 +03:00
box-shadow: none;
opacity: 0.8;
2015-05-14 16:45:37 +03:00
cursor: not-allowed;
pointer-events: none;
}
.gh-btn svg {
display: inline-block;
}
2017-02-17 17:10:02 +03:00
/* Button highlights
/* ---------------------------------------------------------- */
.gh-btn-hover-blue:hover {
color: var(--blue);
border-color: var(--blue);
2017-02-17 17:10:02 +03:00
}
.gh-btn-hover-green:hover {
color: var(--green);
border-color: var(--green);
2017-02-17 17:10:02 +03:00
}
.gh-btn-hover-red:hover {
color: var(--red);
border-color: var(--red);
2017-02-17 17:10:02 +03:00
}
/* Grey button - First so that other colors will override
/* ---------------------------------------------------------- */
/* The background of the button creates 1px gradient border */
.gh-btn-grey {
padding: 1px;
border: 0;
fill: var(--darkgrey);
transition: none !important;
}
/* The background of the span is the main visual element */
.gh-btn-grey span {
background: color-mod(var(--lightgrey) l(-5%));
}
/* When clicked or focused with keyboard */
.gh-btn-grey:active,
.gh-btn-grey:focus {
background: color-mod(var(--midgrey) l(+25%));
}
.gh-btn-grey:active span,
.gh-btn-grey:focus span {
background: color-mod(var(--lightgrey) l(+15%));
box-shadow: none;
}
/* Blue button
/* ---------------------------------------------------------- */
/* The background of the button creates 1px gradient border */
.gh-btn-blue,
.gh-btn-blue:hover {
border: 1px solid color-mod(var(--blue) s(-5%));
color: #fff;
fill: #fff;
box-shadow: none;
transition-property: box-shadow;
}
.gh-btn-blue:hover {
box-shadow: none;
}
/* The background of the span is the main visual element */
.gh-btn-blue span {
background: linear-gradient(color-mod(var(--blue) l(+6%) s(-1%)), color-mod(var(--blue) l(-6%) saturation(-8%)));
font-weight: 500;
}
.gh-btn-blue:hover span {
background: linear-gradient(color-mod(var(--blue) l(+9%) s(-1%)), color-mod(var(--blue) l(-3%) saturation(-3%)));
}
/* When clicked or focused with keyboard */
.gh-btn-blue:active,
.gh-btn-blue:focus {
background: color-mod(var(--blue) l(-20%) saturation(-15%));
}
.gh-btn-blue:active span,
.gh-btn-blue:focus span {
background: color-mod(var(--blue) l(-7%) saturation(-10%));
box-shadow: none;
}
2015-05-14 16:45:37 +03:00
/* Green button
2015-05-14 16:45:37 +03:00
/* ---------------------------------------------------------- */
/* The background of the button creates 1px gradient border */
.gh-btn-green,
.gh-btn-green:hover {
border: 1px solid color-mod(var(--green) s(-5%));
2015-05-16 14:43:12 +03:00
color: #fff;
fill: #fff;
box-shadow: none;
transition-property: box-shadow;
}
.gh-btn-green:hover {
box-shadow: none;
2015-05-14 16:45:37 +03:00
}
/* The background of the span is the main visual element */
.gh-btn-green span {
background: linear-gradient(color-mod(var(--green) l(+6%) s(-2%)), color-mod(var(--green) l(-8%) s(+5%)));
font-weight: 500;
}
.gh-btn-green:hover span {
background: linear-gradient(color-mod(var(--green) l(+9%) s(-1%)), color-mod(var(--green) l(-3%) saturation(-3%)));
2015-05-14 16:45:37 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-green:active,
.gh-btn-green:focus {
background: color-mod(var(--green) l(-9%) saturation(-9%));
}
.gh-btn-green:active span,
.gh-btn-green:focus span {
background: color-mod(var(--green) l(-3%) saturation(-7%));
box-shadow: none;
}
2015-05-15 23:18:24 +03:00
/* Red button
2015-05-15 23:18:24 +03:00
/* ---------------------------------------------------------- */
/* The background of the button creates 1px gradient border */
.gh-btn-red,
.gh-btn-red:hover {
border: 1px solid color-mod(var(--red) s(-5%));
2015-05-16 14:43:12 +03:00
color: #fff;
fill: #fff;
box-shadow: none;
transition-property: box-shadow;
}
.gh-btn-red:hover {
box-shadow: none;
2015-05-15 23:18:24 +03:00
}
/* The background of the span is the main visual element */
.gh-btn-red span {
background: linear-gradient(
color-mod(var(--red) whiteness(+7%)),
color-mod(var(--red) l(-7%) saturation(-10%)) 60%,
color-mod(var(--red) l(-7%) saturation(-10%)) 90%,
color-mod(var(--red) l(-4%) saturation(-10%))
);
font-weight: 500;
}
.gh-btn-red:hover span {
background: linear-gradient(color-mod(var(--red) l(+7%) s(-1%)), color-mod(var(--red) l(-5%) saturation(-3%)));
2015-05-15 23:18:24 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-red:active,
.gh-btn-red:focus {
background: color-mod(var(--red) l(-20%) saturation(-15%));
}
.gh-btn-red:active span,
.gh-btn-red:focus span {
background: color-mod(var(--red) l(-7%) saturation(-10%));
box-shadow: none;
}
2015-05-15 23:18:24 +03:00
/* Black button
2015-05-15 23:18:24 +03:00
/* ---------------------------------------------------------- */
/* The background of the button creates 1px gradient border */
.gh-btn-black,
.gh-btn-black:hover {
border: 0;
2015-05-16 14:43:12 +03:00
color: #fff;
fill: #fff;
box-shadow: none;
transition-property: box-shadow;
}
.gh-btn-black:hover {
box-shadow: 0 4px 5px -3px rgba(0,0,0,.1);
2015-05-15 23:18:24 +03:00
}
/* The background of the span is the main visual element */
.gh-btn-black span {
background: linear-gradient(
color-mod(var(--darkgrey) whiteness(+7%)),
color-mod(var(--darkgrey) l(-7%) saturation(-10%)) 60%,
color-mod(var(--darkgrey) l(-7%) saturation(-10%)) 90%,
color-mod(var(--darkgrey) l(-4%) saturation(-10%))
);
font-weight: 500;
height: 35px;
line-height: 35px;
2015-05-15 23:18:24 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-black:active,
.gh-btn-black:focus {
background: color-mod(var(--darkgrey) l(-20%) saturation(-15%));
}
.gh-btn-black:active span,
.gh-btn-black:focus span {
background: color-mod(var(--darkgrey) l(-7%) saturation(-10%));
box-shadow: none;
}
2015-05-15 23:18:24 +03:00
2015-05-14 16:45:37 +03:00
/* Special Buttons
2015-05-14 16:45:37 +03:00
/* ---------------------------------------------------------- */
.gh-btn-white {
border: none;
background: var(--white);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.01), 0 1px 2px rgba(0, 0, 0, 0.05);
outline: none;
}
.gh-btn-white:hover {
background: var(--white);
}
.gh-btn-white span {
height: 35px;
line-height: 35px;
}
.gh-btn-strong {
border-color: color-mod(var(--midgrey) l(+25%));
2015-05-15 23:18:24 +03:00
}
.gh-btn-block {
display: block;
width: 100%;
}
.gh-btn-icon span {
display: flex;
align-items: center;
justify-content: center;
}
.gh-btn-icon svg,
.gh-btn-block svg {
width: 1em;
height: 1em;
margin-right: 0.5em;
fill: #fff;
}
.gh-btn-icon svg.gh-spinner {
left: 5px;
}
.gh-btn-icon svg.gh-spinner rect {
fill: color-mod(var(--midgrey) l(+15%));
}
.gh-btn-icon-right svg,
svg.gh-btn-icon-right {
margin-left: 0.5em;
margin-right: 0;
}
.gh-btn-icon svg path {
stroke: #fff;
}
.gh-btn-icon-no-margin {
margin: 0;
}
2019-11-07 07:09:47 +03:00
.gh-btn-icon-grey svg {
fill: var(--midgrey);
}
.gh-btn-icon-grey svg path {
stroke: var(--midgrey);
}
.gh-btn-text,
.gh-btn-text:hover {
display: flex;
align-items: center;
border: none;
background: none;
box-shadow: none;
padding: 0;
margin: 0;
font-weight: 300;
}
.gh-btn-text span {
height: unset;
line-height: unset;
padding: 0;
}
.gh-btn-text.regular span {
font-size: 1.4rem;
color: var(--darkgrey);
}
2015-05-14 16:45:37 +03:00
/*
/* Button Variations
/* ---------------------------------------------------------- */
.gh-btn-block {
2015-05-14 16:45:37 +03:00
display: block;
width: 100%;
}
2015-05-15 23:18:24 +03:00
/* Vertically space out multiple block buttons */
.gh-btn-block + .gh-btn-block {
2015-05-14 16:45:37 +03:00
margin-top: 5px;
}
2015-05-15 23:18:24 +03:00
/* Specificity overrides */
input[type="submit"].gh-btn-block,
input[type="reset"].gh-btn-block,
input[type="button"].gh-btn-block {
2015-05-14 16:45:37 +03:00
width: 100%;
}
/*
/* Button Groups
/* ---------------------------------------------------------- */
/*
Usage: CTA buttons grouped together horizontally.
<div class="gh-btn-group">
<a class="gh-btn gh-btn-green" href="#"><span>Button 1</span></a>
<a class="gh-btn gh-btn-white" href="#"><span>Button 2</span></a>
</div>
*/
.gh-btn-group .gh-btn {
margin-left: 15px;
}
.gh-btn-group .gh-btn {
margin: 0;
border-radius: 0 0 0 0;
border: none;
border-left: 1px solid var(--whitegrey);
}
.gh-btn-group .gh-btn:first-of-type {
border-radius: 5px 0 0 5px;
border: none;
}
.gh-btn-group .gh-btn:last-of-type {
border-radius: 0 5px 5px 0;
}
.gh-btn-group .gh-btn-group-selected span {
color: var(--blue);
font-weight: 500;
}
.gh-btn-block + .gh-btn-block {
margin-top: 5px;
}
.gh-btn-link {
border: none;
background: none;
box-shadow: none;
}
.gh-btn-link:hover {
background: none;
box-shadow: none;
}
/* Spin Buttons!
/* ---------------------------------------------------------- */
.spinner {
position: relative;
display: inline-block;
box-sizing: border-box;
margin: -2px 0;
width: 14px;
height: 14px;
border: rgba(0,0,0,0.2) solid 4px;
border-radius: 100px;
animation: spin 1s linear infinite;
}
.spinner:before {
content: "";
display: block;
margin-top: 6px;
width: 4px;
height: 4px;
background: rgba(0,0,0,0.6);
border-radius: 100px;
}