App y Dashboard appdashboardsaasconstructiontopbarshellpopovertheme
Construction OS Topbar
Barra superior de Site OS con ruta de hoja, selector de obra con meteorología, cambio entre plano azul y papel de calco, alertas y usuario.
Vista Previa en Vivo
Strukto / Site OS / Cuadro de mando
Avisos de obra
Raúl Garrido · Jefe de obra
Uso
Copia y pega este código directamente en tu página de Astro:
astro
---
import { ConstructionOsTopbar } from 'astro-component-kit/app';
---
<ConstructionOsTopbar page="Cuadro de mando" signOutHref="/preview/construction/sign-in" /> ---
import { ConstructionOsTopbar } from 'astro-component-kit/app';
---
<ConstructionOsTopbar page="Cuadro de mando" signOutHref="/preview/construction/sign-in" /> Ejemplos en contexto
Código real del kit: cómo se usa esta pieza dentro de plantillas, secciones y otros componentes.
ConstructionAppLayout.astro astro
<ConstructionOsTopbar
page={names[current]}
sites={constructionSites.map((s) => ({ id: s.id, name: s.name, weather: s.weather }))}
activeSite="s1"
notifications={notifications}
links={[{ label: 'Web pública', href: routes.home }, { label: 'Diario de hoy', href: routes.dailyLog }, { label: 'Ajustes', href: routes.settings }]}
signOutHref={routes.signIn}
/> <ConstructionOsTopbar
page={names[current]}
sites={constructionSites.map((s) => ({ id: s.id, name: s.name, weather: s.weather }))}
activeSite="s1"
notifications={notifications}
links={[{ label: 'Web pública', href: routes.home }, { label: 'Diario de hoy', href: routes.dailyLog }, { label: 'Ajustes', href: routes.settings }]}
signOutHref={routes.signIn}
/> Se usa en
Combina bien con
Instalación Manual
Si no estás usando el paquete npm, crea un archivo nuevo y pega el siguiente código: src/components/lib/ConstructionOSTopbar.astro:
astro
---
/**
* ConstructionOsTopbar — Top bar for the Strukto Site OS: menu button for the layer panel on
* phones, a sheet path (STRUKTO / SITE OS / page), the active-site selector with its weather,
* a theme toggle (blueprint / tracing paper), alerts and the user menu (native popovers).
*
* @param {string} page - Current page name for the sheet path.
* @param {Array<{id: string, name: string, weather: string}>} sites - Sites for the selector.
* @param {string} activeSite - Selected site id.
* @param {{name: string, role: string}} user - Signed-in user.
* @param {Array<{title: string, text: string, time: string, unread?: boolean}>} notifications - Alerts.
* @param {Array<{label: string, href: string}>} links - Extra links in the user menu.
* @param {string} signOutHref - Sign out link.
* @param {string} navId - Id of the sidebar the menu button controls. Default 'sk-os-nav'.
* @param {string} variant - 'solid' | 'glass'. Default 'solid'.
* @param {string} size - 'md' | 'lg'. Default 'md'.
* @param {string} class - Extra class for the root.
*
* Accessibility: <header> landmark; the menu button has aria-expanded / aria-controls and Escape
* closes the panel and returns focus; the site selector is labelled and announces the weather of
* the chosen site; popover triggers expose aria-expanded.
*/
import type { HTMLAttributes } from 'astro/types';
import '../templates/construction/construction-theme.css';
interface Note { title: string; text: string; time: string; unread?: boolean }
interface OwnProps {
page?: string;
sites?: Array<{ id: string; name: string; weather: string }>;
activeSite?: string;
user?: { name: string; role: string };
notifications?: Note[];
links?: Array<{ label: string; href: string }>;
signOutHref?: string;
navId?: string;
variant?: 'solid' | 'glass';
size?: 'md' | 'lg';
}
type Props = OwnProps & Omit<HTMLAttributes<'header'>, keyof OwnProps | 'class'> & { class?: string };
const {
page = 'Cuadro de mando',
sites = [],
activeSite,
user = { name: 'Raúl Garrido', role: 'Jefe de obra' },
notifications = [],
links = [],
signOutHref = '#',
navId = 'sk-os-nav',
variant = 'solid',
size = 'md',
class: classAttr,
...rest
} = Astro.props;
const unread = notifications.filter((n) => n.unread).length;
const initials = user.name.split(' ').map((p) => p.charAt(0)).slice(0, 2).join('');
const current = sites.find((s) => s.id === activeSite) ?? sites[0];
const uid = `sk-top-${Math.random().toString(36).slice(2, 7)}`;
---
<header class:list={['sk-ui', 'sk-top', `sk-top--${variant}`, `sk-top--${size}`, classAttr]} data-sk-top data-nav={navId} {...rest}>
<button type="button" class="sk-top__menu" aria-expanded="false" aria-controls={navId} data-menu>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h10" /></svg>
<span class="sk-sr">Capas de navegación</span>
</button>
<p class="sk-top__path sk-mono"><span>Strukto</span> / <span>Site OS</span> / <b>{page}</b></p>
{sites.length ? (
<label class="sk-top__site">
<span class="sk-sr">Obra activa</span>
<select data-site>
{sites.map((s) => <option value={s.id} data-weather={s.weather} selected={s.id === current?.id}>{s.name}</option>)}
</select>
<span class="sk-top__weather sk-mono" data-weather-out>{current?.weather}</span>
</label>
) : null}
<div class="sk-top__actions">
<button type="button" class="sk-top__icon" data-theme-toggle aria-label="Cambiar entre plano azul y papel de calco">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="4" y="4" width="16" height="16" /><path d="M4 12h16M12 4v16" /></svg>
</button>
<button type="button" class="sk-top__icon" popovertarget={`${uid}-n`} aria-expanded="false" aria-label={unread ? `Avisos, ${unread} sin leer` : 'Avisos'}>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M12 3 2 20h20zM12 10v4M12 17v.5" /></svg>
{unread ? <span class="sk-top__dot sk-mono" aria-hidden="true">{unread}</span> : null}
</button>
<div id={`${uid}-n`} popover class="sk-top__pop" aria-label="Avisos">
<p class="sk-top__pop-h sk-mono">Avisos de obra</p>
<ul role="list">
{notifications.map((n) => (
<li class:list={[{ 'is-unread': n.unread }]}><strong>{n.title}</strong><span>{n.text}</span><time class="sk-mono">{n.time}</time></li>
))}
</ul>
</div>
<button type="button" class="sk-top__user" popovertarget={`${uid}-u`} aria-expanded="false">
<span class="sk-top__avatar sk-mono" aria-hidden="true">{initials}</span>
<span class="sk-top__uname">{user.name}<small class="sk-mono">{user.role}</small></span>
</button>
<div id={`${uid}-u`} popover class="sk-top__pop" aria-label="Menú de usuario">
<p class="sk-top__pop-h sk-mono">{user.name} · {user.role}</p>
<ul role="list">
{links.map((l) => <li><a href={l.href}>{l.label}</a></li>)}
<li><a href={signOutHref} class="sk-top__out">Cerrar sesión</a></li>
</ul>
</div>
</div>
<p class="sk-sr" role="status" aria-live="polite" data-live></p>
</header>
<script>
function initSkTop() {
document.querySelectorAll<HTMLElement>('[data-sk-top]').forEach((root) => {
if (root.dataset.bound) return;
root.dataset.bound = 'true';
const live = root.querySelector<HTMLElement>('[data-live]')!;
const menu = root.querySelector<HTMLButtonElement>('[data-menu]')!;
const nav = document.getElementById(root.dataset.nav ?? '');
const setOpen = (open: boolean) => {
menu.setAttribute('aria-expanded', String(open));
nav?.classList.toggle('is-open', open);
};
menu.addEventListener('click', () => setOpen(menu.getAttribute('aria-expanded') !== 'true'));
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && menu.getAttribute('aria-expanded') === 'true') {
setOpen(false);
menu.focus();
}
});
const site = root.querySelector<HTMLSelectElement>('[data-site]');
site?.addEventListener('change', () => {
const opt = site.selectedOptions[0];
const w = opt?.dataset.weather ?? '';
root.querySelector('[data-weather-out]')!.textContent = w;
live.textContent = `Obra activa: ${opt?.textContent}. ${w}.`;
try {
localStorage.setItem('sk-site', site.value);
} catch {}
});
try {
const saved = localStorage.getItem('sk-site');
if (site && saved && [...site.options].some((o) => o.value === saved)) {
site.value = saved;
root.querySelector('[data-weather-out]')!.textContent = site.selectedOptions[0]?.dataset.weather ?? '';
}
} catch {}
root.querySelector('[data-theme-toggle]')?.addEventListener('click', () => {
const next = document.documentElement.dataset.theme === 'light' ? 'dark' : 'light';
document.documentElement.dataset.theme = next;
try {
localStorage.setItem('ack-theme', next);
} catch {}
live.textContent = next === 'light' ? 'Tema papel de calco.' : 'Tema plano azul.';
});
root.querySelectorAll<HTMLElement>('[popover]').forEach((pop) => {
const trigger = root.querySelector<HTMLElement>(`[popovertarget="${pop.id}"]`);
pop.addEventListener('toggle', (e) => trigger?.setAttribute('aria-expanded', String((e as ToggleEvent).newState === 'open')));
});
});
}
initSkTop();
document.addEventListener('astro:page-load', initSkTop);
</script>
<style>
.sk-top {
position: sticky;
top: 0;
z-index: 50;
display: flex;
align-items: center;
gap: 14px;
min-height: 64px;
padding: 8px 16px;
border-bottom: 1px solid var(--sk-line);
background: var(--sk-bg);
color: var(--sk-ink);
font-family: var(--sk-font-body);
box-sizing: border-box;
}
.sk-top--glass {
background: var(--sk-glass);
backdrop-filter: blur(10px);
}
.sk-top__menu {
display: none;
place-items: center;
flex: none;
width: 44px;
height: 44px;
border: 1px solid var(--sk-line-soft);
background: transparent;
color: var(--sk-ink);
cursor: pointer;
}
.sk-top__menu[aria-expanded='true'] {
border-color: var(--sk-accent);
color: var(--sk-accent);
}
@media (max-width: 1023px) {
.sk-top__menu {
display: grid;
}
}
.sk-top__path {
margin: 0;
color: var(--sk-ink-3);
font-size: 0.72rem;
text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}
.sk-top__path b {
color: var(--sk-ink);
font-weight: 600;
}
.sk-top__site {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
min-width: 0;
}
.sk-top__site select {
min-height: 44px;
max-width: 230px;
padding: 0 10px;
border: 1px solid var(--sk-line-soft);
border-radius: var(--sk-radius);
background: var(--sk-panel);
color: var(--sk-ink);
font: inherit;
font-size: 0.88rem;
min-width: 0;
}
.sk-top__weather {
color: var(--sk-ink-3);
font-size: 0.72rem;
white-space: nowrap;
}
.sk-top__actions {
display: flex;
align-items: center;
gap: 8px;
}
.sk-top__icon {
position: relative;
display: grid;
place-items: center;
width: 44px;
height: 44px;
border: 1px solid var(--sk-line-soft);
background: transparent;
color: var(--sk-ink);
cursor: pointer;
}
.sk-top__dot {
position: absolute;
top: -6px;
right: -6px;
display: grid;
place-items: center;
min-width: 18px;
height: 18px;
background: var(--sk-accent);
color: var(--sk-on-accent);
font-size: 0.66rem;
}
.sk-top__user {
display: flex;
align-items: center;
gap: 8px;
min-height: 44px;
padding: 2px 10px 2px 2px;
border: 1px solid var(--sk-line-soft);
background: transparent;
color: var(--sk-ink);
font: inherit;
cursor: pointer;
}
.sk-top__avatar {
display: grid;
place-items: center;
width: 38px;
height: 38px;
background: var(--sk-line);
color: var(--sk-bg);
font-size: 0.8rem;
font-weight: 600;
}
.sk-top__uname {
display: grid;
text-align: left;
font-size: 0.85rem;
line-height: 1.15;
}
.sk-top__uname small {
color: var(--sk-ink-3);
font-size: 0.66rem;
text-transform: uppercase;
}
.sk-top :is(button, select, a):focus-visible {
outline: 2px solid var(--sk-accent);
outline-offset: 2px;
}
.sk-top__pop {
position: fixed;
inset: 72px 12px auto auto;
width: min(340px, calc(100vw - 24px));
margin: 0;
padding: 12px;
border: 1px solid var(--sk-line);
background: var(--sk-panel);
color: var(--sk-ink);
font-family: var(--sk-font-body);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.sk-top__pop-h {
margin: 0 0 8px;
color: var(--sk-accent);
font-size: 0.72rem;
text-transform: uppercase;
}
.sk-top__pop ul {
display: grid;
gap: 4px;
margin: 0;
padding: 0;
list-style: none;
}
.sk-top__pop li {
display: grid;
padding: 8px;
border-left: 2px solid transparent;
font-size: 0.88rem;
}
.sk-top__pop li.is-unread {
border-left-color: var(--sk-accent);
background: var(--sk-fill);
}
.sk-top__pop li span {
color: var(--sk-ink-2);
}
.sk-top__pop li time {
color: var(--sk-ink-3);
font-size: 0.7rem;
}
.sk-top__pop a {
display: flex;
align-items: center;
min-height: 44px;
margin: -8px;
padding: 0 8px;
color: var(--sk-ink);
text-decoration: none;
}
.sk-top__pop a:hover {
background: var(--sk-fill);
}
.sk-top__out {
color: var(--sk-accent) !important;
}
@media (max-width: 1279px) {
.sk-top__uname,
.sk-top__weather {
display: none;
}
.sk-top__user {
padding: 2px;
}
}
@media (max-width: 760px) {
.sk-top__path {
display: none;
}
.sk-top__site select {
max-width: 150px;
}
}
@media (max-width: 400px) {
.sk-top [data-theme-toggle] {
display: none;
}
}
</style> ---
/**
* ConstructionOsTopbar — Top bar for the Strukto Site OS: menu button for the layer panel on
* phones, a sheet path (STRUKTO / SITE OS / page), the active-site selector with its weather,
* a theme toggle (blueprint / tracing paper), alerts and the user menu (native popovers).
*
* @param {string} page - Current page name for the sheet path.
* @param {Array<{id: string, name: string, weather: string}>} sites - Sites for the selector.
* @param {string} activeSite - Selected site id.
* @param {{name: string, role: string}} user - Signed-in user.
* @param {Array<{title: string, text: string, time: string, unread?: boolean}>} notifications - Alerts.
* @param {Array<{label: string, href: string}>} links - Extra links in the user menu.
* @param {string} signOutHref - Sign out link.
* @param {string} navId - Id of the sidebar the menu button controls. Default 'sk-os-nav'.
* @param {string} variant - 'solid' | 'glass'. Default 'solid'.
* @param {string} size - 'md' | 'lg'. Default 'md'.
* @param {string} class - Extra class for the root.
*
* Accessibility: <header> landmark; the menu button has aria-expanded / aria-controls and Escape
* closes the panel and returns focus; the site selector is labelled and announces the weather of
* the chosen site; popover triggers expose aria-expanded.
*/
import type { HTMLAttributes } from 'astro/types';
import '../templates/construction/construction-theme.css';
interface Note { title: string; text: string; time: string; unread?: boolean }
interface OwnProps {
page?: string;
sites?: Array<{ id: string; name: string; weather: string }>;
activeSite?: string;
user?: { name: string; role: string };
notifications?: Note[];
links?: Array<{ label: string; href: string }>;
signOutHref?: string;
navId?: string;
variant?: 'solid' | 'glass';
size?: 'md' | 'lg';
}
type Props = OwnProps & Omit<HTMLAttributes<'header'>, keyof OwnProps | 'class'> & { class?: string };
const {
page = 'Cuadro de mando',
sites = [],
activeSite,
user = { name: 'Raúl Garrido', role: 'Jefe de obra' },
notifications = [],
links = [],
signOutHref = '#',
navId = 'sk-os-nav',
variant = 'solid',
size = 'md',
class: classAttr,
...rest
} = Astro.props;
const unread = notifications.filter((n) => n.unread).length;
const initials = user.name.split(' ').map((p) => p.charAt(0)).slice(0, 2).join('');
const current = sites.find((s) => s.id === activeSite) ?? sites[0];
const uid = `sk-top-${Math.random().toString(36).slice(2, 7)}`;
---
<header class:list={['sk-ui', 'sk-top', `sk-top--${variant}`, `sk-top--${size}`, classAttr]} data-sk-top data-nav={navId} {...rest}>
<button type="button" class="sk-top__menu" aria-expanded="false" aria-controls={navId} data-menu>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h10" /></svg>
<span class="sk-sr">Capas de navegación</span>
</button>
<p class="sk-top__path sk-mono"><span>Strukto</span> / <span>Site OS</span> / <b>{page}</b></p>
{sites.length ? (
<label class="sk-top__site">
<span class="sk-sr">Obra activa</span>
<select data-site>
{sites.map((s) => <option value={s.id} data-weather={s.weather} selected={s.id === current?.id}>{s.name}</option>)}
</select>
<span class="sk-top__weather sk-mono" data-weather-out>{current?.weather}</span>
</label>
) : null}
<div class="sk-top__actions">
<button type="button" class="sk-top__icon" data-theme-toggle aria-label="Cambiar entre plano azul y papel de calco">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="4" y="4" width="16" height="16" /><path d="M4 12h16M12 4v16" /></svg>
</button>
<button type="button" class="sk-top__icon" popovertarget={`${uid}-n`} aria-expanded="false" aria-label={unread ? `Avisos, ${unread} sin leer` : 'Avisos'}>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M12 3 2 20h20zM12 10v4M12 17v.5" /></svg>
{unread ? <span class="sk-top__dot sk-mono" aria-hidden="true">{unread}</span> : null}
</button>
<div id={`${uid}-n`} popover class="sk-top__pop" aria-label="Avisos">
<p class="sk-top__pop-h sk-mono">Avisos de obra</p>
<ul role="list">
{notifications.map((n) => (
<li class:list={[{ 'is-unread': n.unread }]}><strong>{n.title}</strong><span>{n.text}</span><time class="sk-mono">{n.time}</time></li>
))}
</ul>
</div>
<button type="button" class="sk-top__user" popovertarget={`${uid}-u`} aria-expanded="false">
<span class="sk-top__avatar sk-mono" aria-hidden="true">{initials}</span>
<span class="sk-top__uname">{user.name}<small class="sk-mono">{user.role}</small></span>
</button>
<div id={`${uid}-u`} popover class="sk-top__pop" aria-label="Menú de usuario">
<p class="sk-top__pop-h sk-mono">{user.name} · {user.role}</p>
<ul role="list">
{links.map((l) => <li><a href={l.href}>{l.label}</a></li>)}
<li><a href={signOutHref} class="sk-top__out">Cerrar sesión</a></li>
</ul>
</div>
</div>
<p class="sk-sr" role="status" aria-live="polite" data-live></p>
</header>
<script>
function initSkTop() {
document.querySelectorAll<HTMLElement>('[data-sk-top]').forEach((root) => {
if (root.dataset.bound) return;
root.dataset.bound = 'true';
const live = root.querySelector<HTMLElement>('[data-live]')!;
const menu = root.querySelector<HTMLButtonElement>('[data-menu]')!;
const nav = document.getElementById(root.dataset.nav ?? '');
const setOpen = (open: boolean) => {
menu.setAttribute('aria-expanded', String(open));
nav?.classList.toggle('is-open', open);
};
menu.addEventListener('click', () => setOpen(menu.getAttribute('aria-expanded') !== 'true'));
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && menu.getAttribute('aria-expanded') === 'true') {
setOpen(false);
menu.focus();
}
});
const site = root.querySelector<HTMLSelectElement>('[data-site]');
site?.addEventListener('change', () => {
const opt = site.selectedOptions[0];
const w = opt?.dataset.weather ?? '';
root.querySelector('[data-weather-out]')!.textContent = w;
live.textContent = `Obra activa: ${opt?.textContent}. ${w}.`;
try {
localStorage.setItem('sk-site', site.value);
} catch {}
});
try {
const saved = localStorage.getItem('sk-site');
if (site && saved && [...site.options].some((o) => o.value === saved)) {
site.value = saved;
root.querySelector('[data-weather-out]')!.textContent = site.selectedOptions[0]?.dataset.weather ?? '';
}
} catch {}
root.querySelector('[data-theme-toggle]')?.addEventListener('click', () => {
const next = document.documentElement.dataset.theme === 'light' ? 'dark' : 'light';
document.documentElement.dataset.theme = next;
try {
localStorage.setItem('ack-theme', next);
} catch {}
live.textContent = next === 'light' ? 'Tema papel de calco.' : 'Tema plano azul.';
});
root.querySelectorAll<HTMLElement>('[popover]').forEach((pop) => {
const trigger = root.querySelector<HTMLElement>(`[popovertarget="${pop.id}"]`);
pop.addEventListener('toggle', (e) => trigger?.setAttribute('aria-expanded', String((e as ToggleEvent).newState === 'open')));
});
});
}
initSkTop();
document.addEventListener('astro:page-load', initSkTop);
</script>
<style>
.sk-top {
position: sticky;
top: 0;
z-index: 50;
display: flex;
align-items: center;
gap: 14px;
min-height: 64px;
padding: 8px 16px;
border-bottom: 1px solid var(--sk-line);
background: var(--sk-bg);
color: var(--sk-ink);
font-family: var(--sk-font-body);
box-sizing: border-box;
}
.sk-top--glass {
background: var(--sk-glass);
backdrop-filter: blur(10px);
}
.sk-top__menu {
display: none;
place-items: center;
flex: none;
width: 44px;
height: 44px;
border: 1px solid var(--sk-line-soft);
background: transparent;
color: var(--sk-ink);
cursor: pointer;
}
.sk-top__menu[aria-expanded='true'] {
border-color: var(--sk-accent);
color: var(--sk-accent);
}
@media (max-width: 1023px) {
.sk-top__menu {
display: grid;
}
}
.sk-top__path {
margin: 0;
color: var(--sk-ink-3);
font-size: 0.72rem;
text-transform: uppercase;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}
.sk-top__path b {
color: var(--sk-ink);
font-weight: 600;
}
.sk-top__site {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
min-width: 0;
}
.sk-top__site select {
min-height: 44px;
max-width: 230px;
padding: 0 10px;
border: 1px solid var(--sk-line-soft);
border-radius: var(--sk-radius);
background: var(--sk-panel);
color: var(--sk-ink);
font: inherit;
font-size: 0.88rem;
min-width: 0;
}
.sk-top__weather {
color: var(--sk-ink-3);
font-size: 0.72rem;
white-space: nowrap;
}
.sk-top__actions {
display: flex;
align-items: center;
gap: 8px;
}
.sk-top__icon {
position: relative;
display: grid;
place-items: center;
width: 44px;
height: 44px;
border: 1px solid var(--sk-line-soft);
background: transparent;
color: var(--sk-ink);
cursor: pointer;
}
.sk-top__dot {
position: absolute;
top: -6px;
right: -6px;
display: grid;
place-items: center;
min-width: 18px;
height: 18px;
background: var(--sk-accent);
color: var(--sk-on-accent);
font-size: 0.66rem;
}
.sk-top__user {
display: flex;
align-items: center;
gap: 8px;
min-height: 44px;
padding: 2px 10px 2px 2px;
border: 1px solid var(--sk-line-soft);
background: transparent;
color: var(--sk-ink);
font: inherit;
cursor: pointer;
}
.sk-top__avatar {
display: grid;
place-items: center;
width: 38px;
height: 38px;
background: var(--sk-line);
color: var(--sk-bg);
font-size: 0.8rem;
font-weight: 600;
}
.sk-top__uname {
display: grid;
text-align: left;
font-size: 0.85rem;
line-height: 1.15;
}
.sk-top__uname small {
color: var(--sk-ink-3);
font-size: 0.66rem;
text-transform: uppercase;
}
.sk-top :is(button, select, a):focus-visible {
outline: 2px solid var(--sk-accent);
outline-offset: 2px;
}
.sk-top__pop {
position: fixed;
inset: 72px 12px auto auto;
width: min(340px, calc(100vw - 24px));
margin: 0;
padding: 12px;
border: 1px solid var(--sk-line);
background: var(--sk-panel);
color: var(--sk-ink);
font-family: var(--sk-font-body);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.sk-top__pop-h {
margin: 0 0 8px;
color: var(--sk-accent);
font-size: 0.72rem;
text-transform: uppercase;
}
.sk-top__pop ul {
display: grid;
gap: 4px;
margin: 0;
padding: 0;
list-style: none;
}
.sk-top__pop li {
display: grid;
padding: 8px;
border-left: 2px solid transparent;
font-size: 0.88rem;
}
.sk-top__pop li.is-unread {
border-left-color: var(--sk-accent);
background: var(--sk-fill);
}
.sk-top__pop li span {
color: var(--sk-ink-2);
}
.sk-top__pop li time {
color: var(--sk-ink-3);
font-size: 0.7rem;
}
.sk-top__pop a {
display: flex;
align-items: center;
min-height: 44px;
margin: -8px;
padding: 0 8px;
color: var(--sk-ink);
text-decoration: none;
}
.sk-top__pop a:hover {
background: var(--sk-fill);
}
.sk-top__out {
color: var(--sk-accent) !important;
}
@media (max-width: 1279px) {
.sk-top__uname,
.sk-top__weather {
display: none;
}
.sk-top__user {
padding: 2px;
}
}
@media (max-width: 760px) {
.sk-top__path {
display: none;
}
.sk-top__site select {
max-width: 150px;
}
}
@media (max-width: 400px) {
.sk-top [data-theme-toggle] {
display: none;
}
}
</style>
Información Rápida
- Categoría
- App y Dashboard
- Nombre de archivo
ConstructionOSTopbar.astro- Dependencias
- Ninguna — Astro nativo + CSS puro
- Etiquetas
- appdashboardsaasconstructiontopbarshellpopovertheme