Closed lukeapage closed 11 years ago
@lukeapage unless someone else beats me to it, I will be sure to use that blog post as a base for the extend documentation. good write up
It'd be useful to have concrete information on the mechanism. For example, it's clear to me why (from the blog post) the .button-red
example works, but not why the .add_ie_support
use of .first:extend(:nth-child(1))
produces tr.first
rather than just .first
. With my rather limited understanding of this feature, I'd think it'd usually be more useful to produce exactly what is specified, rather than having the result prefixed with the dynamically discovered selector. In other words, if I wanted tr.first
in the output, I would have specified tr.first:extend(:nth-child(1) all)
-- what then is the benefit of this implicit prefixing?
+1 what @extemporalgenome said.
And why/how does :extend(:nth-child(1))
match the selector tr:first-child(1)
at all?
And what if I have multiple .menu { ... }
declarations - what happens when I do .menu2:extend(.menu')
?
And what if when I extend a selector inside one @media
block, and that same selector also exists inside another @media
block. What then?
What happens if I extend a mixin? i.e. .clearfix() { ... } .foo:extend(.clearfix) {}
Hmmm... I found the test files and am now reading through those.
I started to write about extend on less4j wiki. I will be happy to add the same or similar to less.js documentation too once it is finished.
I just do not want to do it while less.js documentation refactoring is in progress.
I was going to write some more info for the website, starting with porting the blog article I wrote.. If you write some more for the java version I will consider putting that on the site. I'm not 100% sure on what the current state of the documentation refactor is so I've been planning for some time to make updates to the website. Plan is to release 1.5 then do that.. then more bugfixes and 1.5.1.
@lukepage Whichever you prefer. I will write some more for java in any case, I always document what I ported. It helps me to remember what I intended to implement later on (if that makes sense).
On documentation: Altrough I would like to help with less.js, but I do not have enough time to learn it right now. Starting with new codebase requires bigger time chunks that I have available. I also wanted to catch up with less4j first, it should have at least those features that bootstrap uses.
However, I could be able to process at least simple pull requests for documentation in the meantime. Some of them seem to be simple typo fixes and do not require that much learning as codebase. People are more likely to contribute if they do not see huge backlog of unanswered pull requests.
What do you think?
@SomMeri sorted it out now..
@SomMeri - thanks for excellent write up and especially making clear the syntax and example for multiple extends.
@lukeapage - looking forward to see your page merged with @SomMeri.
@SomMeri - thanks again for good writeup. I'd put question for how to use multiple inheritance on StackOverflow and your article was the only thing I found after hours of search that gave an answer. Here's my solution: http://stackoverflow.com/a/20158738/207661
you can see the current final write up here https://github.com/less/less-docs/blob/master/content/features/extend.md
I would really really like to get our new docs as good as the current ones and replacing the website ASAP. :S
can use http://www.scottlogic.co.uk/2013/03/extends-in-less/ as a base