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

Use a named slot to separate attribute merges #24

Closed
wants to merge 3 commits into from

Conversation

Jade-GG
Copy link
Collaborator

@Jade-GG Jade-GG commented Aug 10, 2023

Follow-up to #23

This update lets us do magics like this:

<x-rapidez-ct::input.radio v-model="some_variable">
    <x-slot:wrapper class="font-bold">
        label text
    </x-slot:wrapper>
</x-rapidez-ct::input.radio>

Of course, you can still do:

<x-rapidez-ct::input.radio v-model="some_variable">
    label text
</x-rapidez-ct::input.radio>

or even:

<x-rapidez-ct::input.radio v-model="some_variable">
    <x-slot:wrapper class="font-bold"></x-slot:wrapper>
    label text
</x-rapidez-ct::input.radio>

This seems like the nicest approach to me.

@JimmyHoenderdaal
Copy link
Member

👍

@Jade-GG
Copy link
Collaborator Author

Jade-GG commented Aug 11, 2023

Do we want this refactored on all the input components (where it makes sense)? There's quite a bit of $attributes->only vs $attributes->except and for internal consistency it might be nice.

@royduin
Copy link
Member

royduin commented Aug 11, 2023

Yeah, that would be nice!

</div>
@endisset
<div class="flex w-full flex-wrap items-center justify-between gap-x-3">
{!! $wrapper->toHtml() ?: $slot !!}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use after psuedo elements when you just can create a new <div?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, that isn't my code @JimmyHoenderdaal 😇

Copy link
Member

@JimmyHoenderdaal JimmyHoenderdaal Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use after psuedo elements when you just can create a new <div?

this is because you would otherwise need group-peer-checked to toggle, we can't assume people are using that since it isn't in rapidez by default

@royduin
Copy link
Member

royduin commented Aug 15, 2023

So now we've this: laravel/framework#48039 🚀 maybe wait for the release of that and add it as minimal requirement in the composer.json?

@Jade-GG Jade-GG closed this Feb 20, 2024
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

Successfully merging this pull request may close these issues.

4 participants