Less import best practice #4315
Replies: 1 comment
-
Hey @andy-tazxap! I'm here to help you with any bugs, questions, or contributions you might have. Let's work on solving this issue together. Using a single
While using a single To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
Hi,
I was wondering if you anyone could help provide me with some guidance about best practices for using less. I have a project that has a multiple less files but all of these are imported into a single index.less file, which in turn is imported once in the App.js file of my react app.
My understanding here is that this is most likely bad practice as all css will be imported into the app regardless of whether it is needed or not, but I am not sure if there is maybe some "magic" going on in the background to optimise this.
So I am wondering what is best practice here? Should I get rid of the single index.less file and instead just import the individual less files into the components that use them? Or is it ok to use a single index.less file?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions