pico/scss/layout/_sectioning.scss

71 lines
1.8 KiB
SCSS
Raw Normal View History

2019-11-27 15:31:49 +07:00
/**
* Sectioning
* Container and responsive spacings for header, main, footer
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
2022-03-06 10:53:20 +07:00
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
2019-11-27 15:31:49 +07:00
//
// Render the `main` element consistently in IE
2019-11-27 15:31:49 +07:00
main {
display: block;
}
// Pico
//
2022-03-06 10:53:20 +07:00
// 1. Remove the margin in all browsers (opinionated)
2019-11-27 15:31:49 +07:00
body {
width: 100%;
2022-03-06 10:53:20 +07:00
margin: 0; // 1
2019-11-27 15:31:49 +07:00
> header,
> main,
> footer {
width: 100%;
margin-right: auto;
margin-left: auto;
2021-07-02 16:54:41 +07:00
// Semantic container
@if $enable-semantic-container {
padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);
2019-11-27 15:31:49 +07:00
2021-07-02 16:54:41 +07:00
// Centered viewport
@if $enable-viewport {
@if map-get($breakpoints, "sm") and $enable-viewport {
@media (min-width: map-get($breakpoints, "sm")) {
max-width: map-get($viewports, "sm");
padding-right: 0;
padding-left: 0;
2019-11-27 15:31:49 +07:00
}
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "md") and $enable-viewport {
@media (min-width: map-get($breakpoints, "md")) {
max-width: map-get($viewports, "md");
}
2019-11-27 15:31:49 +07:00
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "lg") and $enable-viewport {
@media (min-width: map-get($breakpoints, "lg")) {
max-width: map-get($viewports, "lg");
}
2019-11-27 15:31:49 +07:00
}
2021-07-02 16:54:41 +07:00
@if map-get($breakpoints, "xl") and $enable-viewport {
@media (min-width: map-get($breakpoints, "xl")) {
max-width: map-get($viewports, "xl");
}
2019-11-27 15:31:49 +07:00
}
}
}
2021-07-02 16:54:41 +07:00
// Semantic container
@else {
padding: var(--block-spacing-vertical) 0;
2019-11-27 15:31:49 +07:00
}
}
}