Skip to content

The way Extend works - more complicated selectors and change in matching #1155

Closed

Description

@lukeapage

From @DesignByOnyx

I have finally gotten around to testing this and wanted to post my initial findings. I have been using the alpha version less-1.4.0-alpha.js on the client-side only (no command line yet - not that it should be any different really).

So far, everything works as I would expect except for two major drawbacks which can be explained with one example. Take the following code which is located in one of my root LESS files:

.container { margin: 0 auto; }
 .container.positioned { position: absolute }

@media screen and (min-width: 30em) {
    .container.positioned { left: 50%; }
}
@media screen and (min-width: 30em) and (max-width: 48em) {
    .container { width: 30em; }
    .container.positioned { margin-left: -15em; }
}
@media screen and (min-width: 48em) and (max-width: 60em) {
    .container { width: 48em; }
    .container.positioned { margin-left: -24em; }
}
@media screen and (min-width: 60em) {
     .container { width: 60em; }
     .container.positioned { margin-left: -30em; }
}

Issue 1 - styles defined within media queries do not get extended. Anything trying to extend the .container class only gets the margin: 0 auto styles.

.some-element:extend(.container);

Issue 2 - compound selectors do not get extended. However, the first participant DOES get extended. For example, the following incorrectly extends the .container styles but not the intended .container.positioned styles.

.some-element:extend(.container.positioned);

I wish I could provide a solution. Hope this helps.

Activity

  1. DesignByOnyx commented on Jan 31, 2013

    @DesignByOnyx

    I have a request for the moderator so that someone doesn't try and use my code in their projects. It turns out that specifying media queries in rem doesn't work in some browsers (Safari, iPad Chrome, iPad Safari, etc). This was an experimental feature I was testing. Could you please change the values in the media query definitions to em. The .container width and margins can still use rem (and should).

  2. matthew-dean commented on Jan 31, 2013

    @matthew-dean
    Member

    @DesignByOnyx Updated.

  3. DesignByOnyx commented on Feb 1, 2013

    @DesignByOnyx

    And to complicate matters more, here's another weird case:

    .shared-style { ... }
    
    @media screen and (min-width: 48em) {
         .some-element:extend(.shared-style) { ... }
    }
    

    The situation here is that .some-element always gets the shared styles as opposed to only when the media query is active:

    .shared-style,
    .some-element { ... }
    
    @media screen and (min-width: 48em) {
         .some-element { ... }
    }
    

    The only real solution I see here is to abandon :extend within media queries and resort to the classic include:

    .shared-style { ... }
    
    @media screen and (min-width: 48em) {
         .some-element { 
             .shared-style;
         }
    }
    
  4. lukeapage commented on Feb 2, 2013

    @lukeapage
    MemberAuthor

    issue 2 is just a missing feature.. surprised it parses as the contents of :extend( should be a single class or node selector. maybe a feature request for the future.

    media queries.

    1. if you extend a class that is in a media query it should "just work" - it clearly doesn't and I agree with you
    2. if you do an extend inside a media query shouldn't it copy the code inside the media query? E.g. in your simple example it would act the same as .shared-style; but in more complex examples it would pull in the bits of the selector too
  5. DesignByOnyx commented on Feb 3, 2013

    @DesignByOnyx

    Regarding your point number 1 - I think selector matching isn't a feature but a requirement. Can we not pull parts of sizzle in so that all selector patterns get matched?

    Regarding your point 2 about copying the code - I agree, but the problem gets very complicated if you have something like this, as the parser will have to be smart enough to apply styles from other media queries:

    -- take note of the single :extend below, then take note of the comments --

    /* These styles should be copied */
    .shared-style { ... } 
    
    @media screen and (min-width: 30em) {
        /* These styles should be copied */
        .shared-style { ... } 
    }
    @media screen and (max-width: 30em) {
        .shared-style { ... }
    }
    @media screen and (min-width: 48em) {
        .some-element:extend(.shared-style) {
            /* Copied styles should be pasted here  */
        }
    }
    @media screen and (min-width: 60em) {
        .shared-style { ... }
    }
    @media screen and (max-width: 60em) {
        /* These styles should be copied */
        .shared-style { ... } 
    }
    
  6. jonschlinkert commented on Feb 3, 2013

    @jonschlinkert
    Contributor

    @DesignByOnyx, I'm going to have to spend more time with your use case, but honestly after using SASS extends and doing a lot of testing on extends myself, I'm not sure I agree with any of your point(s) about number 1 (that's the only part I'm responding to here). The "comprehensive selector matching" was something I personally don't like - and didn't like about SASS. Why would you want to extend to every selector pattern? I really am curious, that's not intended as a statement...

    From my standpoint, the Less.js implementation and syntax for extends are far more powerful than SASS and allow you to use a surgical "laser" approach with design practices, rather than using than a shotgun blast. Seems like the "sizzle" is very specifically the ability choose what you want to extend.

    However, I'm open-minded about it and I sincerely want to know if I'm missing a crucial point about extends. It seems like you might be thinking about ways of using it that hadn't occurred to me before. Can you provide some real-world use cases where this is a good practice? Maybe link to a gist?

    In the meantime, here is write up about learning SASS extends that brings some important points to light: http://8gramgorilla.com/mastering-sass-extends-and-placeholders/

    Some quotes from the write up "A problem of using a standard class selector as your @extend identifier is that you extend any styles that feature that selector anywhere in your Sass.", and "To me, I think it would be better that when you extend a selector, you only extend that specific selector."

    And there are a number of other blogs, discussions and stackoverflow answers that state the same things. And usually the spirit of the opinion on SASS extends can be summed up by another quote from that link: "I’m not convinced I like that @extends work like this but that’s how it is and it’s better to know exactly how it works."

  7. DesignByOnyx commented on Feb 6, 2013

    @DesignByOnyx

    I think you are jumping in on a discussion and have missed a little of the context here. We have 3 issues really:

    1. LESS is not adding complex selectors (eg .compound.selectors) to the tree... which I consider a bug and should be fixed immediately. The regex is too simple... we should borrow code from the sizzle engine to fix this.
    2. The :exend feature does not extend a selector within media queries... which kinda makes the feature a little useless.
    3. An :extend within a media query is extending a non-media query selector... which is wrong.

    I would like to take this opportunity to say more-specific selectors should not get extended in the way that SASS does. For example, in the example below, the .header .selector should NOT get extended (in my opinion):

    .selector { ... }
    .header .selector { ... }
    .something-else:extend(.selector) { ... }
    

    However, in the following example, the .header .selector should get extended, but not the stand-alone (less-specific) .selector:

    .selector { ... }
    .header .selector { ... }
    .something-else:extend(.header .selector) { ... }
    

    So here is what I think should happen:

    1. You should be able to pass ANY valid CSS selector to the :extend function. This is currently not possible and is a bug. This also prevents classical "embeds" from working:
    .some-selector {
        .some.other-selector;  /* This does not work, but it should */
    }
    
    1. Every instance of the exact selector should get extended, whether it's within media queries or not. In my orignal post at the very top, I should be able to :extend(.container), but currently only the non-media query definition gets extended.
    2. Unlink SASS, "more specific" instances of the selector should be left alone (eg .header .selector example above).
    3. An :extend which occurs within a media query would need to smart-copy the actually css rules from other matching media queries (see my last comment for an example of this).

    I would love to talk about this over phone and then summarize here. Feel free to call if you want:
    six one five-260-2411

  8. matthew-dean commented on Feb 6, 2013

    @matthew-dean
    Member

    I'm just catching up to this discussion, just wanted to first add a +1 for one point:

    "I would like to take this opportunity to say more-specific selectors should not get extended in the way that SASS does. For example, in the example below, the .header .selector should NOT get extended (in my opinion):"

    Correct. .selector and .header .selector are not used in the same way. It should be an exact string match. If I'm matching .selector it should only extend (add properties to) that class and that class only. And then, of course, it's up to the browser to inherit appropriately into .header .selector.

    The only way it should extend both selectors within their definitions would be something like this:

    .selector { ... }
    .header .selector { ... }
    .something-else:extend(.selector, .header .selector) { ... }
    
  9. jonschlinkert commented on Feb 7, 2013

    @jonschlinkert
    Contributor

    @DesignByOnyx, I misunderstood your point because of the statement "so that all selector patterns get matched", which I interpreted as saying that you wanted SASS-like extends. I now understand that you are not saying to extend .some-selector to all selector patterns of .some-selector, but what you were saying (and had said very clearly earlier) was that when you target any give selector pattern, even if it happens to be a compound selector, like .selector-one.selector-two, it should just work. If this is indeed what you're saying (and is is the same as @MatthewDL is saying), then + 1 and I agree completely. Sorry for the confusion... I got hung up on that statement, even when I tried to re-read it to make sense of the point.

    I doesn't help that we're discussing two issues here. One for how :extend handles selector patterns, and one for how :extend is broken in media queries. I would suggest splitting these issues apart so that discussion on either stays focused.

  10. DesignByOnyx commented on Feb 7, 2013

    @DesignByOnyx

    Thanks for the remarks. I think you understand me more clearly now. Sorry for the confusing wording. I agree that we should only be focused on making :extend work the way we think it should across media queries.

    The other [less relevant] issue has to deal with LESS's selector engine not recognizing all valid CSS selectors... which is a separate issue but should get fixed immediately. The :extend functionality will simply benefit from this fix as would the rest of the LESS's functionality. This is the fix which I think should take inspiration from the sizzle selector engine. Just a thought.

    So, now we are all on the same page. There are two different use cases to consider:

    1. A simple :extend which takes place outside of a media query. This one is simple, as all instances of the selector should get extended... whether in a media query or not.

    2. An :extend which takes place within a media query. This is very complex as the compiler would need to copy styles from other media queries and compile them within the given media query. See my previous comment about this scenario.

  11. jonschlinkert commented on Feb 7, 2013

    @jonschlinkert
    Contributor

    @DesignByOnyx would you mind creating another issue for :extend within media queries? We should rename this one too so it can be prioritized and others can add their thoughts.

  12. lukeapage commented on Feb 7, 2013

    @lukeapage
    MemberAuthor

    regarding this point

    .selector { ... }
    .header .selector { ... }
    .something-else:extend(.selector) { }
    

    should not extend .header .selector

    I thought the main point of extend was where you had a library of css targeting one class, and you had html you were restricted on changing with a different class.. so if I want everywhere that matches .selector to match .something-else then I do the above so that I get

    .selector, 
    .something-else { ... }
    .header .selector,
    .header .something-else { ... }
    

    when talking about not wanting something to happen - please could you clarify why you don't want it to happen and what your particular use-case for the extend is?

  13. lukeapage commented on Feb 7, 2013

    @lukeapage
    MemberAuthor

    see #1165 for a discussion of extend around media queries. I don't think we have it nailed down in this discussion exactly what it should do when you use extend inside a media query.

  14. jonschlinkert commented on Feb 7, 2013

    @jonschlinkert
    Contributor

    @agatronic

    I thought the main point of extend was where you had a library of css targeting one class, and you had html you were restricted on changing with a different class.. so if I want everywhere that matches .selector to match .something-else then I do the above so that...

    @DesignByOnyx

    Maybe we are saying the same thing, but since @agatronic made his comment, I want to be clear:

    This one is simple, as all instances of the selector should get extended... whether in a media query or not.

    To clarify, you only mean "exact instances" (as you said further above) - I'm going to give examples for this below. Correct me if I'm wrong because this isn't how less.js works today, and I believe it's what Luke is asking for additional clarification on.

    IMHO :extend should be fixed to act like the direct inverse of a mixin. If I use a mixin on a selector, the selector inherits the properties of that mixin, but the mixin does not extend to every instance of a selector to which it has been applied. I don't think that :extend should be applied to every instance of the selector being extended either.

    So if I do this:

    .square {
        width: 300px;
        .header {
            color: black;
        }
    }
    
    .circle:extend(.square) {
        border-radius: 150px;
    }

    I would expect to see this:

    .square,
    .circle {
        width: 300px;
    }
    .square .header {
        color: black;
    }
    .circle {
        border-radius: 150px;
    }

    not this...

    .square,
    .circle {
        width: 300px;
    }
    .square .header,
    .circle .header {
        color: black;
    }
    .circle {
        border-radius: 150px;
    }

    If I wanted the last result I would do this:

    .circle:extend(.square) {
        border-radius: 150px;
        .header:extend(.square .header);
    }

    To expand the example, currently I can do the following with :extends:

    .shape {
        width: 300px;
        background: red;
        .header {
            color: black;
        }
    }
    .square {
        &:extend(.shape);
        height: 300px;
    }
    .circle {
        &:extend(.shape);
        height: 300px;
        border-radius: 150px;
    }
    .rectangle {
        &:extend(.shape);
        height: 150px;
    }

    and it compiles to this:

    .shape,
    .square,
    .circle,
    .rectangle {
      width: 300px;
      background: red;
    }
    .shape .header,
    .square .header,
    .circle .header,
    .rectangle .header {
      color: black;
    }
    .square {
      height: 300px;
    }
    .circle {
      height: 300px;
      border-radius: 150px;
    }
    .rectangle {
      height: 150px;
    }

    I don't want to extend the .header, why would it do that? Now, I have to check through my entire library of LESS files to make sure nothing is extending a class I'm about add a "modifier" class to, or that class will extended as well. What I really want to get is this:

    .shape,
    .square,
    .circle,
    .rectangle {
      width: 300px;
      background: red;
    }
    .shape .header {
      color: black;
    }
    .square {
      height: 300px;
    }
    .circle {
      height: 300px;
      border-radius: 150px;
    }
    .rectangle {
      height: 150px;
    }

    Let's take a real-world example though, something more concrete, so you can see how this is effecting the wildlife:

    .sasquatch:extend(.yeti) {
        z-index: -1;
        .fur {
            color: brown;
            background: brown;
        }
    }
    .yeti {
        height: really tall;
        visibility: camouflaged;
    }
    .yeti .fur  {
        color: white;
        background: white;
    }

    Today it compiles to this:

    .sasquatch {
        z-index: -1;
    }
    .sasquatch .fur {
        color: brown;
        background: brown;
    }
    .yeti,
    .sasquatch {
        height: really tall;
        visibility: camouflaged;
    }
    // So far, so good. All true.
    .yeti .fur,
    .sasquatch .fur {
        color: white; // Wait, what?! okay this is not good
        background: white; // sasquatches need dark backgrounds to hide. damn you cascade, and damn you extends! 
    }

    Too bad we can't do this: .sasquatch:extend:not(.yeti .fur) {}

    Because now our friend is in danger:

    .hunter:target:only-of-type[class*="-hominid"] {
        // Why must he be this way? What's wrong with hunting less endearing species, like pandas?
        content: "Success" attr(data-status);
    }

    And then:

    .sasquatch:last-of-type {
        content: "unfortunately";
        display: never again;
    }

    No more sasquatches. Shame. All because of the unintended consequences of extending all instances of a selector.

  15. lukeapage commented on Feb 7, 2013

    @lukeapage
    MemberAuthor

    I think I see your point. In your shape circle example, If I wanted header to be black I would just set the class name to "shape circle".. where as extend would be useful If I wanted to extract shape's properties without including any other sub properties?

    I definitely think we should limit things with extend as much as possible.. that way we can see peoples reaction to it and the use-cases that come up and extend (ha) the behaviour from there.. if we go all out from the start we might end up with something useless.

  16. 129 remaining items

  17. lukeapage commented on Mar 5, 2013

    @lukeapage
    MemberAuthor
    .a { .b & .c { // shouldn't match
    .a { .b & { .c { // should match
    :extend(.b .a deep)
    

    is a good example btw. of two selectors that should match/notmatch with @MatthewDL's interpretation of deep, but I think are going to be impossible to tell apart in the current code.

  18. DesignByOnyx commented on Mar 5, 2013

    @DesignByOnyx

    @MatthewDL - you are correct, we need to come to some sort of consensus. Let's take a simple example we have already been using:

    .button {
        .a { prop1:prop1; }
        .b { prop2:prop2; }
    }
    .button .c { prop3:prop3; }
    test:extend(.button deep);
    

    So we agree that your way would not match .button .c and my way does. I think we both understand why we each hold the opinion that we do. Hand shake... moving forward towards reconciliation.

    For the sake of conversation, let's consider all selectors where .button is the left-most part of the selector as the "base class" for all things .button (remember that every <element class="button" /> will get these base styles). By my thinking, if something deep extends .button, all "base class" properties and child properties should get extended (I think I have made this clear, don't mean to beat the point).

    In the example above, if "prop3" should no longer be part of the base class, then I need to do a multi-shallow-extend sort of like @jonschlinkert argued at the beginning of this thread:

    test:extend(.button, button .a, .button .b) { }
    

    ... OR give it a new "base class": #main .button .c

    .button {
        .a { prop1:prop1; }
        .b { prop2:prop2; }
    }
    #main .button .c { prop3:prop3; }
    test:extend(.button deep);
    


    @lukeapage - you provided the following example:

    .a { .a { .b & {
    :extend(.b .a deep)
    

    You are correct that .b .a would match. The "deep" modifier would only be useful if there were actually some "deeper" styles to extend:

    .a { .a { .b & { .c {
    :extend(.b .a deep)
    

    Now let me address your next example:

    .a { .b & .c { // shouldn't match
    .a { .b & { .c { // should match
    :extend(.b .a deep)
    

    I disagree and think BOTH should match... again because the fact that .c is nested in one but not the other is merely a preference. In both cases, .b .a is the left-most part of the selector... the "base class" if you will.

    Here is how I view the "any/exact" modifiers in lay terms:

    • :extend(.b .a exact) - find all selectors where .b .a is the left-most part of the final selector
    • :extend(.b .a any) - find all selectors where .b .a is ANYwhere in the final selector (beginning, middle, or end).
  19. lukeapage commented on Mar 5, 2013

    @lukeapage
    MemberAuthor

    @DesignByOnyx I have edited my last example post to make it clearer the example is not what I think should happen but instead two selectors that the current code can't differentiate.. I agree with you, that both should match.

    "your view" of "any/exact" is extremely confusing to the whole picture. The original "approved" idea was two properties, shallow/deep and any/exact. exact means matches entire selector only and nothing below it - something I think is a great innovation in our syntax... we do not want to redefine it to mean the "left-most part".

    We are talking about the definition of shallow/deep which are sub options. When considering how extend works on the output selectors (e.g. how @DesignByOnyx wants it to work) it essentially boils down to whether you allow parts before or after - those two booleans give you the 4 names.. this was my reason for suggesting that, assuming we were to go with what you want, we must rename the options because at the moment they are confusing. Perhaps this is supported by the fact you confused them above?

    @MatthewDL I forgot to also mention that your variable example works for variables, but not for mixins

    .a { .b {
        background: red;
      }}
     .a .b {
        background: green;
     }
    .c {
      .a.b; // matches both
    }
    

    also I kind of think that doing this

    .button .a { }   // intentionally refactored / removed to not be included on the extend
    

    is something I would recommend people not to do - how come I want to extend button and all classes related later classes but the target decides it doesn't want to be extended when used to select a child link? Shouldn't it be the extender that decides what it wants to target (with the shallow/deep options). By treating the selectors differently we are putting in this extra bit of weird behaviour over how selectors are matched and putting the control over that with whom-ever writes the source selector

    I am worried this debate will go on forever (there seems to be a large amount of content generated from misunderstanding) and am still fond of only supporting no options (exact) and all, using @MatthewDL definition that everyone agreed with way back on the thread.. we can always see what feedback we get from that and leave this open to a later version.

  20. DesignByOnyx commented on Mar 6, 2013

    @DesignByOnyx

    Man I don't understand how we got so off base. You make the following comment:

    exact means matches entire selector only and nothing below it.

    Correct.

    THEN, if someone passes "deep", it will match items below it, right? By original definition, "deep" should extend all nested selectors/properties. I consider .a, .b, and .c to be "nested" below the button here... despite the syntax... and this point is really important to me:

    .button {
        .a { prop1:prop1; }
        .b { prop2:prop2; }
    }
    .button .c { prop3:prop3; }
    

    Now, I never... ever... ever took "deep" OR "exact" to mean that it would match .button in the following context, and I cannot understand how you can think that it should or that it's even useful:

    #header {
        .button {
            .a { prop1:prop1; }
            .b { prop2:prop2; }
        }
    }
    

    If you wanted to match .button in the above example, you should have to do one of two things (note, I am leaving out "deep" because I am just trying to match .button right now):

    • :extend(#header .button) { } - This is very explicit... no confusion
    • extend(.button any) { } - This is very willy nilly "extend everything", but useful is some situations

    Please think about the DOM:

    <header>
        <span class="button">Button1</span>
    </header>
    <div role="main">
        <span class="button">Button2</span>
        <div class="call-to-action cta-1">
            <a href="#">Click Me</a>
        </div> 
        <div class="call-to-action cta-2">
            <a href="#">Click Me</a>
        </div>
    </div>

    And this LESS:

    .button {
        .a { prop1:prop1; }
        .b { prop2:prop2; }
    }
    .button .c { prop3:prop3; }
    #header {
        .button {
            .a { prop4:prop4; }
        }
    }
    
    /* Make all call-to-action links look like buttons */
    .call-to-action a:extend(.button deep) {  /* Props 1-3 */ }
    
    /* Make this link look just like the header button even though it's not in the header */
    .cta-2 a:extend(#header .button deep) {  /* Prop4 */ }
    
    /* Make all submit buttons get the same styles as .button */
    input[type="submit"]:extend(.button deep any) { /* Props 1-4 */ }
    

    If you still don't agree, then I am done with this thread and this whole discussion was pointless for me. This is my last comment on this issue. Please re-read my last several comments if you still need clarification on how I see it.

  21. ricardobeat commented on Mar 6, 2013

    @ricardobeat
    Contributor

    Pardon me, but what is going on here? Why can't we just leave this pseudo-selector idea and all the black magic aside, do only exact selector matches (like stylus) and implement the obvious:

    .button { ... }
    
    .action {
        extend(.button);
    }
    
    // or this, a nice complement to standard mixin syntax
    .action {
        .button+;
    }
    

    I haven't read the 396 posts in this issue, so I might be just pissing all over the work done so far, but I feel like just leaving the building. It's been a couple years since this surfaced as a needed feature.

  22. jonschlinkert commented on Mar 6, 2013

    @jonschlinkert
    Contributor

    @ricardobeat noted, and we agree.

    This conversation has gone on this long because the core team cares so much about everyone's expectations. If you read through the discussions you would see that the discussion has gone this long because others disagreed with your point (even suggesting we do "exact match" like Stylus' implementation was made. by me actually).

    Why can't we just leave this pseudo-selector idea and all the black magic aside

    That boat has sailed. It was discussed at length by a number of people including cloudhead. More information can be found on the original request for extend, submitted just over a year ago: #509.

    I feel like just leaving the building. It's been a couple years since this surfaced as a needed feature.

    I hear you about the frustration, I felt like leaving the building too before @MatthewDL and @lukeapage graciously stepped up and turned the project around, gratis. Remember that we're all open source contributors giving to this is what little free time we have.

    Stay passionate about seeing progress with LESS, but be patient. We're going to get this resolved.

  23. dmi3y commented on Mar 6, 2013

    @dmi3y

    I was thinking around it, sorry still in reading all the posts, so would probably miss something, as my point possible way is extending vocabulary, like Luke suggested with from/upto, let's say something like

    .button {
        .a { prop1:prop1; }
        .b { prop2:prop2; }
    }
    .button .c { prop3:prop3; }
    
    .test:extend(.button before .c) // before/after sounds familiar, by nature deep and exact, though it might be fun to have something shallow here;)
    

    I also see reason in scope behavior suggested by Matthew, though this approach looks less attractive in situation when you need make quick patch to someone's spagetti code and you are not entirely sure about what's the code structure is, if it is consistent or not, and so you will have to go into deeper refactoring.

    And some thoughts about any keyword as I got it, sorry for repeating it.

    .button {
        .a { prop1:prop1; }
        .b { prop2:prop2; }
    }
    .button .c { prop3:prop3; }
    
    #less:extend(.c any) { ... }
    

    makes class substitution?

    ...
    .button .c,
    .button #less { ... }
    

    or just replacement of the whole selector?

     ....
    .button .c,
    #less { ... }    
    

    I think it is first, although could you think over situations when the latter could be applicable?

  24. dmi3y commented on Mar 6, 2013

    @dmi3y

    Why can't we just leave this pseudo-selector idea and all the black magic aside

    erh, suppose, because it is not so funny;) (gone to prepare css/html/javascript elecsir:D)

    PS: I am sorry for off top, if you feel it is insulting just let me know and I will remove it.

  25. ricardobeat commented on Mar 6, 2013

    @ricardobeat
    Contributor

    @jonschlinkert yes, I followed that issue. at some point it was simply arbitrarily decided that the syntax was done, just like it had been changed to ++ a few months earlier with a pair of opinions. I don't see how a pre-processor directive belongs amongst a CSS selector. It has no parallel to jQuery filters or any pseudo-selectors as hinted in that discussion.

    While the original SASS-like +.button; syntax was certainly confusing, putting the + at the end is nice: .button; copies/beams down properties, .button+; adds/beams up the selector, and could be just syntax sugar for a extend(.button) method. It's current a syntax error, so not ambiguous at all.

    Anyway, I know I'm late to the party. As long as &:extend is supported and the any, deep insanity is ignored I think everyone will be happy :)

  26. Merg1255 commented on Mar 6, 2013

    @Merg1255

    since this is the only remaining issue for 1.4, do we have any news on where about it will be released?..

  27. lukeapage commented on Mar 7, 2013

    @lukeapage
    MemberAuthor

    We (me, Jon, Matthew) have decided to go with exact (no options) and all for now and revisit this after release and outside reactions.

    You can try this out today on less2css.org (select drop down then alpha) and I'm planning on releasing a beta today if I finish chaining.

  28. jonschlinkert commented on Mar 7, 2013

    @jonschlinkert
    Contributor

    👍 nice job, thank you @lukeapage.

  29. Merg1255 commented on Mar 7, 2013

    @Merg1255

    thank you @lukeapage ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions