How to use fewer mixins in a meteor using @import and not get multiple definitions

in my current meteor application, I split less ads in one file per controller (iron-router). I have a shared file - where I defined some mixins - which is imported into each file less. My problem is that classes are imported several times in each route.

File structure:

mixins.import.less (new names, link http://docs.meteor.com/#less )

.grid-container {
    // something
}

postList.less

@import (once) url('/client/views/mixins.import.less');

postDetail.less

@import (once) url('/client/views/mixins.import.less');

Then, in the Chrome inspector, I found duplicated everything that I wrote in mixins.import.less. Can this double import be avoided?

+4
source share
2 answers

, , css (, , , , css), , "mixins.import". ". :

"postList.less", "postDetail.less" ..

@import (reference) url('/client/views/mixins.import.less');

(reference) LESS 1.5 , LESS , css.

+3

css js/html css js .

, ( )

css ( ). , , Meteor , css, .

( html), .

, - Meteor , CSS.

, , :

... .less .lessimport, @import file.less @import file.lessimport. , ...

+1

Source: https://habr.com/ru/post/1529032/


All Articles