Skip to content

Error in compile Bootstrap 3 files within wrapper (lessc 1.6.1) #1826

Closed

Description

@stepanselyuk

I want to put all bootstrap styles in a wrapper. I do:

.bootstrap-wrapper {
  @import "bootstrap.less";
}

After import rows and colums don't working correctly. In compiled css-file I found a bug:

.bootstrap-wrapper .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
}

.bootstrap-wrapper .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
  float: left;
}

and may be others..

The right variant wrap all elements...:

".bootstrap-wrapper .col-xs-1, .bootstrap-wrapper .col-sm-1, .bootstrap-wrapper .col-md-1, .bootstrap-wrapper  .col-lg-1, " end etc.

Activity

  1. seven-phases-max commented on Jan 23, 2014

    @seven-phases-max
    Member

    Well, this is not really a bug. Bootstrap generates all those column classes as a single escaped string which is not supposed to be re-parsed by the compiler so the whole thing behaves like a single selector.
    You'll find a workaround for your case in #1709 (there're more issues about wrapping Bootstrap this way).

  2. stepanselyuk commented on Jan 23, 2014

    @stepanselyuk
    Author

    Thanks! I think about this construction:

    .namespace-bs {
        @import (less) "css/bootstrap.css";
    }

    but did not think that can force use the less compiler within importing css files :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions