question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature: _index.less

See original GitHub issue

Syntax can be different, it’s the concept that is important, originally mentioned by @lukeapage here:https://github.com/cloudhead/less.js/issues/1181#issuecomment-13546979. This isn’t my concept, @lukeapage referenced the Stylus implementation, described here: http://learnboost.github.io/stylus/docs/import.html:

The idea is that a folder can contain a special “index” file, which references “sub-components”, mixin libs, or feature-subsets related to that library. It might be useful to think of this as having the ability to define dependencies.

./tablet
  |-- index.less
  |-- vendor.less
  |-- buttons.less
  |-- images.less

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

8reactions
matthew-deancommented, May 3, 2016

Since this issue was raised again in #2879 recently, part of the question was around what libraries do now. Many of them use the same .less name as the folder name. So if there are search fallbacks, it might make sense to do:

@import "library";
  1. Try to import “library.less”;
  2. Try to import “library/library.less”;
  3. Try to import “library/index.less”;

This would make a nicer shorthand for library imports than writing:

@import "library/library";
0reactions
stale[bot]commented, Nov 14, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add name/index.less to file search path · Issue #2879 - GitHub
I believe it would be very beneficial for Less users who want to split their work in modules on different directories to allow...
Read more >
Explanation: Index | The Audience Agency
Broadly speaking, an index of less than 90 or more than 110 would be considered different enough from the average to take note...
Read more >
Less.js: Getting started
Less extends CSS with dynamic behavior such as variables, mixins, operations and functions. Less runs on both the server-side (with Node.js and Rhino)...
Read more >
What Is an Index? Examples, How It's Used, and How to Invest
An index measures the performance of a basket of securities intended to replicate a certain area of the market, such as the Standard...
Read more >
INDEX function - Microsoft Support
Returns the value of an element in a table or an array, selected by the row and column number indexes. Use the array...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found