GithubHelp home page GithubHelp logo

bootstrap-grid-placeholders's Introduction

Importing _grid.scss can help you to use bootstrap v 4.0.0 grid only. Main classes are converted to SASS placeholders, because it doesn't support @import (reference), as in LESS.

This means that:

  • You are free in class naming
  • Smaller size of css files

Quick start

  1. Clone the repo: git clone https://github.com/vetalstar/bootstrap-grid-placeholders.git
  2. Run composer install to install bootstrap v 4.0.0
  3. See example.scss.

For example

It can be useful for BEM.

SCSS
.block {
  @extend %container-fluid;

  &__wrapper {
    @extend %row;

    &_modificator {
      @extend %no-gutters;
    }
  }

  &__element {
    @extend %col-md-10;
  }

  &__element2 {
    @extend %col-md-2;
  }
}
CSS
.block {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto; 
}
.block__wrapper {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px; 
}
.block__wrapper_modificator {
  margin-right: 0;
  margin-left: 0; 
}
.block__wrapper_modificator > * {
    padding-right: 0 !important;
    padding-left: 0 !important;
}
.block__element2, .block__element {
  position: relative;
  width: 100%;
  min-height: 1px;
  padding-right: 15px;
  padding-left: 15px; 
}
...
HTML
<div class="block">
    <div class="block__wrapper block__wrapper_modificator">
        <div class="block__element"></div>
        <div class="block__element2"></div>
    </div>
</div>

bootstrap-grid-placeholders's People

Contributors

vetalstar avatar

Stargazers

Joseph Richardson avatar  avatar

Watchers

 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.