Sizing
Container widths and the size scales for icons, controls, indicators and media.
Use the semantic size tokens, --nbhd-size-*, for the dimensions of icons, controls and media in your CSS. Each one is named for what it sizes and points to a step of the base size scale (--nbhd-size-icon-sm → --nbhd-base-size-16). Components use the same tokens.
Container sizes set the narrowest layout Neighborhood supports and the widest a content container grows before it centers on the page.
.page {
min-inline-size: var(--nbhd-size-container-min);
max-inline-size: var(--nbhd-size-container-max);
margin-inline: auto;
}
Size an icon from the icon scale and a clickable target from the control scale, so they match the icons and buttons inside Neighborhood components.
.toolbar-button {
block-size: var(--nbhd-size-control-xl);
inline-size: var(--nbhd-size-control-xl);
}
.toolbar-button svg {
block-size: var(--nbhd-size-icon-md);
inline-size: var(--nbhd-size-icon-md);
}
--nbhd-size-control-xl (44px) meets the WCAG minimum target size. Use it for anything people tap on a touch screen.
Size tokens don’t change with a brand’s spacing step, so an icon is the same size on Moen’s 5px grid as on the default 4px grid. Use the space scale for the gaps around an element, not for the element’s own size.
Container
| Token | CSS Variable | Value |
|---|---|---|
size.container.min | var(--nbhd-size-container-min) | 320px |
size.container.max | var(--nbhd-size-container-max) | 1300px |
Icon
| Token | CSS Variable | Value |
|---|---|---|
size.icon.xs | var(--nbhd-size-icon-xs) | 10px |
size.icon.sm | var(--nbhd-size-icon-sm) | 16px |
size.icon.md | var(--nbhd-size-icon-md) | 20px |
size.icon.lg | var(--nbhd-size-icon-lg) | 24px |
size.icon.xl | var(--nbhd-size-icon-xl) | 32px |
size.icon.xxl | var(--nbhd-size-icon-xxl) | 48px |
No icon match.
Control
| Token | CSS Variable | Value |
|---|---|---|
size.control.sm | var(--nbhd-size-control-sm) | 28px |
size.control.md | var(--nbhd-size-control-md) | 32px |
size.control.lg | var(--nbhd-size-control-lg) | 40px |
size.control.xl | var(--nbhd-size-control-xl) | 44px |
Indicator
| Token | CSS Variable | Value |
|---|---|---|
size.dot | var(--nbhd-size-dot) | 8px |
size.track | var(--nbhd-size-track) | 8px |
Media
| Token | CSS Variable | Value |
|---|---|---|
size.thumbnail | var(--nbhd-size-thumbnail) | 56px |
size.hero.minBlockSize | var(--nbhd-size-hero-minBlockSize) | 800px |
size.hero.logo.maxInlineSize | var(--nbhd-size-hero-logo-maxInlineSize) | 190px |
size.hero.logo.maxBlockSize | var(--nbhd-size-hero-logo-maxBlockSize) | 120px |