aboutsummaryrefslogtreecommitdiff
path: root/htmx/static/pico-1.5.11/scss/layout/_sectioning.scss
blob: 00d73c551f216f3e7ee4218bcfc30b5beaf1832a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
 * Sectioning
 * Container and responsive spacings for header, main, footer
 */

// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
// ––––––––––––––––––––

// Render the `main` element consistently in IE
main {
  display: block;
}

// Pico
// ––––––––––––––––––––

// 1. Remove the margin in all browsers (opinionated)
#{$semantic-root-element} {
  width: 100%;
  margin: 0; // 1

  > header,
  > main,
  > footer {
    width: 100%;
    margin-right: auto;
    margin-left: auto;

    // Semantic container
    @if $enable-semantic-container {
      padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);

      // 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;
          }
        }

        @if map-get($breakpoints, "md") and $enable-viewport {
          @media (min-width: map-get($breakpoints, "md")) {
            max-width: map-get($viewports, "md");
          }
        }

        @if map-get($breakpoints, "lg") and $enable-viewport {
          @media (min-width: map-get($breakpoints, "lg")) {
            max-width: map-get($viewports, "lg");
          }
        }

        @if map-get($breakpoints, "xl") and $enable-viewport {
          @media (min-width: map-get($breakpoints, "xl")) {
            max-width: map-get($viewports, "xl");
          }
        }
      }
    }

    // Semantic container
    @else {
      padding: var(--block-spacing-vertical) 0;
    }
  }
}