pagetop/assets/scss/basic/_navbar.scss
Manuel Cillero d83f8b0f7f 💄 Renueva los estilos de Basic y Bootsier
- Bootsier: paleta propia a partir del logotipo, campos rellenos con
  sombra al enfocar, fieldsets y mensajes con sombra en vez de borde,
  desplegables sin borde, migas con fondo y paginador adaptable.
- Bootsier: quita la rejilla de Bootstrap (la maquetación es de Flex y
  Grid) y el container-fluid interior de la barra de navegación.
- Basic: margen inferior en campos y bloques, padding lateral en el
  envoltorio de la página y paginador que se reparte en varias líneas.
- Nuevo ejemplo theme-showcase con todos los componentes en los dos
  temas.
2026-11-16 14:22:18 +01:00

121 lines
3.3 KiB
SCSS

@use "breakpoints" as bp;
// No side padding, so the bar lines up with the rest of the page (fixed bars below get it back).
.navbar {
display: flex;
align-items: center;
gap: 1rem;
padding-block: 0.5rem;
}
.navbar-toggle {
display: none;
padding: 0.25rem 0.5rem;
font-size: 1.25rem;
line-height: 1;
color: inherit;
background-color: transparent;
border: 1px solid var(--val-color--border);
border-radius: 0.375rem;
cursor: pointer;
}
.navbar-toggle::before {
content: "\2630";
}
// Pushes the toggle (`BrandLeft`) or the brand (`BrandRight`) to the far end of the bar.
.brand ~ .navbar-toggle,
.navbar-toggle ~ .brand {
margin-inline-start: auto;
}
.navbar-content {
display: flex;
align-items: center;
gap: 1rem;
flex: 1 1 auto;
}
// A bar without a toggle button never stacks its `.nav` items in a column, so they wrap onto
// another line when they don't fit instead of overflowing the bar.
.navbar-content .nav {
flex-wrap: wrap;
}
.navbar-text {
color: var(--val-color--text--muted);
}
// Navbar position, from the `navbar::Position` classes. `.navbar` has no background of its own, so
// a bar taken out of the flow (fixed) or pinned while scrolling (sticky) gets one, or the content
// passing underneath would show through.
.navbar.fixed-top,
.navbar.fixed-bottom,
.navbar.sticky-top,
.navbar.sticky-bottom {
background-color: var(--val-color--bg);
}
// Fixed bars span the whole viewport, so they keep some side padding off its edges.
.navbar.fixed-top,
.navbar.fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
padding-inline: 1rem;
}
.navbar.fixed-top {
top: 0;
}
.navbar.fixed-bottom {
bottom: 0;
}
.navbar.sticky-top,
.navbar.sticky-bottom {
position: sticky;
z-index: 1020;
}
.navbar.sticky-top {
top: 0;
}
.navbar.sticky-bottom {
bottom: 0;
}
// A navbar with a toggle button collapses below the breakpoint set by its `navbar-expand-{name}`
// class, added by the `Navbar` component. `navbar-expand` alone (a breakpoint with no minimum
// width) never collapses and needs no rules, since the base rules above are the expanded layout.
//
// While collapsed, the `.nav` items are stacked in a column, so a dropdown menu inside it is laid
// out in the flow (`position: static`) to push down the following items instead of covering them.
// A navbar without a toggle button has nothing to collapse: its `.nav` items stay in a row.
@each $name, $width in bp.$breakpoints {
@media (width < $width) {
.navbar-expand-#{$name} {
flex-wrap: wrap;
}
.navbar-expand-#{$name}:has(.navbar-toggle) {
.navbar-toggle {
display: inline-block;
}
.navbar-content {
order: 1;
display: none;
flex-direction: column;
align-items: stretch;
width: 100%;
}
.navbar-content.show {
display: flex;
}
.nav {
flex-direction: column;
align-items: stretch;
width: 100%;
}
.nav .dropdown-menu {
position: static;
box-shadow: none;
}
}
}
}