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
Earlier versions of Less offered support for CSS functions that weren't yet supported cross-browser, acting as a de facto Babel-esque (although pre-Babel) polyfill for future CSS syntax.
Functions that still act as polyfills (don't have cross-browser support) should be discussed, but IMO well-supported functions should stop being polyfilled, and future Less versions should probably not try to polyfill CSS functions.
It depends on what you mean with "polyfilled". Note for example the built-in rgba is not really a polyfill simply because of something like darken(rgba(1, 2, 3, .4), 5%) <- here it must be evaluated as a Less function that accepts some args (numbers in a simple case) and returns a built-in color object for a further manipulation.
After all also note foo: rgba(1, 2, 3, .4); compiles to foo: rgba(1, 2, 3, .4); so I'm not quite sure where you got this idea of these functions being a polyfills at all.
In a long run I guess we could consider to return to a generic idea (mentioned many times here and there in various issues) of "not evaluating things until they are actually used" but it's something more complex than just "removing" rgba et al functions.
It depends on what you mean with "polyfilled". Note for example the built-in rgba is not really a polyfill simply because of something like darken(rgba(1, 2, 3, .4), 5%) <- here it must be evaluated as a Less function that accepts some args (numbers in a simple case) and returns a built-in color object for a further manipulation.
That's a good point. So if we need to evaluate it sometimes, we can't really remove the function. 🤔
In a long run I guess we could consider to return to a generic idea (mentioned many times here and there in various issues) of "not evaluating things until they are actually used" but it's something more complex than just "removing" rgba et al functions.
changed the title [-][Proposal] Remove legacy monkey-patch functions[/-][+][Discussion] How to deal with CSS functions w/ custom properties[/+]on Jun 4, 2018
changed the title [-][Discussion] How to deal with CSS functions w/ custom properties[/-][+][Proposal] Remove legacy monkey-patch functions[/+]on Jun 4, 2018
@matthew-dean@seven-phases-max
How about renaming Less color functions to something with a prefix?
For example: toRgba, makeRgba, colorRgba etc.
So they will not conflict with CSS functions.
@shrpne I think that will very spoil the very purpose of the whole thing. It's not just about "some Less functions" - it's about The Colors (as universal thing) in Less. It's not some rgba or so, it's also the same thing with any other color representations like #123, red and so on (will you also purpose some less-hex-color(123), less-red and etc?). There's no point in having things like:
@some-color: *any ordinal value here*; // please don't force me to use some freaking crypted garbage here, it's not what I installed Less for and bother with it at all /**/
foo {
bar: darken(@some-color, 5%);
}
Yes, it may be conflicting with some newest CSS stuff but that's what things like #2986 are for.
For the rest honestly I don't see the point in using Less then at all. For 100% CSS-compatibility one just uses CSS. If we are for some superset language we automatically agree it may be incompatible (hopefully temporary) at some point.
Activity
seven-phases-max commentedon Jun 2, 2018
It depends on what you mean with "polyfilled". Note for example the built-in
rgbais not really a polyfill simply because of something likedarken(rgba(1, 2, 3, .4), 5%)<- here it must be evaluated as a Less function that accepts some args (numbers in a simple case) and returns a built-in color object for a further manipulation.After all also note
foo: rgba(1, 2, 3, .4);compiles tofoo: rgba(1, 2, 3, .4);so I'm not quite sure where you got this idea of these functions being a polyfills at all.In a long run I guess we could consider to return to a generic idea (mentioned many times here and there in various issues) of "not evaluating things until they are actually used" but it's something more complex than just "removing"
rgbaet al functions.matthew-dean commentedon Jun 4, 2018
That's a good point. So if we need to evaluate it sometimes, we can't really remove the function. 🤔
Yeah maybe that's the better approach.
[-][Proposal] Remove legacy monkey-patch functions[/-][+][Discussion] How to deal with CSS functions w/ custom properties[/+][-][Discussion] How to deal with CSS functions w/ custom properties[/-][+][Proposal] Remove legacy monkey-patch functions[/+]matthew-dean commentedon Jun 4, 2018
I renamed this but I think I'll close this in favor of discussion at #2986.
shrpne commentedon Jun 7, 2018
@matthew-dean @seven-phases-max
How about renaming Less color functions to something with a prefix?
For example: toRgba, makeRgba, colorRgba etc.
So they will not conflict with CSS functions.
seven-phases-max commentedon Jun 8, 2018
@shrpne I think that will very spoil the very purpose of the whole thing. It's not just about "some Less functions" - it's about The Colors (as universal thing) in Less. It's not some
rgbaor so, it's also the same thing with any other color representations like#123,redand so on (will you also purpose someless-hex-color(123),less-redand etc?). There's no point in having things like:Yes, it may be conflicting with some newest CSS stuff but that's what things like #2986 are for.
For the rest honestly I don't see the point in using Less then at all. For 100% CSS-compatibility one just uses CSS. If we are for some superset language we automatically agree it may be incompatible (hopefully temporary) at some point.