0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/docs/public/index.css

516 lines
8.3 KiB
CSS

* {
box-sizing: border-box;
margin: 0;
}
/* Global focus outline reset */
*:focus:not(:focus-visible) {
outline: none;
}
:root {
--user-font-scale: 1rem - 16px;
--max-width: calc(100% - 1rem);
}
@media (min-width: 50em) {
:root {
--max-width: 46em;
}
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
font-family: var(--font-body);
font-size: 1rem;
font-size: clamp(0.9rem, 0.75rem + 0.375vw + var(--user-font-scale), 1rem);
line-height: 1.5;
max-width: 100vw;
}
nav ul {
list-style: none;
padding: 0;
}
.content > section > * + * {
margin-top: 1rem;
}
.content > section > :first-child {
margin-top: 0;
}
/* Typography */
:is(h1, h2, h3, h4, h5, h6) {
margin-bottom: 1rem;
font-weight: bold;
line-height: 1.25;
}
:is(h1, h2) {
max-width: 40ch;
}
:is(h2, h3):not(:first-child) {
margin-top: 3rem;
}
h1 {
font-size: 1.75rem;
}
h2 {
font-size: 1.25rem;
}
h3 {
font-size: 1.125rem;
}
h4 {
font-size: 1rem;
}
h5 {
font-size: 0.8rem;
}
@media (min-width: 60em) {
h1 {
font-size: 2.5rem;
}
h2 {
font-size: 1.75rem;
}
h3 {
font-size: 1.25rem;
}
}
p,
.content ul {
color: var(--theme-text-light);
}
small,
.text_small {
font-size: 0.833rem;
}
a {
color: var(--theme-text-accent);
font-weight: 400;
text-underline-offset: 0.08em;
align-items: center;
gap: 0.5rem;
}
article > section :is(ul, ol) > * + * {
margin-top: 0.75rem;
}
article > section li > :is(p, pre, blockquote):not(:first-child) {
margin-top: 1rem;
}
article > section :is(ul, ol) {
padding-left: 1em;
}
article > section ::marker {
font-weight: bold;
color: var(--theme-text-light);
}
article > section iframe {
width: 100%;
height: auto;
aspect-ratio: 16 / 9;
}
a > code:not([class*='language']) {
position: relative;
color: var(--theme-text-accent);
background: transparent;
text-underline-offset: var(--padding-block);
}
a > code:not([class*='language'])::before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
background: var(--theme-accent);
opacity: var(--theme-accent-opacity);
border-radius: var(--border-radius);
}
a:hover,
a:focus {
text-decoration: underline;
}
a:focus {
outline: 2px solid currentColor;
outline-offset: 0.25em;
}
strong {
font-weight: 600;
color: inherit;
}
/* Supporting Content */
code:not([class*='language']) {
--border-radius: 3px;
--padding-block: 0.2rem;
--padding-inline: 0.33rem;
font-family: var(--font-mono);
font-size: 0.85em;
color: var(--theme-code-inline-text);
background-color: var(--theme-code-inline-bg);
padding: var(--padding-block) var(--padding-inline);
margin: calc(var(--padding-block) * -1) -0.125em;
border-radius: var(--border-radius);
box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 0.08);
}
pre > code:not([class*='language']) {
background-color: transparent;
padding: 0;
margin: 0;
border-radius: 0;
color: inherit;
}
table,
pre {
position: relative;
--padding-block: 1rem;
--padding-inline: 2rem;
padding: var(--padding-block) var(--padding-inline);
padding-right: calc(var(--padding-inline) * 2);
margin-left: calc(var(--padding-inline) * -1);
margin-right: calc(var(--padding-inline) * -1);
font-family: var(--font-mono);
line-height: 1.5;
font-size: 0.85em;
overflow-y: hidden;
overflow-x: auto;
}
table {
width: 100%;
padding: var(--padding-block) 0;
margin: 0;
border-collapse: collapse;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: var(--theme-bg-hover);
}
th {
background: var(--color-black);
color: white;
font-weight: bold;
}
td,
th {
padding: 6px;
text-align: left;
}
pre {
background-color: var(--theme-code-bg);
color: var(--theme-code-text);
}
blockquote code:not([class*='language']) {
background-color: var(--theme-bg);
}
@media (min-width: 37.75em) {
pre {
--padding-inline: 1.25rem;
border-radius: 8px;
margin-left: 0;
margin-right: 0;
}
}
blockquote {
margin: 2rem 0;
padding: 1.25em 1.5rem;
border-left: 3px solid var(--theme-text-light);
background-color: var(--theme-bg-offset);
border-radius: 0 0.25rem 0.25rem 0;
line-height: 1.7;
}
img {
max-width: 100%;
}
.flex {
display: flex;
align-items: center;
}
header {
position: relative;
margin-bottom: 0.5rem;
}
header button {
background-color: var(--theme-bg);
}
header button:hover,
header button:focus {
outline: var(--theme-text) solid 1px;
}
header button:active,
header button[aria-pressed='true'] {
background: var(--theme-text);
color: var(--theme-bg);
}
button {
display: flex;
align-items: center;
justify-items: center;
gap: 0.25em;
padding: 0.33em 0.67em;
border: 0;
background: var(--theme-bg);
display: flex;
font-size: 1rem;
align-items: center;
gap: 0.25em;
border-radius: 99em;
color: var(--theme-text);
background-color: var(--theme-bg);
}
#theme-toggle {
display: flex;
align-items: center;
gap: 0.25em;
padding: 0.33em 0.67em;
border-radius: 99em;
background-color: hsla(215, 28%, 17%, 1);
}
#theme-toggle > label:focus-within {
outline: 2px solid transparent;
box-shadow: 0 0 0 0.08em var(--theme-accent), 0 0 0 0.12em white;
}
#theme-toggle > label {
color: white;
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
width: 1.5rem;
height: 1.5rem;
opacity: 0.5;
transition: transform 120ms ease-out, opacity 120ms ease-out;
}
#theme-toggle > label:hover,
#theme-toggle > label:focus {
transform: scale(1.125);
opacity: 1;
}
#theme-toggle .checked {
color: var(--theme-accent);
transform: scale(1.125);
opacity: 1;
}
input[name='theme-toggle'] {
position: absolute;
opacity: 0;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
}
.sidebar-nav {
width: 100%;
position: sticky;
top: 0;
}
.sidebar-nav-inner {
height: 100%;
padding: 0;
padding-top: 2rem;
overflow: auto;
}
h2.heading {
font-size: 1rem;
font-weight: 700;
padding: 0.1rem 1rem;
text-transform: uppercase;
margin-bottom: 0.5rem;
}
.header-link {
font-size: 1rem;
padding: 0.1rem 0 0.1rem 1rem;
border-left: 4px solid var(--theme-divider);
}
.header-link:hover,
.header-link:focus {
border-left-color: var(--theme-accent);
color: var(--theme-accent);
}
.header-link:focus-within {
color: var(--theme-text-light);
border-left-color: hsla(var(--color-gray-40), 1);
}
.header-link svg {
opacity: 0.6;
}
.header-link:hover svg {
opacity: 0.8;
}
.header-link a {
display: inline-flex;
gap: 0.5em;
width: 100%;
}
.header-link.depth-3 {
padding-left: 2rem;
}
.header-link.depth-4 {
padding-left: 3rem;
}
.header-link a {
font: inherit;
color: inherit;
text-decoration: none;
}
.edit-on-github {
text-decoration: none;
font: inherit;
color: inherit;
font-size: 1rem;
}
/* Screenreader Only Text */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
.focus\:not-sr-only:focus,
.focus\:not-sr-only:focus-visible {
position: static;
width: auto;
height: auto;
padding: 0;
margin: 0;
overflow: visible;
clip: auto;
white-space: normal;
}
.skiplink,
.skiplink:focus,
.skiplink:focus-visible {
position: absolute;
padding: 0.25em;
font-size: larger;
top: 0.5rem;
left: 0.5rem;
z-index: 999;
display: block;
background-color: var(--theme-bg);
color: var(--theme-text-accent);
border-radius: 0.25em;
outline: var(--theme-text-accent) solid 1px;
outline-offset: 0;
}
/* Screenreader Only Text - End */
:target {
scroll-margin-top: 4rem;
}
.logo {
display: flex;
align-items: center;
gap: 0;
font-size: 1rem;
font-weight: 600;
margin: 0;
line-height: 1;
color: hsla(var(--color-base-white), 100%, 1);
text-decoration: none;
transform: translateX(-8px) scale(0.8);
}
@media (min-width: 60em) {
.logo {
transform: translateX(-8px) scale(1);
}
}
.logo a {
padding: 0.5em 0.25em;
margin: -0.5em -0.5em;
}
.logo svg {
height: 40px;
width: auto;
display: block;
color: var(--theme-accent);
}
.logo a:hover,
.logo a:focus {
background: hsla(var(--color-orange), 0.6);
}
.logo a:hover svg,
.logo a:focus svg {
color: hsla(var(--color-base-white), 100%, 1);
}
.logo h1 {
font: inherit;
color: inherit;
margin: 0;
}