mrdaliri
mrdaliri

Reputation: 7328

import css after less file

Here is my less file:

@import "app.less";
@import (inline) "rtl.css";

when I compile it (using WinLESS), it outputs the following:

// content of rtl.css
// content of app.less then

I mean the css import statement, which coming later in less file, comes first in compiled css. Why it happen?

Upvotes: 1

Views: 94

Answers (1)

mrdaliri
mrdaliri

Reputation: 7328

As Harry said, there is a issue on github, which says because of CSS limits, any @import should placed before any other contents at the CSS file. (W3 page)

A simple solution is changing CSS file extension to .less. Or put (less) after @import keyword in the statement: @import (less) "rtl.css" to make LESS knowing it as a LESS file. (LESS Import Options)

Upvotes: 1

Related Questions