modifyClass
itself is not deprecated. It’s a risky customization method, and you should take precautions when using it (as described in the doc @don linked), but we don’t have any imminent plans to remove it.
The reason we’re printing a deprecation message for component:topic-list
and component:topic-list-items
is that those components are the legacy implementation of the topic list, and are not used when the glimmer topic list is enabled. Now, we have a set of glimmer components like components/topic-list/item
.
So, technically, you could use modifyClass
on those new components. But, because they’re glimmer components, you won’t be able to modify the style tag via the JS class, so it won’t help with the problem in the OP.
We have a similar ‘masonry’ mode in the official d-topic-thumbnails theme component, so it’s worth looking at how that’s implemented. We add a unique class to each ‘row’ of the topic list:
Then we render a dynamic <style>
tag in a separate plugin-outlet, which targets those class names:
That said… it is a little convoluted, so perhaps we should look at adding a specific valueTransformer to allow changing the style=
attribute. It’s a little tricky because of Ember’s xss/htmlSafe protections on that attribute… but I’m sure we could get something working.