You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I can not use the custom tag "ALL" with :extend #2219
Interesting. It might have been better to designate extend flags with ! similar to !important, which is a bit more consistent with CSS. We could allow either ! or without for extend keywords for backwards compatibility. As in:
:extend( some_selector all )
//or
:extend( some_selector !all )
And then maybe optionally offer a --strict-flags option. Obviously the short-term solution is to not use or extend a selector that is also a keyword. With "custom elements" in HTML5, elements are required to be hyphen-separated, so it's not up to spec (but that doesn't mean you can't do it, or use "all" as a tag for other formats that use CSS).
It might work if you refer to that tag with a capital in.. the keyword is
case sensitive and I think the tag isn't.. I'm just not sure if the extend
matching works case insensitive (it should).
E.g.
The fact that the situation is not similar to the situation with !important.
The parameter passed to the :extend is selector.
For backward compatibility, you can leave both.
Mark as deprecated and remove a couple of years.
I like the approach suggested by @LukePage. :extend(All) could be a slick workaround. Also I guess some alternative "more CSS safe" keyword like --less-all would make sense too, but w/o removing current all. As a user I do not use any all tags in my projects and I definitely don't want to type --less-all where I can go with just all...
(Looking forward I'm just scared a bit of being forced to use something like :extend(.clearfix --less-deep --less-scoped) :)
@blooddy It still doesn't look like it would conflict, if ever adopted, based on positioning in relation to the selector and whitespace. I originally was against ! for flags in Less but without it, our flags look like selectors.
That said, I'm also for this case-insensitive short-term solution.
and to expand my opinion, I agree with previous conversation that maybe we got it wrong with the flags. I'll look at changing extend to be case insensitive.
Interestingly selectors case-sensitivity depends on the document that is applying the css. So in strict mode in html, class and attribute selectors are case sensitive, whilst tag names are case insensitive. However if the document is xml and not html, then the tag names are also case sensitive...
It seems if I make extend case insensitive it should at least only apply to tag names..
Activity
matthew-dean commentedon Oct 9, 2014
Interesting. It might have been better to designate extend flags with
!similar to!important, which is a bit more consistent with CSS. We could allow either!or without for extend keywords for backwards compatibility. As in:And then maybe optionally offer a --strict-flags option. Obviously the short-term solution is to not use or extend a selector that is also a keyword. With "custom elements" in HTML5, elements are required to be hyphen-separated, so it's not up to spec (but that doesn't mean you can't do it, or use "all" as a tag for other formats that use CSS).
[-]I can not use the custom tag "ALL"[/-][+]I can not use the custom tag "ALL" with :extend[/+]lukeapage commentedon Oct 10, 2014
It might work if you refer to that tag with a capital in.. the keyword is
case sensitive and I think the tag isn't.. I'm just not sure if the extend
matching works case insensitive (it should).
E.g.
extend( selectors ALL)
seven-phases-max commentedon Oct 10, 2014
Nope, curiously
extendis case-sensitive currently (so.Xdoes not match.x), probably we need another ticket for this bug :)lukeapage commentedon Oct 10, 2014
I think this use case is unusual so if we can fix extend to be case
insensitive and keep the keyword sensitive it would be an ok permanent
workaround?
blooddy commentedon Oct 11, 2014
The fact that the situation is not similar to the situation with
!important.The parameter passed to the
:extendis selector.For backward compatibility, you can leave both.
Mark as deprecated and remove a couple of years.
blooddy commentedon Oct 11, 2014
the use of "!" not recommended, as it is likely that this character will be used in the following specifications css.
http://www.smashingmagazine.com/2013/01/21/sneak-peek-future-selectors-level-4/
I think that in all structures less better to stick to the standard syntax css, that there were no conflicts.
seven-phases-max commentedon Oct 11, 2014
I like the approach suggested by @LukePage.
:extend(All)could be a slick workaround. Also I guess some alternative "more CSS safe" keyword like--less-allwould make sense too, but w/o removing currentall. As a user I do not use anyalltags in my projects and I definitely don't want to type--less-allwhere I can go with justall...(Looking forward I'm just scared a bit of being forced to use something like
:extend(.clearfix --less-deep --less-scoped):)matthew-dean commentedon Oct 11, 2014
@blooddy It still doesn't look like it would conflict, if ever adopted, based on positioning in relation to the selector and whitespace. I originally was against
!for flags in Less but without it, our flags look like selectors.That said, I'm also for this case-insensitive short-term solution.
lukeapage commentedon Oct 11, 2014
and to expand my opinion, I agree with previous conversation that maybe we got it wrong with the flags. I'll look at changing extend to be case insensitive.
lukeapage commentedon Oct 11, 2014
Interestingly selectors case-sensitivity depends on the document that is applying the css. So in strict mode in html, class and attribute selectors are case sensitive, whilst tag names are case insensitive. However if the document is xml and not html, then the tag names are also case sensitive...
It seems if I make extend case insensitive it should at least only apply to tag names..
lukeapage commentedon Oct 11, 2014
And its a hell of a work to detect if "tag" is a tag in this case
Do people still think its a good idea to make it case insensitive?
The easy fix is in extend visitor
becomes