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

397 lines
9.0 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;
2017-02-17 17:10:02 +03:00
border: 1px solid color(var(--lightgrey) l(-5%) s(-10%));
color: color(var(--lightgrey) l(-27%) blackness(+15%));
text-shadow: 0 1px 0 #fff;
text-decoration: none !important;
user-select: none;
fill: color(var(--lightgrey) l(-27%) blackness(+15%));
2017-02-17 17:10:02 +03:00
border-radius: 5px;
transition: all 0.2s ease;
transition-property: color, border-color, background, width, height;
-webkit-font-smoothing: subpixel-antialiased;
}
/* ALL buttons must have a span for content */
.gh-btn span {
display: block;
overflow: hidden;
padding: 0 12px;
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 {
border-color: color(var(--lightgrey) l(-15%) 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 {
border-color: var(--blue);
color: var(--blue);
}
.gh-btn-hover-green:hover {
border-color: var(--green);
color: var(--green);
}
.gh-btn-hover-red:hover {
border-color: var(--red);
color: var(--red);
}
/* 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;
color: color(var(--darkgrey) l(+15%));
text-shadow: 0 1px 0 #fff;
fill: var(--darkgrey);
background: linear-gradient(
color(var(--lightgrey) l(-3%)),
color(var(--lightgrey) l(-8%))
);
box-shadow: 0 1px 0 rgba(0,0,0,0.05);
transition: none !important;
}
/* The background of the span is the main visual element */
.gh-btn-grey span {
background: linear-gradient(
color(var(--lightgrey) l(+10%)),
color(var(--lightgrey) l(+4%))
);
box-shadow: 0 1px 0 #fff inset;
}
/* When clicked or focused with keyboard */
.gh-btn-grey:active,
.gh-btn-grey:focus {
background: color(var(--midgrey) l(+25%));
}
.gh-btn-grey:active span,
.gh-btn-grey:focus span {
background: color(var(--lightgrey) l(+15%));
box-shadow: none;
}
/* Blue button
/* ---------------------------------------------------------- */
/* The background of the button creates 1px gradient border */
.gh-btn-blue {
padding: 1px;
border: 0;
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.1);
fill: #fff;
background: linear-gradient(
color(var(--blue) blackness(+10%)),
color(var(--blue) l(-15%) saturation(-15%))
);
box-shadow: 0 1px 0 rgba(0,0,0,0.12);
transition: none !important;
}
/* The background of the span is the main visual element */
.gh-btn-blue span {
background: linear-gradient(
color(var(--blue) whiteness(+5%)),
color(var(--blue) l(-5%) saturation(-8%)) 60%,
color(var(--blue) l(-5%) saturation(-8%)) 90%,
color(var(--blue) l(-3%) saturation(-8%))
);
box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
}
/* When clicked or focused with keyboard */
.gh-btn-blue:active,
.gh-btn-blue:focus {
background: color(var(--blue) l(-20%) saturation(-15%));
}
.gh-btn-blue:active span,
.gh-btn-blue:focus span {
background: color(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 {
padding: 1px;
border: 0;
2015-05-16 14:43:12 +03:00
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.1);
fill: #fff;
background: linear-gradient(
2017-02-17 17:10:02 +03:00
color(var(--green) blackness(+5%)),
color(var(--green) l(-9%) saturation(-9%))
);
2017-02-17 17:10:02 +03:00
box-shadow: 0 1px 1px rgba(0,0,0,0.14);
transition: none !important;
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(
2017-02-17 17:10:02 +03:00
color(var(--green) whiteness(+4%)),
color(var(--green) l(-3%) saturation(-7%)) 60%,
color(var(--green) l(-3%) saturation(-7%)) 90%,
color(var(--green) l(-3%) saturation(-9%))
);
box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
2015-05-14 16:45:37 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-green:active,
.gh-btn-green:focus {
2017-02-17 17:10:02 +03:00
background: color(var(--green) l(-9%) saturation(-9%));
}
.gh-btn-green:active span,
.gh-btn-green:focus span {
2017-02-17 17:10:02 +03:00
background: color(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 {
padding: 1px;
border: 0;
2015-05-16 14:43:12 +03:00
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.1);
fill: #fff;
background: linear-gradient(
color(var(--red) blackness(+10%)),
color(var(--red) l(-15%) saturation(-15%))
);
box-shadow: 0 1px 0 rgba(0,0,0,0.12);
transition: none !important;
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(var(--red) whiteness(+7%)),
color(var(--red) l(-7%) saturation(-10%)) 60%,
color(var(--red) l(-7%) saturation(-10%)) 90%,
color(var(--red) l(-4%) saturation(-10%))
);
box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
2015-05-15 23:18:24 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-red:active,
.gh-btn-red:focus {
background: color(var(--red) l(-20%) saturation(-15%));
}
.gh-btn-red:active span,
.gh-btn-red:focus span {
background: color(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 {
padding: 1px;
border: 0;
2015-05-16 14:43:12 +03:00
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.1);
fill: #fff;
background: linear-gradient(
color(var(--darkgrey) blackness(+10%)),
color(var(--darkgrey) l(-15%) saturation(-15%))
);
box-shadow: 0 1px 0 rgba(0,0,0,0.12);
transition: none !important;
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(var(--darkgrey) whiteness(+7%)),
color(var(--darkgrey) l(-7%) saturation(-10%)) 60%,
color(var(--darkgrey) l(-7%) saturation(-10%)) 90%,
color(var(--darkgrey) l(-4%) saturation(-10%))
);
box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
2015-05-15 23:18:24 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-black:active,
.gh-btn-black:focus {
background: color(var(--darkgrey) l(-20%) saturation(-15%));
}
.gh-btn-black:active span,
.gh-btn-black:focus span {
background: color(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 {
background: #fff;
}
.gh-btn-white span {
height: 38px;
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-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;
}
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:first-of-type {
margin-left: 0;
}
.gh-btn-block + .gh-btn-block {
margin-top: 5px;
}
.gh-btn-link {
border: 0;
}
/* 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;
}