-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Recursive rulesets and extending rulesets #2211
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
Speaking of "override" vs. "cascade" stuff - I'd say to use DR for the first (it's a variable and as any plain variable it overrides) and mixin for the second (mixins cascade). In other words:
|
As a follow up to this, this is how I solved extending vs. overriding.
|
Even though I found a solution, I still think this should be left open, because the compiler should detect unrecoverable loops and throw an error, not lock up. |
That's quite neat pattern. |
Thanks, it took me about 30 iterations to come up with that pattern. I'm building it into an OOLESS library, so it will have a production use at some point. |
Closing as expected behaviour. |
I've just started playing with rulesets, and I had this construction.
I wanted to try overriding the detached ruleset. So far, so good.
Works awesome! BUT... then I thought, "Hmm, what if someone wanted to keep the existing ruleset and just extend it." I knew I couldn't use extend because there was no selector, so I tried this (even though I figured it wouldn't work).
At that point, the compiler locked up and was unrecoverable.
Now, granted, I wrote what looks like an obvious recursion loop. Clearly my fault. That said, I'm wondering if there's a way to detect / escape / throw an error when this occurs?
(Follow up ?'s: is there a way to 1. extend a ruleset, 2. reference a ruleset via a namespace like:
#library > .nav() > @list();
rather than needing to write#library > .nav() { @list(); }
. I didn't see this in the docs.)The text was updated successfully, but these errors were encountered: