```
/* ==================================================
X NATIVE FLOATING NAVIGATION
Version 4.1.0 Stable
X Navigation + Apple Native Glass
Discourse Mobile Tab Bar
Features:
- Native Discourse Layout Preservation
- Floating Glass Capsule
- Light / Dark Mode
- Circular Active Highlight
- Native Touch Feedback
- Small Screen Adaptation
- Reduced Transparency Support
- Reduced Motion Support
- Backdrop Filter Fallback
================================================== */
/* ==================================================
01. DESIGN TOKENS
================================================== */
:root {
--x4-blue: #1d9bf0;
--x4-blue-active: #1685d4;
--x4-glass: rgba(255, 255, 255, 0.15);
--x4-glass-border: rgba(255, 255, 255, 0.75);
--x4-active-bg: rgba(15, 20, 25, 0.07);
--x4-active: #0f1419;
--x4-inactive: #71767b;
--x4-shadow:
0 8px 30px rgba(15, 20, 25, 0.10),
0 2px 8px rgba(15, 20, 25, 0.05),
inset 0 1px 0 rgba(255, 255, 255, 0.85);
--x4-blur: 32px;
--x4-height: 66px;
--x4-radius: 999px;
}
/* ==================================================
02. DARK MODE
================================================== */
html.dark,
body.dark,
.dark {
--x4-glass: rgba(25, 27, 30, 0.25);
--x4-glass-border: rgba(255, 255, 255, 0.12);
--x4-active-bg: rgba(255, 255, 255, 0.11);
--x4-active: #f7f9f9;
--x4-inactive: #71767b;
--x4-shadow:
0 8px 30px rgba(0, 0, 0, 0.32),
0 2px 8px rgba(0, 0, 0, 0.16),
inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* ==================================================
03. MOBILE BREAKPOINT
================================================== */
@media (max-width: 767px) {
/* ==================================================
04. OUTER NAVIGATION
Preserve Discourse Native Layout
================================================== */
nav.mobile-tab-bar {
background: transparent !important;
border: none !important;
box-shadow: none !important;
overflow: visible !important;
/*
Preserve Discourse original:
position
bottom
left
right
width
height
padding
display
flex-direction
z-index
*/
}
/* Hidden views remain controlled by Discourse */
nav.mobile-tab-bar > .mobile-tab-bar__views {
background: rgba(250, 250, 252, 0.15) !important;
border: 1px solid rgba(255, 255, 255, 0.55);
border-radius: 18px;
backdrop-filter: blur(20px) saturate(180%);
-webkit-backdrop-filter: blur(20px) saturate(180%);
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.06),
inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.dark nav.mobile-tab-bar > .mobile-tab-bar__views {
background: rgba(32, 32, 36, 0.3) !important;
border-color: rgba(255, 255, 255, 0.12);
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.20),
inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* ==================================================
05. FLOATING GLASS CAPSULE
================================================== */
nav.mobile-tab-bar > .mobile-tab-bar__controls {
position: relative !important;
box-sizing: border-box !important;
width: calc(100% - 24px) !important;
max-width: 620px;
height: var(--x4-height) !important;
min-height: var(--x4-height) !important;
margin: 0 auto 8px !important;
padding: 8px 10px !important;
display: flex !important;
align-items: center !important;
gap: 7px;
background: var(--x4-glass) !important;
border: 1px solid var(--x4-glass-border) !important;
border-radius: var(--x4-radius) !important;
box-shadow: var(--x4-shadow) !important;
backdrop-filter:
saturate(190%)
blur(var(--x4-blur));
-webkit-backdrop-filter:
saturate(190%)
blur(var(--x4-blur));
isolation: isolate;
overflow: visible !important;
transform: translateZ(0);
transition:
background 0.25s ease,
box-shadow 0.25s ease;
}
/* Glass Edge Reflection */
.mobile-tab-bar__controls::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
pointer-events: none;
background: linear-gradient(
180deg,
rgba(255, 255, 255, 0.25),
transparent 55%
);
opacity: 0.75;
}
/* Dark Glass Reflection */
.dark .mobile-tab-bar__controls::before {
background: linear-gradient(
180deg,
rgba(255, 255, 255, 0.08),
transparent 55%
);
}
/* ==================================================
06. MENU BUTTON
================================================== */
.mobile-tab-bar__menu {
flex: 0 0 42px !important;
width: 42px !important;
min-width: 42px !important;
height: 42px !important;
padding: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
color: var(--x4-inactive) !important;
background: transparent !important;
border: none !important;
border-radius: 50% !important;
box-shadow: none !important;
-webkit-tap-highlight-color: transparent;
}
.mobile-tab-bar__menu svg {
width: 21px !important;
height: 21px !important;
}
/* ==================================================
07. TAB TRACK
================================================== */
.mobile-tab-bar__tabs {
flex: 1 1 auto !important;
min-width: 0;
}
.mobile-tab-bar__track {
position: relative;
display: flex;
align-items: center;
justify-content: space-around;
width: 100%;
min-height: 46px;
background: transparent !important;
border-radius: 999px !important;
}
/* Original Discourse Sliding Highlight */
.mobile-tab-bar__highlight {
background: var(--x4-active-bg) !important;
border-radius: 50% !important;
height: 42px !important;
/*
Preserve Discourse original:
transform
left
width
sliding logic
*/
}
/* ==================================================
08. TAB BUTTONS
================================================== */
.mobile-tab-bar__tab {
position: relative;
flex: 1 1 0;
min-width: 0 !important;
min-height: 44px !important;
height: 44px !important;
padding: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
color: var(--x4-inactive) !important;
background: transparent !important;
border: none !important;
border-radius: 50% !important;
box-shadow: none !important;
-webkit-tap-highlight-color: transparent;
transition:
color 0.2s ease,
opacity 0.18s ease,
transform 0.18s cubic-bezier(.2,.8,.2,1);
}
/* Selected Tab */
.mobile-tab-bar__tab.--active {
color: var(--x4-active) !important;
}
/* Icon Wrapper */
.mobile-tab-bar__indicator {
display: flex !important;
align-items: center !important;
justify-content: center !important;
color: inherit !important;
}
/* SVG Icons */
.mobile-tab-bar__indicator svg {
width: 22px !important;
height: 22px !important;
color: inherit !important;
}
/* Active Icon */
.mobile-tab-bar__tab.--active
.mobile-tab-bar__indicator svg {
transform: scale(1.04);
}
/* Accessible Text */
.mobile-tab-bar__label {
display: none !important;
}
/* ==================================================
09. MORE BUTTON
================================================== */
.mobile-tab-bar__more {
color: var(--x4-inactive) !important;
border-radius: 50% !important;
-webkit-tap-highlight-color: transparent;
}
/* ==================================================
10. BADGES
================================================== */
.mobile-tab-bar__badge {
background: #f4212e !important;
color: #ffffff !important;
border: 2px solid var(--x4-glass);
border-radius: 999px;
}
/* ==================================================
11. CREATE BUTTON
================================================== */
.mobile-tab-bar-create-trigger {
flex: 0 0 46px !important;
width: 46px !important;
min-width: 46px !important;
height: 46px !important;
min-height: 46px !important;
padding: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
background: var(--x4-blue) !important;
color: #ffffff !important;
border: none !important;
border-radius: 50% !important;
box-shadow:
0 3px 12px rgba(29, 155, 240, 0.30),
inset 0 1px 0 rgba(255, 255, 255, 0.25)
!important;
-webkit-tap-highlight-color: transparent;
transition:
transform 0.18s ease,
background 0.18s ease,
box-shadow 0.18s ease;
}
.mobile-tab-bar-create-trigger svg {
width: 21px !important;
height: 21px !important;
color: #ffffff !important;
}
.mobile-tab-bar-create-trigger:active {
transform: scale(0.90);
background: var(--x4-blue-active) !important;
box-shadow: none !important;
}
/* ==================================================
12. TOUCH INTERACTION
================================================== */
.mobile-tab-bar__controls button {
-webkit-tap-highlight-color: transparent;
}
.mobile-tab-bar__tab:active,
.mobile-tab-bar__menu:active,
.mobile-tab-bar__more:active {
transform: scale(0.92);
}
/* ==================================================
13. SMALL SCREENS
================================================== */
@media (max-width: 380px) {
nav.mobile-tab-bar > .mobile-tab-bar__controls {
width: calc(100% - 16px) !important;
padding: 7px !important;
gap: 4px;
}
.mobile-tab-bar__menu {
flex-basis: 38px !important;
width: 38px !important;
min-width: 38px !important;
}
.mobile-tab-bar-create-trigger {
flex-basis: 42px !important;
width: 42px !important;
min-width: 42px !important;
height: 42px !important;
min-height: 42px !important;
}
.mobile-tab-bar__indicator svg {
width: 21px !important;
height: 21px !important;
}
}
/* ==================================================
14. REDUCED TRANSPARENCY
================================================== */
@media (prefers-reduced-transparency: reduce) {
.mobile-tab-bar__controls {
background: #ffffff !important;
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
}
.dark .mobile-tab-bar__controls {
background: #191b1e !important;
}
}
/* ==================================================
15. REDUCED MOTION
================================================== */
@media (prefers-reduced-motion: reduce) {
.mobile-tab-bar__controls *,
.mobile-tab-bar__controls *::before,
.mobile-tab-bar__controls *::after {
transition: none !important;
animation: none !important;
}
}
/* ==================================================
16. BROWSER FALLBACK
================================================== */
@supports not (
(backdrop-filter: blur(1px)) or
(-webkit-backdrop-filter: blur(1px))
) {
nav.mobile-tab-bar > .mobile-tab-bar__controls {
background: rgba(250, 250, 252, 0.96) !important;
}
.dark nav.mobile-tab-bar > .mobile-tab-bar__controls {
background: rgba(32, 32, 36, 0.96) !important;
}
}
} /* END MOBILE BREAKPOINT */
/* ==================================================
END: X NATIVE FLOATING NAVIGATION 4.1.0
================================================== */
```
Ho creato un nuovo stile per questa barra delle schede in basso: se vi piace, potete provarlo. Basta creare un nuovo tema componente e incollarlo nel CSS.
Il tema utilizzato è Terraglass — a frosted-glass theme with considered light/dark palettes di @terraboss
@ismax forse assomiglia un po’ al Liquid Glass di iOS 26; ecco lo screenshot:
