-
-
Notifications
You must be signed in to change notification settings - Fork 84
Description
The stimulus_controller function is a great addition but is not feature complete. Targets and actions are already discussed here, so I won't talk about it. However classes are not covered.
As stated by the Stimulus documentation:
CSS class attributes must be specified on the same element as the data-controller attribute.
I think that stimulus_controller should add classes support too. But, I don't know how the function signature should change to support this without breaking things. Until the official implementation arrived, I came to the following:
stimulus_controller('layout/panel', { active: true }, { hide: d-none' }, 'focusable') which rendered data-controller="layout--panel focusable" data-layout--panel-active-value="true" data-layout--panel-hide-class="d-none".