Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9214753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:02:30+00:00 2026-06-18T02:02:30+00:00

I am trying to do some work with .LESS, and am running into a

  • 0

I am trying to do some work with .LESS, and am running into a conflict with a fellow programmer, and attempting to discern the best use here.

Essentially, the debate is over the proper use of @import to bring .less files together that cannot compile on their own. For instance, assume the following..

variables.less

// some variables are defined here

reset.less

// variables are used here

compile.less

@import("variables.less")
@import("reset.less")

Now then, if you tried to compile reset.less, it would fail. Because it requires things from variables.less. To one of us, this is perfectly fine because it allows us to modularize our project into pieces. But the other disagrees, because they claim each file should stand alone.

What do some of you more experienced .less coders think on this matter? What is “Accepted” practice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:02:31+00:00Added an answer on June 18, 2026 at 2:02 am

    Obviously, what is “best practice” for one company may not be so for another. However, it is a very common practice to have them split as you note. Bootstrap does this.

    If it is necessary to be able to compile each individually, but also a desire to modularize, then what you could do is keep it as you note above, but also define within each submodule (like reset.less) an

    @import-once "variables.less" 
    

    at the beginning. That way, if one is just compiling reset.less it works, but in compile.less it will only do the initial import of the variables.less file and not any subsequent calls from the submodules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a simple conditional statement to work, and running into problems.
Trying to do some work with text selected in a UIWebView. There are 2
I'm trying to do some work with C# and XML in a cross-platform app
I'm trying to get some HTML to work with my python code. I've got
Im trying to get some auto complete to work. I have this URL i
I am trying to do some style-check/translation work for Java programs. First I would
I am trying to test some async methods involving the HttpClient work with vs
I'm trying to make some input fields that I would like to work like
I am trying to adapt some (to me) very complicated code to work with
I'm studying javascript and I'm trying to work with some json files. I'm a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.