Foundation provides a comprehensive library of styled components that work seamlessly together. All components are built with accessibility in mind and support extensive customization through SCSS variables.
Flexible button styling with multiple sizes, colors, and states.
/**
* Base button class
*/
.button {
display: inline-block;
vertical-align: middle;
margin: 0 0 1rem 0;
padding: 0.85em 1em;
border: 1px solid transparent;
border-radius: 0;
transition: background-color 0.25s ease-out, color 0.25s ease-out;
font-size: 0.9rem;
line-height: 1;
text-align: center;
cursor: pointer;
appearance: none;
}
/**
* Button size variants
*/
.button.tiny { padding: 0.6em 1em; font-size: 0.6rem; }
.button.small { padding: 0.75em 1em; font-size: 0.8rem; }
.button.large { padding: 1.125em 1em; font-size: 1.25rem; }
/**
* Button color variants
*/
.button.secondary { /* Secondary color scheme */ }
.button.success { /* Success/green color scheme */ }
.button.warning { /* Warning/yellow color scheme */ }
.button.alert { /* Alert/red color scheme */ }
/**
* Button style variants
*/
.button.hollow { /* Outlined button with transparent background */ }
.button.clear { /* Button with no background or border */ }
.button.expanded { width: 100%; }
.button.disabled { opacity: 0.25; cursor: not-allowed; }Flexible menu system for navigation bars, sidebar menus, and button groups.
/**
* Base menu component
*/
.menu {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
}
/**
* Menu orientation
*/
.menu.vertical { flex-direction: column; }
.menu.horizontal { flex-direction: row; }
/**
* Menu styling variants
*/
.menu.simple { /* Simplified menu styling */ }
.menu.expanded { /* Full-width menu items */ }
/**
* Menu item states
*/
.menu li.active { /* Active menu item */ }
.menu .menu-text { /* Non-clickable menu text */ }
/**
* Nested menu support
*/
.menu.nested { margin-left: 1rem; }Multi-level dropdown navigation system.
/**
* Dropdown menu container
*/
.dropdown.menu { /* Dropdown-enabled menu */ }
/**
* Dropdown submenu
*/
.is-dropdown-submenu {
position: absolute;
top: 100%;
left: 0;
visibility: hidden;
opacity: 0;
z-index: 1;
}
.is-dropdown-submenu.js-dropdown-active {
visibility: visible;
opacity: 1;
}
/**
* Dropdown parent indicators
*/
.is-dropdown-submenu-parent { position: relative; }
.is-dropdown-submenu-parent::after { content: ''; /* Arrow indicator */ }Responsive navigation header component.
/**
* Top bar container
*/
.top-bar {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
padding: 0.5rem;
}
/**
* Top bar sections
*/
.top-bar-left { flex: 1 1 auto; }
.top-bar-right { flex: 0 1 auto; }
.top-bar-title { flex: 0 0 auto; margin-right: 1rem; }Container component for grouping related content.
/**
* Card container
*/
.card {
display: flex;
flex-direction: column;
flex-grow: 1;
margin-bottom: 1rem;
border: 1px solid #e6e6e6;
border-radius: 0;
background: #fefefe;
box-shadow: none;
overflow: hidden;
color: #0a0a0a;
}
/**
* Card sections
*/
.card-divider {
display: flex;
flex: 0 1 auto;
padding: 1rem;
background: #f6f6f6;
border-bottom: 1px solid #e6e6e6;
}
.card-section {
flex: 1 0 auto;
padding: 1rem;
}Highlighted content areas for important information.
/**
* Callout component
*/
.callout {
position: relative;
margin: 0 0 1rem 0;
padding: 1rem;
border: 1px solid rgba(10, 10, 10, 0.25);
border-radius: 0;
background-color: white;
color: #0a0a0a;
}
/**
* Callout color variants
*/
.callout.primary { /* Primary color scheme */ }
.callout.secondary { /* Secondary color scheme */ }
.callout.success { /* Success color scheme */ }
.callout.warning { /* Warning color scheme */ }
.callout.alert { /* Alert color scheme */ }
/**
* Callout size variants
*/
.callout.small { padding: 0.5rem; }
.callout.large { padding: 3rem; }Combine form inputs with labels and buttons.
/**
* Input group container
*/
.input-group {
display: flex;
width: 100%;
margin-bottom: 1rem;
align-items: stretch;
}
/**
* Input group children
*/
.input-group-label {
border: 1px solid #cacaca;
background: #e6e6e6;
padding: 0 1rem;
color: #0a0a0a;
text-align: center;
white-space: nowrap;
display: flex;
flex: 0 0 auto;
align-items: center;
}
.input-group-field {
border-radius: 0;
flex: 1 1 0px;
min-width: 0;
}
.input-group-button {
display: flex;
flex: 0 0 auto;
}Visual feedback for form validation.
/**
* Validation state classes
*/
.is-invalid-input {
border-color: #cc4b37;
background-color: #f9eaea;
}
.is-invalid-label {
color: #cc4b37;
}
.form-error {
display: none;
margin-top: -0.5rem;
margin-bottom: 1rem;
font-size: 0.75rem;
font-weight: bold;
color: #cc4b37;
}
.form-error.is-visible {
display: block;
}Collapsible content sections.
/**
* Accordion container
*/
.accordion {
list-style: none;
background: #fefefe;
margin-left: 0;
}
/**
* Accordion item
*/
.accordion-item {
border: 1px solid #e6e6e6;
border-bottom: 0;
}
.accordion-item:last-child {
border-bottom: 1px solid #e6e6e6;
}
/**
* Accordion title (clickable header)
*/
.accordion-title {
display: block;
padding: 1.25rem 1rem;
line-height: 1;
font-size: 0.75rem;
color: #1779ba;
position: relative;
border: 0;
background: #fefefe;
width: 100%;
text-align: left;
}
/**
* Accordion content
*/
.accordion-content {
display: none;
padding: 1rem;
border: 0;
background: #fefefe;
color: #0a0a0a;
}
.accordion-content.is-active {
display: block;
}Tabbed interface for organizing content.
/**
* Tab navigation
*/
.tabs {
list-style: none;
background: #fefefe;
border: 1px solid #e6e6e6;
margin: 0 0 1rem 0;
display: flex;
flex-wrap: wrap;
}
/**
* Individual tab
*/
.tabs-title {
float: none;
}
.tabs-title > a {
display: block;
padding: 1.25rem 1.5rem;
font-size: 0.75rem;
line-height: 1;
color: #1779ba;
}
.tabs-title.is-active > a {
background: white;
color: #0a0a0a;
}
/**
* Tab content container
*/
.tabs-content {
border: 1px solid #e6e6e6;
border-top: 0;
background: #fefefe;
color: #0a0a0a;
transition: all 0.5s ease;
}
/**
* Individual tab panel
*/
.tabs-panel {
display: none;
padding: 1rem;
}
.tabs-panel.is-active {
display: block;
}Sliding sidebar menu system.
/**
* Off-canvas wrapper
*/
.off-canvas-wrapper {
position: relative;
overflow-x: hidden;
}
/**
* Off-canvas menu
*/
.off-canvas {
position: fixed;
top: 0;
z-index: 1;
height: 100vh;
width: 250px;
transform: translateX(-250px);
background: #e6e6e6;
transition: transform 0.5s ease;
}
.off-canvas.is-open {
transform: translateX(0);
}
/**
* Off-canvas positioning
*/
.position-left { left: 0; transform: translateX(-100%); }
.position-right { right: 0; transform: translateX(100%); }
/**
* Main content area
*/
.off-canvas-content {
min-height: 100vh;
transition: transform 0.5s ease;
}Modal dialog component.
/**
* Modal overlay
*/
.reveal-overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1005;
display: none;
background-color: rgba(10, 10, 10, 0.45);
overflow-y: auto;
}
/**
* Modal container
*/
.reveal {
z-index: 1006;
backface-visibility: hidden;
display: none;
padding: 1rem;
border: 1px solid #cacaca;
border-radius: 0;
background-color: #fefefe;
position: relative;
top: 100px;
margin-left: auto;
margin-right: auto;
overflow-y: auto;
}
/**
* Modal size variants
*/
.reveal.tiny { width: 30%; max-width: 200px; }
.reveal.small { width: 50%; max-width: 500px; }
.reveal.large { width: 90%; max-width: 1000px; }
.reveal.full { width: 100vw; max-width: none; height: 100vh; }Visual progress indicators.
/**
* Progress bar container
*/
.progress {
height: 1rem;
margin-bottom: 1rem;
border-radius: 0;
background-color: #cacaca;
}
/**
* Progress bar fill
*/
.progress-meter {
position: relative;
display: block;
width: 0%;
height: 100%;
background-color: #1779ba;
}
/**
* Progress bar text
*/
.progress-meter-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 0.75rem;
font-weight: bold;
white-space: nowrap;
}Small status and categorization elements.
/**
* Label component
*/
.label {
display: inline-block;
padding: 0.33333rem 0.5rem;
border-radius: 0;
font-size: 0.8rem;
line-height: 1;
white-space: nowrap;
cursor: default;
background: #1779ba;
color: white;
}
/**
* Badge component
*/
.badge {
display: inline-block;
min-width: 2.1em;
padding: 0.3em;
border-radius: 50%;
font-size: 0.6rem;
text-align: center;
background: #1779ba;
color: white;
}Navigation component for paginated content.
/**
* Pagination container
*/
.pagination {
list-style: none;
margin-left: 0;
margin-bottom: 1rem;
display: flex;
flex-wrap: wrap;
}
.pagination li {
font-size: 0.875rem;
margin-right: 0.0625rem;
border-radius: 0;
}
.pagination li a,
.pagination li button {
display: block;
padding: 0.1875rem 0.625rem;
border-radius: 0;
color: #0a0a0a;
}
/**
* Pagination states
*/
.pagination .current {
padding: 0.1875rem 0.625rem;
background: #1779ba;
color: white;
cursor: default;
}
.pagination .disabled {
padding: 0.1875rem 0.625rem;
color: #cacaca;
cursor: not-allowed;
}
.pagination .ellipsis::after {
content: '…';
padding: 0.1875rem 0.625rem;
color: #0a0a0a;
}Navigation component showing hierarchical path.
/**
* Breadcrumbs container
*/
.breadcrumbs {
list-style: none;
margin: 0 0 1rem 0;
display: flex;
flex-wrap: wrap;
}
.breadcrumbs li {
color: #0a0a0a;
cursor: default;
text-transform: uppercase;
font-size: 0.6875rem;
}
.breadcrumbs li:not(:last-child)::after {
content: '/';
margin: 0 0.75rem;
color: #cacaca;
position: relative;
top: 1px;
}
/**
* Current breadcrumb
*/
.breadcrumbs .current {
color: #0a0a0a;
cursor: default;
}
.breadcrumbs .disabled {
color: #cacaca;
cursor: not-allowed;
}Toggle switch input component.
/**
* Switch container
*/
.switch {
position: relative;
margin-bottom: 1rem;
outline: 0;
font-size: 0.875rem;
font-weight: bold;
color: white;
user-select: none;
}
/**
* Switch input (hidden)
*/
.switch-input {
position: absolute;
margin-bottom: 0;
opacity: 0;
}
/**
* Switch paddle (visual toggle)
*/
.switch-paddle {
position: relative;
display: block;
width: 4rem;
height: 2.5rem;
border-radius: 0;
background: #cacaca;
transition: all 0.25s ease;
font-weight: inherit;
color: inherit;
cursor: pointer;
}
.switch-paddle::after {
position: absolute;
top: 0.25rem;
left: 0.25rem;
content: '';
display: block;
width: 2rem;
height: 2rem;
background: white;
border-radius: 0;
transition: all 0.25s ease;
transform: translateX(0);
}
/**
* Switch sizes
*/
.switch.tiny { font-size: 0.625rem; }
.switch.small { font-size: 0.75rem; }
.switch.large { font-size: 1.25rem; }
/**
* Active state
*/
.switch input:checked ~ .switch-paddle {
background: #1779ba;
}
.switch input:checked ~ .switch-paddle::after {
transform: translateX(1.5rem);
}Component for aligning media content with text.
/**
* Media object container
*/
.media-object {
display: flex;
margin-bottom: 1rem;
flex-wrap: nowrap;
}
/**
* Media object sections
*/
.media-object-section {
flex: 0 1 auto;
}
.media-object-section.main-section {
flex: 1 1 0px;
}
.media-object-section:first-child {
padding-right: 1rem;
}
.media-object-section:last-child:not(:nth-child(2)) {
padding-left: 1rem;
}
/**
* Alignment variants
*/
.media-object-section.middle {
align-self: center;
}
.media-object-section.bottom {
align-self: flex-end;
}
/**
* Stacked media object
*/
.media-object.stack-for-small {
flex-wrap: wrap;
}Responsive visibility utility classes.
/**
* Show/hide classes for different breakpoints
*/
.hide { display: none !important; }
.invisible { visibility: hidden; }
/**
* Responsive visibility classes
*/
.show-for-small-only { /* Show only on small screens */ }
.show-for-medium { /* Show for medium and up */ }
.show-for-medium-only { /* Show only on medium screens */ }
.show-for-large { /* Show for large and up */ }
.show-for-large-only { /* Show only on large screens */ }
.hide-for-small-only { /* Hide only on small screens */ }
.hide-for-medium { /* Hide for medium and up */ }
.hide-for-medium-only { /* Hide only on medium screens */ }
.hide-for-large { /* Hide for large and up */ }
.hide-for-large-only { /* Hide only on large screens */ }
/**
* Print visibility
*/
.show-for-print { display: none !important; }
.hide-for-print { display: block !important; }
/**
* Screen reader classes
*/
.show-for-sr { /* Show only for screen readers */ }
.hide-for-sr { /* Hide from screen readers */ }Float and clearfix utilities.
/**
* Float utilities
*/
.float-left { float: left !important; }
.float-right { float: right !important; }
.float-center {
display: block;
margin-right: auto;
margin-left: auto;
}
/**
* Clearfix utility
*/
.clearfix::before,
.clearfix::after {
display: table;
content: ' ';
flex-basis: 0;
order: 1;
}
.clearfix::after {
clear: both;
}Flexbox utility classes.
/**
* Flex container utilities
*/
.flex-container { display: flex; }
.flex-child-auto { flex: 1 1 auto; }
.flex-child-grow { flex: 1 0 auto; }
.flex-child-shrink { flex: 0 1 auto; }
/**
* Flex direction utilities
*/
.flex-dir-row { flex-direction: row; }
.flex-dir-row-reverse { flex-direction: row-reverse; }
.flex-dir-column { flex-direction: column; }
.flex-dir-column-reverse { flex-direction: column-reverse; }
/**
* Alignment utilities
*/
.align-right { justify-content: flex-end; }
.align-center { justify-content: center; }
.align-justify { justify-content: space-between; }
.align-spaced { justify-content: space-around; }
.align-top { align-items: flex-start; }
.align-middle { align-items: center; }
.align-bottom { align-items: flex-end; }
.align-stretch { align-items: stretch; }
.align-self-top { align-self: flex-start; }
.align-self-middle { align-self: center; }
.align-self-bottom { align-self: flex-end; }
.align-self-stretch { align-self: stretch; }Standardized close button component.
/**
* Close button component
*/
.close-button {
position: absolute;
z-index: 10;
color: #8a8a8a;
cursor: pointer;
top: 0.5rem;
right: 0.5rem;
}
.close-button:hover,
.close-button:focus {
color: #0a0a0a;
}
/**
* Close button sizes
*/
.close-button.small { font-size: 1.5em; }
.close-button.medium { font-size: 2em; }
.close-button.large { font-size: 2.5em; }Top bar component for mobile navigation.
/**
* Title bar component for mobile navigation
*/
.title-bar {
background: #0a0a0a;
color: #fefefe;
padding: 0.5rem;
}
.title-bar .title-bar-title {
display: inline-block;
vertical-align: middle;
font-weight: bold;
}
.title-bar .title-bar-left,
.title-bar .title-bar-right {
display: inline-block;
vertical-align: middle;
}
.title-bar .title-bar-right {
float: right;
}
/**
* Menu icon for title bar
*/
.title-bar .menu-icon {
display: inline-block;
vertical-align: middle;
cursor: pointer;
width: 20px;
height: 16px;
position: relative;
}
.title-bar .menu-icon::after {
content: '';
position: absolute;
display: block;
width: 100%;
height: 2px;
background: #fefefe;
top: 0;
left: 0;
box-shadow: 0 7px 0 #fefefe, 0 14px 0 #fefefe;
}Each component provides SCSS mixins for custom implementations:
/**
* Include individual component styles
*/
@mixin foundation-button;
@mixin foundation-accordion;
@mixin foundation-callout;
@mixin foundation-card;
@mixin foundation-dropdown;
@mixin foundation-menu;
@mixin foundation-off-canvas;
@mixin foundation-reveal;
@mixin foundation-tabs;
@mixin foundation-tooltip;
/**
* Include all components
*/
@mixin foundation-everything($flex: true, $prototype: false);