less / old-lesscss.org

The OLD lesscss.org. For the new one see less-docs.
http://lesscss.org
90 stars 48 forks source link

Unclear meaning #56

Closed matthew-dean closed 10 years ago

matthew-dean commented 11 years ago

This doesn't make sense to me on the relativeUrls option:

relativeUrls: false,// whether to adjust url's to be relative
                            // if false, url's are already relative to the
                            // entry less file

If false, URLs are already relative? The way that sentence is written, it sounds like if you set it to false, nothing will happen, because something has already happened. Is this supposed to mean:

"If false, relative URLs (../subpath/) will be interpreted as relative to the source LESS file and rewritten when the CSS is compiled" ?

Either way, that particular option might need more explanation / examples.

I was just about to use this, but I'm still not sure if "false" or "true" will rewrite my URLs. It's a confusing property name because it has to do with URL rewriting. If I want to rewrite, my instinct would be to set to "true" to say, "Yes, rewrite please", but I believe the way this is written, I set to "false" to turn rewriting of relative URLs on, and set to "true" to not do anything with relative URLs.

Yeah, confused.

matthew-dean commented 11 years ago

urlRewriting: true seems much cleaner and easier to understand the behavior, and the term is familiar. Obviously it's only relative URLs that are rewritten since they are not absolute paths.

Although... now this is a LESS feature request instead of a documentation update, but let's start by clearing up the meaning of this property.

matthew-dean commented 11 years ago

Or.... does "whether to adjust url's to be relative" mean that this turns absolute paths into relative ones?? Gah.

lukeapage commented 11 years ago

Urls always get rewritten in the browser because the stylesheet gets put into the browser dom, so is relative to the window url rather than the less file. This is important for the less to work on multiple pages.

The option is whether sub less files in different directories should have resource urls adjusted taking that sub directory into account.

So.. yes definitely needs explanation!

jonschlinkert commented 11 years ago

I'm working on clarifying the docs for these definitions, here is my start at it: https://gist.github.com/jonschlinkert/3b8774715a4db2a23581

It would be awesome if you guys could look this over and just start adding to the definitions (probably just make comments at the bottom of the gist), then I'll keep updating the doc. Most of the docs probably don't need this kind of scrutinization, but here I think it would help.

lukeapage commented 10 years ago

covered with the updating of the options texts