Giter Club home page Giter Club logo

architecture-sass-project's Introduction

Architecture for a Sass Project

Version: 1.0.0

Directory structure

.
├── stylesheets/
│   ├── base/
│   └── ...
│   ├── components/
│   └── ...
│   ├── globals/
│   └── ...
│   ├── layout/
│   └── ...
│   ├── vendors/
│   └── ...
│   └── main.{scss,sass}           # Primary Sass file (entry point)

Base

The base/ folder holds what we might call the boilerplate stuff for your project. In there, you might find the reset (or Normalize.css, or whatever), probably some stuff dealing with typography, and, depending on the project, maybe some other files.

  • _reset.{scss,sass} or _normalize.{scss,sass}
  • _typography.{scss,sass}

Components

For smaller components, there is the components/ folder (frequently called modules/). While layout/ is kind of macro (defining the global wireframe), components/ is more micro. It can contain all kinds of specific modules like a slider, a loader, a widget, or anything along those lines. There are usually a lot of files in components/ since your site is should be mostly composed of tiny modules.

  • _buttons.{scss,sass}
  • _carousel.{scss,sass}
  • _cover.{scss,sass}
  • _dropdown.{scss,sass}
  • _forms.{scss,sass}
  • _thumbnails.{scss,sass}
  • _icons.{scss,sass}

Globals

The globals/ folder (sometimes called utils/) gathers all Sass tools and helpers we’ll use across the project. Got a function? A mixin? Put it in there. This folder also contains a _variables.{scss,sass} file (sometimes _config.{scss,sass}) which holds all global variables for the project (for typography, color schemes, and so on).

  • _functions.{scss,sass}
  • _helpers.{scss,sass} or _placeholders.{scss,sass}
  • _mixins.{scss,sass}
  • _variables.{scss,sass} or _config.{scss,sass}
  • _media.{scss,sass}

Layout

The layout/ directory (sometimes called partials/) usually contains a number of files, each of them setting some styles for the main sections of the layout (header, footer, and so on). It also contains the _grid file which is the grid system used to build the layout.

  • _grid.{scss,sass}
  • _header.{scss,sass}
  • _footer.{scss,sass}
  • _navigation.{scss,sass}
  • _sidebar.{scss,sass}

Vendors

And last but not least, you will probably have a vendors/ folder containing all the CSS files from external libraries and frameworks – Bootstrap, jQueryUI, FancyCarouselSliderjQueryPowered, and so on. Putting those aside in the same folder is a good way to tell “Hey, this is not from me, not my code, not my responsibility”.

  • _bootstrap.{scss,sass}
  • _jquery-ui.{scss,sass}
  • _select2.{scss,sass}

License

MIT © 2022 Gergely Kovács ([email protected])

architecture-sass-project's People

Contributors

ggkovacs avatar

Stargazers

Renán Romero avatar Misha Tsankashvili avatar Jorge Fco.™ avatar  avatar Iványi István avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.