2

Take the following less file, call it style.less:

/*------------------------------------*\
    #IMPORT
\*------------------------------------*/

/**
 * CSS files
 */

@import (css) "../css/bootstrap.css";

Look at the generated style.css then I see bootstrap css file at the top, followed by the comments.

How do I fix it?

TylerH
  • 20,799
  • 66
  • 75
  • 101
The Hung
  • 309
  • 4
  • 18
  • 1
    Less moves CSS imports to the top since by the spec. they must precede any other rules (except `@charset`). Meanwhile comments are not considered by Less to be tied to any particular statement so their position/order may not be preserved. The simplest workaround I can think of right now is to move all your non-Less code having a formatting you wish to preserve into a separate file and import it with `@import (inline)`. – seven-phases-max Feb 07 '15 at 08:38
  • Thank @seven-phases-max I'll edit the generated file a little rather than put into a separate file. I think it's best :D – The Hung Feb 07 '15 at 10:02

1 Answers1

0

You can import css like regular @import or inject the css(bootstrap.css) content to new generated css file (style.css) import-css-file-into-less-file

Community
  • 1
  • 1
user3197492
  • 117
  • 3