Skip to content
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

[Feature Request]: Quick action to change class="..." into @class(['...']) #1109

Open
ralphjsmit opened this issue Nov 23, 2024 · 0 comments

Comments

@ralphjsmit
Copy link

ralphjsmit commented Nov 23, 2024

Feature Description

Hello Adel!

I noticed that quite often I am needing to switch between class="" and @class([...]) syntax. The reason is that sometimes I think I want to use an conditional class and then I switch to @class(), but in the end it turns out not to be necessary and then I need to revert back to class="" again for consistency (don't use @class() if no conditional part).

It would be super amazing if you could add two quick actions on the alt+ enter menu:

Replace:

<div
   class="some-class other-class final-class"
>
</div>

<!-- Or -->
<div class="some-class other-class final-class">
</div>

Both into:

<div
    @class([
        'some-class other-class final-class',
    ])
>
</div>

If correct indentation could be considered here that would be good.

And second action to replace it back:

<div
    @class([
        'some-class other-class final-class',
    ])
>
</div>

Into

<div
   class="some-class etc etc etc"
>
</div>

But then don't offer the action to replace this:

<div
    @class([
        'some-class other-class final-class' => $models->isNotEmpty(),
        'second-class',
    ])
>
</div>

This would be awesome if you would have a way to add it, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant