Search code examples
csslesstwitter-bootstrap-3mixins

mixin for 'container' class in Bootstrap v3


A mixin for container class in Bootstrap v3 could not be found but there is container-fixed() which is near.

Help me with ways by which i can use container class through mixins?


Solution

  • You can import "grid.less" from bootstrap and simply use:

    .your-container{
      .container();
    }
    

    or copy from bootstrap into your class:

    .your-container{
      .container-fixed();
    
    @media (min-width: @screen-sm) {
        width: @container-sm;
      }
      @media (min-width: @screen-md) {
        width: @container-md;
      }
      @media (min-width: @screen-lg-min) {
        width: @container-lg;
      }
    }