UNPKG

1.84 kBSCSSView Raw
1/**
2 * Sectioning
3 * Container and responsive spacings for header, main, footer
4 */
5
6// Reboot based on :
7// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
8// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
9// ––––––––––––––––––––
10
11// Render the `main` element consistently in IE
12main {
13 display: block;
14}
15
16// Pico
17// ––––––––––––––––––––
18
19// 1. Remove the margin in all browsers (opinionated)
20#{$semantic-root-element} {
21 width: 100%;
22 margin: 0; // 1
23
24 > header,
25 > main,
26 > footer {
27 width: 100%;
28 margin-right: auto;
29 margin-left: auto;
30
31 // Semantic container
32 @if $enable-semantic-container {
33 padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);
34
35 // Centered viewport
36 @if $enable-viewport {
37 @if map-get($breakpoints, "sm") and $enable-viewport {
38 @media (min-width: map-get($breakpoints, "sm")) {
39 max-width: map-get($viewports, "sm");
40 padding-right: 0;
41 padding-left: 0;
42 }
43 }
44
45 @if map-get($breakpoints, "md") and $enable-viewport {
46 @media (min-width: map-get($breakpoints, "md")) {
47 max-width: map-get($viewports, "md");
48 }
49 }
50
51 @if map-get($breakpoints, "lg") and $enable-viewport {
52 @media (min-width: map-get($breakpoints, "lg")) {
53 max-width: map-get($viewports, "lg");
54 }
55 }
56
57 @if map-get($breakpoints, "xl") and $enable-viewport {
58 @media (min-width: map-get($breakpoints, "xl")) {
59 max-width: map-get($viewports, "xl");
60 }
61 }
62 }
63 }
64
65 // Semantic container
66 @else {
67 padding: var(--block-spacing-vertical) 0;
68 }
69 }
70}