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

406 lines
9.1 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;
border: 1px solid color(var(--lightgrey) l(-4%));
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%));
border-radius: 6px;
transition: none;
-webkit-font-smoothing: subpixel-antialiased;
}
/* ALL buttons must have a span for content */
.gh-btn span {
display: block;
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;
border-radius: 5px;
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;
}
/* 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 inset rgba(255,255,255,0.1);
}
/* 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(
color(var(--green) blackness(+7%)),
color(var(--green) l(-10%) saturation(-10%))
);
box-shadow: 0 1px 0 rgba(0,0,0,0.12);
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(
color(var(--green) whiteness(+5%)),
color(var(--green) l(-4%) saturation(-8%)) 60%,
color(var(--green) l(-4%) saturation(-8%)) 90%,
color(var(--green) l(-4%) saturation(-10%))
);
box-shadow: 0 1px 0 inset rgba(255,255,255,0.1);
2015-05-14 16:45:37 +03:00
}
/* When clicked or focused with keyboard */
.gh-btn-green:active,
.gh-btn-green:focus {
background: color(var(--green) l(-10%) saturation(-10%));
}
.gh-btn-green:active span,
.gh-btn-green:focus span {
background: color(var(--green) l(-4%) saturation(-8%));
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 inset rgba(255,255,255,0.1);
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 inset rgba(255,255,255,0.1);
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
/* Grey button
2015-05-15 23:18:24 +03:00
/* ---------------------------------------------------------- */
/* 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;
2015-05-14 16:45:37 +03:00
}
/* 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: inset 0 1px 0 #fff;
2015-05-14 16:45:37 +03:00
}
/* 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%));
2015-05-16 14:43:12 +03:00
box-shadow: none;
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;
}
.gh-btn-icon svg {
margin-right: 10px;
height: 15px;
2015-05-14 16:45:37 +03:00
}
/*
/* Loading Button Spinner
2015-05-14 16:45:37 +03:00
/* ---------------------------------------------------------- */
/*
2015-05-14 16:45:37 +03:00
Usage: Swap out button>span text with HTML
<a class="gh-btn gh-btn-blue">
<span>
<div class="gh-spinner"></div>
</span>
</div>
*/
.gh-spinner {
position: relative;
display: inline-block;
width: 18px;
height: 18px;
border: rgba(0,0,0,0.2) solid 4px;
border-radius: 100%;
animation: spin 1s linear infinite;
2015-05-14 16:45:37 +03:00
}
.gh-spinner:before {
content: "";
display: block;
margin-top: 9px;
width: 4px;
height: 4px;
background: rgba(0,0,0,0.6);
border-radius: 100%;
2015-05-14 16:45:37 +03:00
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
/*
/* 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-lg {
padding: 12px 18px;
border-radius: 4px;
font-size: 1.4rem;
line-height: 1.33;
}
.gh-btn-sm {
padding: 7px 10px;
border-radius: 2px;
font-size: 1rem;
line-height: 1.5;
}
.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;
}