Skip to content

Reference import not importing media queries #1469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Xowap opened this issue Aug 5, 2013 · 10 comments
Closed

Reference import not importing media queries #1469

Xowap opened this issue Aug 5, 2013 · 10 comments

Comments

@Xowap
Copy link

Xowap commented Aug 5, 2013

Hi all,

As stated in #1340, I want to use LESS in order to import Bootstrap classes without rendering the full stuff. As of now, it worked pretty well, however Bootstrap 3 came out and the grid system changed completely, including a new mixin that allows you to create your own column classesm, cf the doc.

The problem is the following:

Given the following code, it works perfectly fine

@import "less/bootstrap.less";

.passport-body {
  .make-column(9);
}

Output:

/* here comes the whole bootstrap world that I omitted to paste */
.passport-body {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
}
@media (min-width: 768px) {
  .passport-body {
    float: left;
    width: 75%;
  }
}

However if I try to make some reference import, here is what I get

@import (reference) "less/bootstrap.less";

.passport-body {
  .make-column(9);
}

Output:

.passport-body {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
}

As you can see, the media query part was dropped.

I don't know if this is a bug or a feature, but in any case this is an annoying behavior because it makes it hard to use bootstrap's mixins this way.

Also I'm sorry I couldn't provide a live example, however I'm not using a stable version, which might be why there is a bug :)

For information, I use the commit 4bedef4 of lessc

Many thanks!

@mark-casasoft
Copy link

I am having exactly the same problem and this seems to be a bug from less which can be found on http://stackoverflow.com/questions/21680181/less-import-reference-does-not-add-media-or-invoke-grid-mixins as well. Is this planned to get fixed shortly as this comment has been around for 7 months and haven't yet been fixed as of Less version 1.6.3. Hope this gets fixed shortly as its very annoying!

@lukeapage
Copy link
Member

I will prioritise this higher or you could always help out, its hard for me
to know what issues effect multiple people and we all just help out in our
spare time. This would be 4th on my list to fix.

@casasoft
Copy link

We are experiencing the same issue when importing bootstrap as a reference so any fix shortly would be much appreciated. Thanks for your help and constant support!

kasperisager added a commit to kasperisager/vanilla-bootstrap that referenced this issue Feb 22, 2014
@kasperisager
Copy link

Same issue here, and I apparently can't spell 😕

kasperisager added a commit to kasperisager/vanilla-bootstrap that referenced this issue Feb 22, 2014
* master:
  Ditch out-of-the-box grid classes in favour of a semantic grid
  Fully import mixins until a fix is comitted for less/less.js#1469
  Prepare semantic grid
  Adjust token input bottom padding in the Yeti theme
  Use more appropriate variable for the message list item separator
  Fix non-standard list item background color in the Slate theme
  Fix wrong variable being used by message list items
  More adjustments to themed Bootstrap navbar
  Improve footer variables
  Only treat activity item content as media bodies
  Manually extend themed Bootstrap navbar
  Import Bootstrap theme by reference
  Compile Bootswatch theme changes
@lukeapage
Copy link
Member

I've fixed it, just waiting for WiFi to push it and then 1.7 should be
released soon. Its a 1 line fix if you want to patch it yourself - when
this issue closes look at the closing commit.

@Xowap
Copy link
Author

Xowap commented Feb 23, 2014

Excellent news, it indeed looks like it's fixed :)

@casasoft
Copy link

How can I access the update? I compile less using the installed version in Node.Js through NPM, shall I just re-install it and it will be fixed or do we need to wait for version 1.7.0? Thanks

@lukeapage
Copy link
Member

The usage section on the website explains how to reference master on
github.. or you wait for the 1.7 release (this week)

@casasoft
Copy link

Many thanks! Will wait for 1.7 release if its going to be this week

@appsol
Copy link

appsol commented May 2, 2014

I had the exact same issue of not importing @media styles when using @import (reference) with version 1.3.11 of less. Updated to version 1.7.0 in global, but forgot about the local copy in grunt-contrib-less. Once I updated the dependencies in this and ran npm update the @media queries started working again.
Thanks.

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

No branches or pull requests

5 participants