pico/docs/css/pico.docs.css

492 lines
11 KiB
CSS
Raw Normal View History

2019-11-27 18:35:19 +07:00
/*!
* Pico: Customs styles for Docs
*/
/**
* Theme: Additions for docs
2019-11-27 18:35:19 +07:00
*/
2020-09-29 08:38:35 +07:00
:root {
2020-09-29 10:54:26 +07:00
--icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(115, 130, 140, 0.999)' opacity='0.66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E");
--icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFF' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-check-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(0, 0, 0, 0.75)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
2020-09-29 08:38:35 +07:00
}
2019-11-27 18:35:19 +07:00
[data-theme="light"],
:root:not([data-theme="dark"]) {
--nav-background: rgba(255, 255, 255, 0.7);
--nav-border: rgba(115, 130, 140, 0.2);
2019-11-27 18:35:19 +07:00
}
@media only screen and (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--nav-background: rgba(16, 24, 30, 0.8);
--nav-border: rgba(115, 130, 140, 0.2);
2019-11-27 18:35:19 +07:00
}
}
[data-theme="dark"] {
--nav-background: rgba(16, 24, 30, 0.8);
--nav-border: rgba(115, 130, 140, 0.2);
2019-11-27 18:35:19 +07:00
}
/**
* Docs: Document
*/
html {
scroll-behavior: smooth;
}
2019-11-27 18:35:19 +07:00
/**
2019-11-27 22:10:02 +07:00
* Docs: Main (Grid)
2019-11-27 18:35:19 +07:00
*/
body > main {
2020-09-29 08:38:35 +07:00
padding-top: calc(1rem * var(--spacing-factor-xs) + 3.5rem);
2019-11-27 18:35:19 +07:00
}
@media (min-width: 576px) {
body > main {
2020-09-29 08:38:35 +07:00
padding-top: calc(1rem * var(--spacing-factor-sm) + 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 768px) {
body > main {
2020-09-29 08:38:35 +07:00
padding-top: calc(1rem * var(--spacing-factor-md) + 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 992px) {
body > main {
2020-09-29 08:38:35 +07:00
grid-column-gap: calc(var(--spacing-gutter) * 4);
2019-11-27 18:35:19 +07:00
display: grid;
grid-template-columns: 200px auto;
2020-09-29 08:38:35 +07:00
padding-top: calc(1rem * var(--spacing-factor-lg) + 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 1200px) {
body > main {
2020-09-29 08:38:35 +07:00
padding-top: calc(1rem * var(--spacing-factor-xl) + 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
body > main > * {
min-width: 0;
}
div[role="document"] > section::before {
2019-11-27 18:35:19 +07:00
display: block;
2020-09-29 08:38:35 +07:00
height: calc(1rem * var(--spacing-factor-xs) + 3.5rem);
margin-top: calc(-1rem * var(--spacing-factor-xs) - 3.5rem);
2019-11-27 18:35:19 +07:00
content: '';
}
@media (min-width: 576px) {
div[role="document"] > section::before {
2020-09-29 08:38:35 +07:00
height: calc(1rem * var(--spacing-factor-sm) + 3.5rem);
margin-top: calc(-1rem * var(--spacing-factor-sm) - 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 768px) {
div[role="document"] > section::before {
2020-09-29 08:38:35 +07:00
height: calc(1rem * var(--spacing-factor-md) + 3.5rem);
margin-top: calc(-1rem * var(--spacing-factor-md) - 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 992px) {
div[role="document"] > section::before {
2020-09-29 08:38:35 +07:00
height: calc(1rem * var(--spacing-factor-lg) + 3.5rem);
margin-top: calc(-1rem * var(--spacing-factor-lg) - 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 1200px) {
div[role="document"] > section::before {
2020-09-29 08:38:35 +07:00
height: calc(1rem * var(--spacing-factor-xl) + 3.5rem);
margin-top: calc(-1rem * var(--spacing-factor-xl) - 3.5rem);
2019-11-27 18:35:19 +07:00
}
}
div[role="document"] section a[href*="//"]:not([href*="https://picocss.com"]):not([role])::after {
display: inline-block;
width: 1rem;
height: 1rem;
2020-09-29 08:38:35 +07:00
background-image: var(--icon-external);
background-position: top center;
background-repeat: no-repeat;
background-size: .66rem auto;
content: '';
}
form.grid > input:not([type=checkbox]):not([type=radio]),
form.grid > button {
margin-bottom: 0;
}
2019-11-27 22:10:02 +07:00
/**
* Docs: Aside
*/
2019-11-27 18:35:19 +07:00
main > aside nav {
width: 100%;
2020-09-29 08:38:35 +07:00
margin-bottom: var(--spacing-block);
2019-11-27 18:35:19 +07:00
}
main > aside nav h1 {
2020-09-29 08:38:35 +07:00
margin-bottom: var(--spacing-typography);
2019-11-27 18:35:19 +07:00
}
@media (min-width: 992px) {
main > aside nav {
position: fixed;
width: 200px;
max-height: calc(100vh - 5.5rem);
margin-bottom: 0;
overflow-x: hidden;
overflow-y: auto;
}
main > aside nav h1 {
display: none;
}
}
main > aside li, main > aside summary {
padding-top: 0;
padding-bottom: 0;
font-size: 16px;
}
2019-11-27 22:10:02 +07:00
main > aside li a {
padding: 0.375rem 0.5rem;
}
main > aside li a svg {
vertical-align: middle;
}
2019-11-27 18:35:19 +07:00
main > aside a.secondary:focus {
background-color: transparent;
color: var(--primary-hover);
}
2019-12-11 08:46:32 +07:00
main > aside a.active,
main > aside a.active:hover {
color: var(--primary);
}
2019-11-27 18:35:19 +07:00
main > aside details {
padding-bottom: .25rem;
border-bottom: none;
}
main > aside details summary {
color: var(--h3);
font-size: 14px;
2019-11-27 18:35:19 +07:00
font-weight: 300;
text-transform: uppercase;
}
main > aside details summary::after {
display: none;
}
main > aside details[open] summary {
color: var(--h3);
}
2019-11-27 22:10:02 +07:00
/**
* Docs: Documentation
*/
#themes button i {
font-style: normal;
}
2019-11-27 18:35:19 +07:00
#customization figure {
display: grid;
grid-template-columns: repeat(9, 1fr);
grid-template-rows: repeat(2, 1fr);
margin-bottom: 0;
overflow: hidden;
}
@media (min-width: 576px) {
#customization figure {
grid-template-columns: repeat(18, 1fr);
grid-template-rows: 1fr;
2020-09-29 08:38:35 +07:00
border-top-right-radius: var(--block-round);
border-top-left-radius: var(--block-round);
2019-11-27 18:35:19 +07:00
}
}
#customization figure ~ article {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
#customization figure button {
margin-bottom: 0;
padding: 0;
padding-top: 100%;
border: none;
border-radius: 0;
}
#customization figure button:focus {
box-shadow: none;
}
#customization figure button.picked {
2020-09-29 08:38:35 +07:00
background-image: var(--icon-check);
2019-11-27 18:35:19 +07:00
background-position: center;
background-repeat: no-repeat;
background-size: .66rem auto;
box-shadow: inset 0 0 1rem 0 rgba(0, 0, 0, 0.25);
}
2020-09-29 10:54:26 +07:00
#customization figure button[data-color="lime"].picked, #customization figure button[data-color="yellow"].picked, #customization figure button[data-color="amber"].picked {
background-image: var(--icon-check-dark);
}
2019-11-27 18:35:19 +07:00
#customization h4 {
2020-09-29 08:38:35 +07:00
transition: color var(--transition);
2019-11-27 18:35:19 +07:00
}
#customization pre[data-theme="generated"] {
border-color: var(--primary);
}
#grids button {
display: block;
width: 100%;
2020-09-29 08:38:35 +07:00
margin-bottom: calc(var(--spacing-typography) / 2);
}
@media (min-width: 576px) {
#grids button {
display: inline-block;
width: auto;
margin-right: .5rem;
}
2019-11-27 18:35:19 +07:00
}
#grids button svg {
stroke: var(--secondary);
margin-right: .5rem;
2020-09-29 13:15:05 +07:00
border: 2px solid currentColor;
2019-11-27 18:35:19 +07:00
border-radius: 1rem;
background: currentColor;
}
#grids .grid > * {
2020-09-29 08:38:35 +07:00
padding: calc(var(--spacing-gutter) / 2) 0;
2019-11-27 18:35:19 +07:00
background: var(--code-background);
text-align: center;
}
#grids details {
2020-09-29 08:38:35 +07:00
margin-top: calc(var(--spacing-typography) * 2);
}
2020-09-29 13:15:05 +07:00
#grids details svg {
vertical-align: bottom;
}
#forms div.grid {
grid-row-gap: 0;
}
2019-11-27 22:10:02 +07:00
/**
* Docs: Typography
*/
section > hgroup {
2020-09-29 08:38:35 +07:00
margin-bottom: calc(var(--spacing-typography) * 2);
2019-11-27 22:10:02 +07:00
}
a[role=button] {
2020-09-29 08:38:35 +07:00
margin-right: calc(var(--spacing-typography) / 4);
margin-bottom: var(--spacing-typography);
2019-11-27 22:10:02 +07:00
}
[role=document] section > h1,
[role=document] section > h2,
[role=document] section > h3 {
line-height: 1;
}
2019-11-27 18:35:19 +07:00
/**
* Docs: Code
*/
@media (min-width: 576px) {
pre {
2020-09-29 08:38:35 +07:00
padding: var(--spacing-block) calc(var(--spacing-block) * var(--spacing-factor-sm));
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 768px) {
pre {
2020-09-29 08:38:35 +07:00
padding: var(--spacing-block) calc(var(--spacing-block) * var(--spacing-factor-md));
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 992px) {
pre {
2020-09-29 08:38:35 +07:00
padding: var(--spacing-block) calc(var(--spacing-block) * var(--spacing-factor-lg));
2019-11-27 18:35:19 +07:00
}
}
@media (min-width: 1200px) {
pre {
2020-09-29 08:38:35 +07:00
padding: var(--spacing-block) calc(var(--spacing-block) * var(--spacing-factor-xl));
2019-11-27 18:35:19 +07:00
}
}
[data-theme="invalid"],
[data-theme="valid"] {
position: relative;
margin-bottom: 0 !important;
}
[data-theme="invalid"]:before,
[data-theme="valid"]:before {
display: block;
position: absolute;
top: 0;
2019-12-03 09:51:37 +07:00
right: 0;
2019-11-27 18:35:19 +07:00
padding: .375rem .75rem;
border-radius: 0;
color: var(--primary-inverse);
font-size: 14px;
line-height: 1;
}
@media (min-width: 992px) {
[data-theme="invalid"]:before,
[data-theme="valid"]:before {
2020-09-29 08:38:35 +07:00
top: var(--spacing-gutter);
right: var(--spacing-gutter);
2019-11-27 18:35:19 +07:00
}
}
2019-12-03 09:51:37 +07:00
[data-theme="invalid"] code,
[data-theme="valid"] code {
padding: 1rem 0;
2019-11-27 18:35:19 +07:00
}
[data-theme="invalid"]:before {
background: var(--invalid);
2019-12-03 09:51:37 +07:00
content: 'Not so great';
2019-11-27 18:35:19 +07:00
}
[data-theme="valid"]:before {
background: var(--valid);
content: 'Great';
}
/**
* Docs: Navs
*/
body > nav {
-webkit-backdrop-filter: saturate(180%) blur(20px);
z-index: 99;
position: fixed;
top: 0;
right: 0;
left: 0;
backdrop-filter: saturate(180%) blur(20px);
background-color: var(--nav-background);
box-shadow: 0px 1px 0 var(--nav-border);
}
2019-12-11 08:46:32 +07:00
body > nav a {
2019-11-27 18:35:19 +07:00
border-radius: 0;
}
body > nav a svg {
vertical-align: text-bottom;
}
2019-11-27 18:35:19 +07:00
body > nav ul:first-of-type li:first-of-type a {
width: 3.5rem;
height: 3.5rem;
2020-09-29 08:38:35 +07:00
margin-left: calc(var(--spacing-gutter) * -1);
2019-11-27 18:35:19 +07:00
padding: 0;
background: var(--h1);
color: var(--background);
}
body > nav ul:first-of-type li:nth-of-type(2) {
display: none;
2020-09-29 08:38:35 +07:00
margin-left: var(--spacing-gutter);
color: var(--h1);
2019-11-27 18:35:19 +07:00
}
@media (min-width: 992px) {
body > nav ul:first-of-type li:nth-of-type(2) {
display: inline;
}
}
/**
* Docs: Theme switcher
*/
2019-12-11 08:46:32 +07:00
.switcher {
2019-11-27 18:35:19 +07:00
position: fixed;
2020-09-29 08:38:35 +07:00
right: calc(var(--spacing-gutter) / 2);
bottom: var(--spacing-gutter);
2019-11-27 18:35:19 +07:00
width: auto;
margin-bottom: 0;
padding: .75rem;
border-radius: 2rem;
2020-09-29 08:38:35 +07:00
box-shadow: var(--card-shadow);
2019-11-27 18:35:19 +07:00
line-height: 1;
text-align: right;
}
2019-12-11 08:46:32 +07:00
.switcher::after {
2019-11-27 18:35:19 +07:00
display: inline-block;
width: 1rem;
height: 1rem;
2019-12-09 13:36:40 +07:00
border: 0.15rem solid currentColor;
2019-11-27 18:35:19 +07:00
border-radius: 50%;
background: linear-gradient(to right, currentColor 0%, currentColor 50%, transparent 50%);
vertical-align: bottom;
content: '';
2020-09-29 08:38:35 +07:00
transition: transform var(--transition);
2019-11-27 18:35:19 +07:00
}
2019-12-11 08:46:32 +07:00
.switcher i {
2019-11-27 18:35:19 +07:00
display: inline-block;
max-width: 0;
padding: 0;
overflow: hidden;
font-size: .875rem;
font-style: normal;
white-space: nowrap;
}
2019-12-11 08:46:32 +07:00
.switcher:hover, .switcher:focus {
2019-11-27 18:35:19 +07:00
max-width: 100%;
2020-09-29 08:38:35 +07:00
transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
2019-11-27 18:35:19 +07:00
}
2019-12-11 08:46:32 +07:00
.switcher:hover::after {
2019-11-27 18:35:19 +07:00
transform: rotate(180deg);
}
2019-12-11 08:46:32 +07:00
.switcher:hover i {
2019-11-27 18:35:19 +07:00
max-width: 100%;
2020-09-29 08:38:35 +07:00
padding: 0 calc(var(--spacing-gutter) / 2) 0 calc(var(--spacing-gutter) / 4);
transition: max-width var(--transition), padding var(--transition);
2019-11-27 18:35:19 +07:00
}
2019-12-11 08:46:32 +07:00
.switcher:focus {
2019-11-27 18:35:19 +07:00
box-shadow: var(--card-shadow), 0 0 0 0.2rem var(--secondary-focus);
}
@media (min-width: 576px) {
2019-12-11 08:46:32 +07:00
.switcher {
2020-09-29 08:38:35 +07:00
right: var(--spacing-gutter);
2019-11-27 18:35:19 +07:00
}
}