G
G
gassmonkey2016-01-18 12:56:38
css
gassmonkey, 2016-01-18 12:56:38

Which Bootstrap Grid Classes Should You Choose?

Recently I have been making up without frameworks, but now I decided to return to the bootstrap grid again. In connection with this, a question arose.
I adhere to the BEM methodology in layout, and adding bootstrap classes to the block in the html itself seems completely unreasonable, inappropriate, plus quite poor aesthetically.

<div class="class__element col-xs-12 col-sm-6 col-md-3"></div>

In addition, when using SCSS and the susy grid, I got used to this, in my opinion, more reasonable design:
<div class="class__element"></div>
.class__element{
  @extend .col-md-3;
  @extend .col-sm-6;
  @extend .col-xs-12;
}

What do you think? Which way is more reasonable?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2016-01-18
@gassmonkey

The second way is more than reasonable.
Only perhaps you should think about using mixins instead of extending classes, and throwing out the grid altogether (well, here you need to evaluate the benefits received in a particular project).

.class__element {
    @include make-sm-column(3);
}

I also saw this layout
Like a visual grouping of classes by meaning.

W
Wheelie, 2016-01-18
@Wheelie

The second one is much nicer. Only on the condition that "coders" will not look into the layout in order to quickly display new information by analogy with the old one =) They will go crazy))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question