-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Option to prefix functions? #2102
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
Comments
Prefixing functions would be a great way to avoid issues like the one outlined above and would more clearly differentiate Less.js functions from native CSS functions, much like is achieved with jQuery through Setting color: color() to: color: _color() |
Some people (e.g. me) don't like "underscore bloated" code for its dirty look. Actually Less already has a solution for ambiguous function names (e.g. I think we could do the same for |
This is where a |
Another example of something that could be achieved in the future with a plugin in v2 |
(it doesn't seem like a core concern at the moment) though its an interesting idea |
I've heard that v2 syntax will be |
Hello? |
No there are no plans for {{ }}
|
Running into this issue again but with cssnext. http://lesscss.org/usage/#plugins-for-plugin-authors does not mention whether access is given to Less' core functions/methods. I haven't yet started any dev on it, but may have to for my current project. |
Nothing there is write-protected so it's not a problem to remove core |
Won't that cause issues with mixins, though? They could be provided by a dependency. Is there a way to prefix the function only in a css context? |
Mixins? You mean, will it break a code that uses Less's
Define "CSS context". Less functions can be used everywhere CSS functions can, so there's no "non-CSS context" (or in other words, any CSS code you pass through the Less (except |
I was hoping to force the use of underscore prefixed functions outside of mixins only. Mixins should still support unprefixed. It makes sense that this wouldn't be possible. |
It's possible to do the opposite (i.e. limit your & {
@plugin "your-disable-color-plugin.js";
// here goes the code (including imports) where you want `nextcss` `color(...)`
} where functions.add("color", function() {}); (or so, honestly I did not used this plugin format yet). |
Interesting, but the goal is to provide a means of keeping the Less CSS code as future-CSS-like as possible -- meaning that I suppose that I could write a new color function that looks for differing arguments and either returns literal input or uses existing functionality. Sounds like a can of bugs, though. |
Published less-plugin-future-compat. |
I'm using Myth with Less.js and would prefer to use the CSS spec of
color()
and not Less.js'. I'd also prefer not to muck up my code with "tilde quotes":I see this as being similar to the
strictMath
option.Essentially, I'd like to use Less.js mainly for its nesting ability only.Edit:
Actually, I need
data-uri()
, so disabling options is not a great idea. New idea in following comment.The text was updated successfully, but these errors were encountered: