@penaprieto/design-system
Version:
Multi-brand React design system with design tokens from Figma
265 lines (231 loc) • 5.78 kB
CSS
/* Base header */
.ds-header {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
border-bottom: 1px solid var(--semantic-border-default-subtle);
background-color: var(--semantic-bg-surface-default);
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}
.ds-header__container {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
max-width: 1440px;
padding: 0 var(--size5, 20px);
gap: var(--size6, 24px);
box-sizing: border-box;
}
.ds-header__left {
display: flex;
align-items: center;
gap: var(--size6, 24px);
}
.ds-header__logo {
display: flex;
align-items: center;
}
.ds-header__nav {
display: flex;
align-items: center;
gap: var(--size2, 8px);
position: static;
width: auto;
height: auto;
background: none;
box-shadow: none;
padding: 0;
overflow: visible;
flex: 1 1 0%;
justify-content: flex-start;
}
.ds-header__nav-item {
display: flex;
justify-content: center;
align-items: center;
height: 64px;
text-decoration: none;
position: relative;
color: var(--semantic-text-corp-secondary);
font-family: var(--body-regular-fontFamily, var(--font-family, 'Satoshi', sans-serif));
font-size: var(--body-regular-fontSize, 16px);
font-weight: var(--font-weight-regular, 400);
line-height: var(--line-height-body, 150%);
transition: color 0.2s ease, font-weight 0.2s ease, box-shadow 0.2s ease;
padding: 0 var(--size2, 8px);
background: transparent;
border: none;
cursor: pointer;
}
.ds-header__nav-item:hover,
.ds-header__nav-item:focus-visible {
color: var(--semantic-text-corp-primary);
font-weight: var(--body-regular-strong-fontWeight, 500);
outline: none;
}
.ds-header__nav-item--active {
color: var(--semantic-text-corp-primary);
font-weight: var(--body-regular-strong-fontWeight, 500);
box-shadow: inset 0 -3px 0 0 var(--semantic-border-accent);
}
.ds-header__nav-link {
display: flex;
justify-content: center;
align-items: center;
gap: var(--size2, 8px);
}
.ds-header__right {
display: flex;
align-items: center;
gap: var(--size1, 4px);
}
.ds-header__avatar {
display: flex;
justify-content: center;
align-items: center;
gap: var(--size1, 4px);
padding: var(--size1, 4px);
border-radius: var(--br-xs, 4px);
cursor: pointer;
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
border: none;
background: transparent;
}
.ds-header__avatar:hover {
background-color: var(--semantic-bg-action-ghost-hover);
}
.ds-header__avatar:active {
background-color: var(--semantic-bg-action-ghost-active);
}
.ds-header__avatar:focus-visible {
outline: none;
box-shadow: var(--semantic-focus-corp);
}
.ds-header__chevron {
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--semantic-icon-default-default);
}
.ds-header__chevron svg {
width: 16px;
height: 16px;
display: block;
}
.ds-header__menu-btn {
display: none;
}
.ds-header__avatar--desktop {
display: flex;
}
.ds-header__avatar--mobile {
display: none;
}
.ds-header__overlay {
display: none;
}
/* Mobile */
@media (max-width: 768px) {
.ds-header__container {
width: 100%;
padding: var(--size2, 8px);
gap: var(--size2, 8px);
}
.ds-header__nav {
display: block;
position: fixed;
top: 0;
right: -320px;
width: 320px;
max-width: 90vw;
height: 100vh;
background: var(--semantic-bg-surface-default);
box-shadow: var(--semantic-elevation-elevation2);
z-index: 10001;
padding: 0;
transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
align-items: flex-start;
overflow-y: auto;
}
.ds-header__nav--open {
right: 0;
}
.ds-header__overlay {
display: block;
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: var(--semantic-bg-overlay);
z-index: 10000;
transition: opacity 0.3s;
opacity: 0;
pointer-events: none;
}
.ds-header__overlay--active {
opacity: 1;
pointer-events: auto;
}
.ds-header__menu-btn {
display: inline-flex;
margin-left: var(--size2, 8px);
}
.ds-header__left {
flex: 1 1 0%;
min-width: 0;
}
.ds-header__avatar--desktop {
display: none;
}
.ds-header__avatar--mobile {
display: flex;
flex-direction: row;
align-items: flex-start;
gap: var(--size4, 16px);
padding: var(--size6, 24px) var(--size6, 24px) var(--size4, 16px) var(--size6, 24px);
width: 100%;
border-bottom: 1px solid var(--semantic-border-default-subtle);
box-sizing: border-box;
}
.ds-header__user-info {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
gap: var(--size1, 4px);
text-align: left;
flex: 1 1 0%;
min-width: 0;
}
.ds-header__user-name {
font-family: var(--body-regular-fontFamily, var(--font-family, 'Satoshi', sans-serif));
font-size: var(--body-large-fontSize, 18px);
font-weight: var(--font-weight-bold, 700);
color: var(--semantic-text-corp-primary);
line-height: 1.2;
}
.ds-header__user-email {
font-family: var(--body-small-fontFamily, var(--font-family, 'Satoshi', sans-serif));
font-size: var(--body-small-fontSize, 14px);
color: var(--semantic-text-corp-secondary);
line-height: 1.2;
word-break: break-all;
}
.ds-header__nav-item {
width: 100%;
justify-content: flex-start;
padding-left: var(--size6, 24px);
box-shadow: none;
background: transparent;
height: 56px;
}
.ds-header__nav-item--active {
background: var(--semantic-bg-action-tertiary-active);
color: var(--semantic-text-corp-primary);
box-shadow: none;
}
}