-
Notifications
You must be signed in to change notification settings - Fork 1
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
Discussion on Interpolation #13
Comments
For this discussion, it might be useful to note the following:
|
Note: The following is meant primarily as food for thought; I'm just spitballing.
|
div.:expr(replace(extract(foo bar baz, #ns[offset] - 2), a, lu)) {
// ...
} After all, a minimal verbosity was never a goal of Less, and unconscious hunt for it would rather lead to a thing... like hmm... Perl. @name: replace(extract(foo bar baz, #ns[offset] - 2), a, lu);
div.@{name} {
// ...
} also does not look like a major fault). |
I don't disagree with that. Or, at the least, the feature seems less of a priority to me than other 3.0 features, so that may already indicate that it doesn't have enough value to be added at this time. After all, it's not a requirement for namespacing. It's just that we addressed interpolation in the previous namespacing discussion, and the newer proposed syntax doesn't really gel with interpolation syntax. So, it's a little bit of a conflict, unless we simply require the author to assign a namespaced var to a local var, and use that with interpolation. Which is really not bad as an interim solution. Just to prioritize other features, we could possibly shelve this for now and re-consider in the context of a future release? Or should we close entirely? What do you think? |
I think it's OK to leave it open, just to demonstrate that the feature is/was considered but w/o any solid outcome yet. |
Old thread, but what about just bringing in Sass's syntax for interpolation, where it can hold an expression? Basically, any place that can old an interpolated var can hold the interpolated expression. As in: .class-@{var} { }
// and
.class-#{@var + 1} { } In terms of parsing and evaluation, this would have very little overhead, as a single Less variable today can itself point to an operation. I would even suggest deprecating There's no reason to re-invent the wheel here, and I see nothing inherently wrong / incompatible / problematic with Sass's interpolation syntax. |
Related to #12. Moved from that issue:
For interpolators, I could see us doing one of two things:
...but that leaves a redundant
@
in the first example:2. Use a more generic interpolation syntax, such as borrowing from mustache:
{{
}}
(but could be another pair of something, if the language starts to look too curly-bracy. But used here just to demo concept)Existing interpolation syntax (1) could be deprecated but still supported throughout 3.x.
For single property accessing, syntax doesn't need to change.
One possible benefit of adopting a new interpolation syntax is that it doesn't need to just contain identifiers but could, like mustache, contain expressions:
That's just a possible benefit, not a necessity.
Response from @seven-phases-max (which I agreed with):
The text was updated successfully, but these errors were encountered: