-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0.0 - Changes in default options #1872
Comments
I think that 2.0 (or major version) is the right time to implement these sorts of "breaking" changes. After all, these aren't even deprecations, they're just changing defaults. Either way, having a nice round number people can easily remember will make it easier for people to pick the right version or check the site to see the change log and refactor accordingly. |
My feeling is that 2.0 is "okay" for strictMath, but if we do so, we really, really need to update the docs immediately to show the preferred math method. On no JavaScript, my feeling is not yet. It would cause some headaches if done now. Not everyone is using a Less compiling tool that has these switches available (I would consider it "advanced" usage of Less to mess with switches), and refactoring of mixin libraries that rely on JS would not necessarily be as easy. We certainly don't have to wait as long between 2.0 and 3.0 as we did from 1.0 to 2.0. I think the safest point to migrate from JS inline is when we have our plugin system, environment adapters, and API finished, so that we can point to some clearer migration path possibilities. |
I have switched to (The other day I had a though that some kind of less strict math option would possibly be more handy, e.g. require parens only for division or a sort of). |
Completely agree with this. IMHO it's just un-intuitive to users, so no matter how much we update the docs they will still come here first to report it as an issue, rather than assume that they are doing something wrong. This was evidenced by the number of issues we received during the brief time that
Indeed. I'm also not a fan of removing support for javascript. This has always offered a way of hacking around features that we don't support. I can see how someone who only uses less.js in the browser would want a flag to turn it off though. But in node.js, server-side, why turn it off? |
it's also worth mentioning that if we get some kind of support for runtime config files, like |
First, because not all JavaScript environments can eval imported JavaScript (as it's unsecure), but also, why would you want a hacked language? How is it okay that the supported method for an issue that Less doesn't solve is injecting an unrelated scripting language into your CSS-like syntax? Doesn't that defeat the purpose of a CSS-like language? Wouldn't that be less desirable than just making a more scripting-like adaptation like SASS? Wouldn't the point be to keep the syntax of LESS and the scripting language that parses it separate? |
I've often wondered about this myself, if the few use cases where there's conflict leaves more syntax where it's not needed. I feel like it's philosophically problematic to choose math operations and syntax that directly conflict with and are ambiguous with CSS statements. We probably could have avoided it if |
One solution is to make special cases for bracketed functions like calc. On Saturday, February 15, 2014, Matthew Dean notifications@github.com
|
What about font and background shorthand? I wonder why we never thought of bringing in |
But getting back to the question of this issue: should we turn these options on by default. Some of us were on the fence about math, and some of the team are "no"s, so I think we can safely say no for 2.0. I think we should revisit later after we've done API / plugin work and have a roadmap for 3.0. Agreed? |
Maybe its the right solution but we shouldn't use strict.. e.g. at the moment inside certain constructs we "turn on" strict math - so that you can still do math inside media query statements for instance and font statements but you need the brackets. If we just extend that to calc (the only missing one I believe) then people do not need strict maths - but we can still keep the option around in case people prefer to be explicit. Anyway, closing this as we will not change any default options for 2.0.0 |
Perhaps we should warn the user if there are any |
The way it works for |
I would find it reasonable to require strict math only in fonts, calc and media ratio. I'm usually for consistency, but there is no need to annoy users with additional The problem with |
yes If I see |
I'm with @SomMeri on this one. The special cases are few enough to warrant their own rule for requiring strictMath while the rest should be non-strict. |
Actually |
Also, the "special cases" (e.g. properties where |
see #1880 |
Like @seven-phases-max said, CSS will probably keep adding "/" for things. Special-casing properties doesn't seem ideal either. While parentheses is annoying to some, at least the behavior is completely predictable. The goal should not be to write a different type of math syntax based on which property you happened to write. |
strict math - turn on by default?
no javascript - turn on by default ?
As @matthew-dean suggested, I agree we should either make this change for 2.0 or wait till 3 or never make the change.
I'm pretty agnostic about both of @matthew-dean suggestions above, this is just a dedicated issue for it.
The text was updated successfully, but these errors were encountered: