File: page_navbar.scss

package info (click to toggle)
r-cran-bslib 0.9.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,412 kB
  • sloc: javascript: 13,349; makefile: 33; sh: 23
file content (39 lines) | stat: -rw-r--r-- 1,207 bytes parent folder | download
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
.navbar+.container-fluid {

  // When the tab/page is fillable, undo the padding on the container-fluid
  // (in this case, the user has control over padding/gap)
  &:has(> .tab-content > .tab-pane.active.html-fill-container) {
    padding-left: 0;
    padding-right: 0;
  }

  // When the tab/page is fillable, add sensible default padding
  >.tab-content>.tab-pane.active.html-fill-container {
    padding: var(--bslib-spacer, 1rem);
    gap: var(--bslib-spacer, 1rem);

    // ...but if it holds a single sidebar layout, remove the padding
    &:has(> .bslib-sidebar-layout:only-child) {
      padding: 0;
    }

    // And smart border defaults for nav_panel("Foo", layout_sidebar())
    >.bslib-sidebar-layout:only-child {
      &:not([data-bslib-sidebar-border="true"]) {
        border-left: none;
        border-right: none;
        border-bottom: none;
      }

      &:not([data-bslib-sidebar-border-radius="true"]) {
        border-radius: 0;
      }
    }
  }
}

// Make sure a border appears between the navbar and the sidebar layout
// (especially important when page_navbar(inverse = FALSE, sidebar = sidebar())
.navbar+div>.bslib-sidebar-layout {
  border-top: var(--bslib-sidebar-border);
}