Modifier without mixin
See original GitHub issueI’d like to be able to use the underlying goodness of this addon in Octane mode using a modifier:
<div {{did-enter-viewport this.myCallback}}></div>
This would let me move my component to a native class component / glimmer components without mixins. I could also put myCallback
in an Ember helper, and avoid a JS context for my component entirely.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
BEM Mixins - CSS-Tricks
BEM – meaning block, element, modifier – is a front-end naming methodology thought up by the guys at Yandex. It is a smart...
Read more >Features In-Depth | Less.js
Variables and mixins defined in a mixin are visible and can be used in caller's scope. There is only one exception: a variable...
Read more >Pass argument to Sass BEM mixin to @extend parent
I need to apply the following modifiers to various classes within my app. I have written a mixin for this that looks like...
Read more >Pushing BEM to the next level with Sass 3.4 | by Marc Mintel
You could not create a mixin that gets the name of a block and adds an element or modifier suffix, because the elements...
Read more >Use BEM selectors with SASS - OpenClassrooms
This means creating a block__element--modifier selector, but since you've elevated the specificity of your element, you must also make sure that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had not seen that part of the README actually, thanks! But there are two features I’d still like:
watchElement
with the modifier, rather than having to use did-insert, select an element and bind the handler.A “native” modifier, rather than using
did-insert
would solve both of these problems. The missing piece (at least to use the existing Service implementation) is to figure out how to inject a service into a modifier. I’m not sure if it’s possible to make a class-based modifier.Less complicated is better 👍 I like it so far.
Also, one thing to bring up is the act of
watchElement
for certain scenarios isn’t standard necessarily. For example, I might need to wait a tick to actually start watching the element in question (b/c say it is a content heavy page and the page doesn’t have height yet). Likely I wouldn’t be able to use it for the examples I have. Not necessarily needs to be taken into consideration for this modifier, but thought I would bring that up in case you come across solution in your exploration.