Convert Figma logo to code with AI

foundation logofoundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.

29,656
5,485
29,656
87

Top Related Projects

169,947

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

A utility-first CSS framework for rapid UI development.

49,128

Modern CSS framework based on Flexbox

Materialize, a CSS Framework based on Material Design

18,271

A lightweight and modular front-end framework for developing fast and powerful web interfaces

Semantic is a UI component framework based around useful principles from natural language.

Quick Overview

Foundation Sites is a responsive front-end framework that provides a comprehensive set of HTML, CSS, and JavaScript components for building responsive websites and web applications. It offers a flexible grid system, customizable UI elements, and a wide range of pre-built components to streamline web development.

Pros

  • Highly customizable and flexible, allowing developers to tailor the framework to their specific needs
  • Extensive documentation and community support
  • Responsive design out of the box, with a mobile-first approach
  • Accessibility features built-in, promoting inclusive web design

Cons

  • Steeper learning curve compared to some other front-end frameworks
  • Can be overkill for smaller projects or simple websites
  • Regular updates may require occasional refactoring of existing code
  • Some users report performance issues with larger sites

Code Examples

  1. Creating a responsive grid:
<div class="grid-x grid-margin-x">
  <div class="cell small-12 medium-6 large-4">Column 1</div>
  <div class="cell small-12 medium-6 large-4">Column 2</div>
  <div class="cell small-12 medium-12 large-4">Column 3</div>
</div>
  1. Implementing a responsive navigation menu:
<ul class="menu" data-responsive-menu="accordion medium-dropdown">
  <li><a href="#">Home</a></li>
  <li><a href="#">About</a></li>
  <li>
    <a href="#">Services</a>
    <ul class="menu">
      <li><a href="#">Service 1</a></li>
      <li><a href="#">Service 2</a></li>
    </ul>
  </li>
</ul>
  1. Using Foundation's JavaScript components:
$(document).foundation();

// Initialize a specific plugin
var elem = new Foundation.Reveal($('#myModal'));

// Trigger the modal to open
elem.open();

Getting Started

  1. Install Foundation via npm:
npm install foundation-sites
  1. Include Foundation in your project:
<!doctype html>
<html class="no-js" lang="en">
  <head>
    <link rel="stylesheet" href="node_modules/foundation-sites/dist/css/foundation.min.css">
  </head>
  <body>
    <!-- Your content here -->
    <script src="node_modules/jquery/dist/jquery.min.js"></script>
    <script src="node_modules/foundation-sites/dist/js/foundation.min.js"></script>
    <script>
      $(document).foundation();
    </script>
  </body>
</html>
  1. Start building your responsive website using Foundation's components and grid system.

Competitor Comparisons

169,947

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Pros of Bootstrap

  • Larger community and more extensive ecosystem of themes, plugins, and resources
  • Better browser compatibility, especially for older versions
  • More comprehensive documentation and tutorials available

Cons of Bootstrap

  • Heavier file size, potentially impacting page load times
  • Less flexible grid system compared to Foundation's XY Grid
  • More opinionated design, which can lead to "Bootstrap-looking" websites

Code Comparison

Bootstrap:

<div class="container">
  <div class="row">
    <div class="col-md-6">Column 1</div>
    <div class="col-md-6">Column 2</div>
  </div>
</div>

Foundation:

<div class="grid-container">
  <div class="grid-x">
    <div class="cell medium-6">Column 1</div>
    <div class="cell medium-6">Column 2</div>
  </div>
</div>

Both frameworks offer responsive grid systems, but Foundation's XY Grid provides more flexibility in layout creation. Bootstrap's grid system is simpler to use but may be less adaptable for complex designs.

While Bootstrap has a larger user base and more resources, Foundation offers a more customizable approach with features like the XY Grid and Motion UI. The choice between the two often depends on project requirements and personal preference.

A utility-first CSS framework for rapid UI development.

Pros of Tailwind CSS

  • Highly customizable with a utility-first approach
  • Smaller file size and better performance due to purging unused styles
  • Rapid development with pre-defined utility classes

Cons of Tailwind CSS

  • Steeper learning curve for developers used to traditional CSS frameworks
  • Can lead to longer class names and potentially cluttered HTML
  • Less opinionated, requiring more design decisions from developers

Code Comparison

Foundation:

<div class="grid-x grid-margin-x">
  <div class="cell small-6 medium-4 large-3">Content</div>
  <div class="cell small-6 medium-4 large-3">Content</div>
</div>

Tailwind CSS:

<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
  <div>Content</div>
  <div>Content</div>
</div>

Summary

Foundation Sites is a more traditional CSS framework with pre-built components and a grid system. It offers a comprehensive set of UI elements out of the box. Tailwind CSS, on the other hand, provides a utility-first approach, allowing for more flexibility and customization. While Foundation may be easier for beginners, Tailwind CSS offers more granular control and potentially better performance for experienced developers willing to invest time in learning its approach.

49,128

Modern CSS framework based on Flexbox

Pros of Bulma

  • Lightweight and modular, with a smaller file size than Foundation
  • Simple and intuitive class naming convention
  • Built with Flexbox, offering modern layout capabilities out of the box

Cons of Bulma

  • Less extensive component library compared to Foundation
  • Fewer JavaScript components and interactivity options
  • Limited customization options without diving into the source Sass files

Code Comparison

Bulma:

<div class="columns">
  <div class="column">First column</div>
  <div class="column">Second column</div>
  <div class="column">Third column</div>
</div>

Foundation:

<div class="grid-x grid-margin-x">
  <div class="cell small-4">First column</div>
  <div class="cell small-4">Second column</div>
  <div class="cell small-4">Third column</div>
</div>

Both frameworks offer grid systems, but Bulma's approach is simpler and more intuitive. Foundation provides more granular control over column sizes and responsive behavior.

Bulma focuses on providing a clean, CSS-only framework with a gentle learning curve, while Foundation offers a more comprehensive toolkit with additional JavaScript components and advanced customization options. The choice between the two depends on project requirements, desired level of control, and developer preferences.

Materialize, a CSS Framework based on Material Design

Pros of Materialize

  • Easier learning curve with simpler class naming conventions
  • More modern and visually appealing default styles
  • Better integration with Google's Material Design principles

Cons of Materialize

  • Smaller community and fewer third-party extensions
  • Less flexible grid system compared to Foundation
  • Limited customization options without modifying source files

Code Comparison

Materialize button:

<a class="waves-effect waves-light btn">Button</a>

Foundation button:

<a class="button">Button</a>

Materialize grid:

<div class="row">
  <div class="col s12 m6 l4">Content</div>
</div>

Foundation grid:

<div class="grid-x">
  <div class="cell small-12 medium-6 large-4">Content</div>
</div>

Both frameworks offer responsive design capabilities and a wide range of UI components. Foundation provides more advanced features and greater flexibility, making it suitable for complex projects. Materialize, on the other hand, offers a more streamlined approach with a focus on Material Design aesthetics, making it ideal for projects that prioritize visual appeal and simplicity.

18,271

A lightweight and modular front-end framework for developing fast and powerful web interfaces

Pros of UIkit

  • Lighter weight and faster performance
  • More extensive and customizable component library
  • Better documentation and examples

Cons of UIkit

  • Steeper learning curve for beginners
  • Less widespread adoption in the industry
  • Fewer third-party plugins and extensions

Code Comparison

UIkit:

<div class="uk-card uk-card-default">
    <div class="uk-card-header">
        <h3 class="uk-card-title">Title</h3>
    </div>
    <div class="uk-card-body">
        <p>Content</p>
    </div>
</div>

Foundation:

<div class="card">
    <div class="card-divider">
        <h4>Title</h4>
    </div>
    <div class="card-section">
        <p>Content</p>
    </div>
</div>

Both UIkit and Foundation are popular front-end frameworks, offering responsive grid systems and pre-built components. UIkit provides a more modern and flexible approach with a larger component library, while Foundation is known for its simplicity and ease of use, especially for beginners. UIkit's performance advantages and extensive customization options make it attractive for complex projects, whereas Foundation's widespread adoption and community support can be beneficial for rapid development and collaboration.

Semantic is a UI component framework based around useful principles from natural language.

Pros of Semantic-UI

  • More intuitive class naming conventions, making it easier for developers to understand and use
  • Extensive theming system with a live preview, allowing for easier customization
  • Broader range of UI components and elements out of the box

Cons of Semantic-UI

  • Larger file size, which may impact page load times
  • Less frequent updates and maintenance compared to Foundation
  • Steeper learning curve for developers familiar with other frameworks

Code Comparison

Semantic-UI button example:

<button class="ui primary button">
  Save
</button>

Foundation button example:

<button class="button primary">
  Save
</button>

Both frameworks offer similar functionality, but Semantic-UI uses more descriptive class names. The ui class in Semantic-UI is used to identify elements as part of the framework, while Foundation relies on simpler, more generic class names.

Semantic-UI generally requires more classes to achieve the same result as Foundation, which can lead to more verbose HTML. However, this verbosity often translates to greater flexibility and customization options.

Overall, both frameworks are powerful tools for building responsive websites, with Semantic-UI offering more out-of-the-box components and theming options, while Foundation provides a lighter-weight solution with a gentler learning curve.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Foundation for Sites 6

Install | Documentation | Releases | Contributing


Build Status npm version jsDelivr Hits Netlify Status Quality Gate Status Known Vulnerabilities

Foundation is the most advanced responsive front-end framework in the world. Quickly go from prototype to production, building sites or apps that work on any kind of device with Foundation. Includes a fully customizable, responsive grid, a large library of Sass mixins, commonly used JavaScript plugins, and full accessibility support.


Run locally

Documentation

To run the documentation locally on your machine, you need Node.js installed on your computer. (Your Node.js version must be 12 or 14). Run these commands to set up the documentation:

# Install
git clone https://github.com/foundation/foundation-sites
cd foundation-sites
yarn

# Start the documentation
yarn start

Testing

Foundation has three kinds of tests: JavaScript, Sass, and visual regression. Refer to our testing guide for more details.

Run tests with:

# Sass unit tests
yarn test:sass
# JavaScript unit tests
yarn test:javascript:units
# Visual tests
yarn test:visual

Contributing

Check out CONTRIBUTING.md to see how to report an issue or submit a bug fix or a new feature, and our contributing guide to learn how you can contribute more globally to Foundation. You can also browse the Help Wanted tag in our issue tracker to find things to do.

Testing powered by


BrowserStack Open-Source Program

Copyright © 2020 Foundation Community

NPM DownloadsLast 30 Days