pico/docs/scss/layout/_main.scss

87 lines
2.0 KiB
SCSS
Raw Normal View History

2019-11-27 22:10:02 +07:00
/**
* Docs: Main (Grid)
*/
2021-07-02 16:54:41 +07:00
// Config
2019-11-27 22:10:02 +07:00
$navHeight: 3.5rem;
2021-07-02 16:54:41 +07:00
// Main grid
2019-11-27 22:10:02 +07:00
body > main {
2021-07-02 16:54:41 +07:00
padding-top: calc(var(--block-spacing-vertical) + #{$navHeight});
2019-11-27 22:10:02 +07:00
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
--block-spacing-horizontal: calc(var(--spacing) * 1.75);
grid-column-gap: calc(var(--block-spacing-horizontal) * 4);
display: grid;
grid-template-columns: 200px auto;
}
2019-11-27 22:10:02 +07:00
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "xl") {
@media (min-width: map-get($breakpoints, "xl")) {
--block-spacing-horizontal: calc(var(--spacing) * 2);
}
2019-11-27 22:10:02 +07:00
}
2021-07-02 16:54:41 +07:00
> aside,
div[role="document"] {
min-width: 0;
2019-11-27 22:10:02 +07:00
}
}
// Anchors hacks for internal links
div[role="document"] > section::before {
2021-07-02 16:54:41 +07:00
2019-11-27 22:10:02 +07:00
display: block;
2021-07-02 16:54:41 +07:00
height: calc(2rem + #{$navHeight} - .5rem);
margin-top: calc(-2rem - #{$navHeight} + .5rem);
2019-11-27 22:10:02 +07:00
content: '';
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
height: calc(2.5rem + #{$navHeight} - .5rem);
height: calc(-2.5rem - #{$navHeight} + .5rem);
}
2019-11-27 22:10:02 +07:00
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "md") {
@media (min-width: map-get($breakpoints, "md")) {
height: calc(3rem + #{$navHeight} - .5rem);
margin-top: calc(-3rem - #{$navHeight} + .5rem);
}
2019-11-27 22:10:02 +07:00
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
height: calc(3.5rem + #{$navHeight} - .5rem);
margin-top: calc(-3.5rem - #{$navHeight} + .5rem);
}
2019-11-27 22:10:02 +07:00
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "xl") {
@media (min-width: map-get($breakpoints, "xl")) {
height: calc(4rem + #{$navHeight} - .5rem);
margin-top: calc(-4rem - #{$navHeight} + .5rem);
}
2019-11-27 22:10:02 +07:00
}
}
// External links
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: '';
}
// Embedded SVG
svg {
height: 1rem;
}