Ah, right! The only thing I struggle with is how you let the component define the classes on the link itself, since wrapping a link in a button won't make the whole clickable button area an href
Like I'd need a way to produce <a class="btn" href="#">Test</a>, rather than <button class="btn"><a href="#">Test</a></button>
Unless this is just me needing to learn more CSS/Tailwind :smile:
Paul Smith
@paulcsmith
I’m not totally sure I understand. When using “with defaults” you can use whatever method with it. So you can use “link” and it’ll apply the class to it. So the whole thing will be clickable :)
Stephen Dolan
@stephendolan
OH, no you're right
Idk what is so difficult about that structure for my brain to comprehend, lol
Paul Smith
@paulcsmith
It is weird. Definitely not just you.
Stephen Dolan
@stephendolan
For some reason I just find calling the proc with args much more straightforward, but your approach feels cleaner
Paul Smith
@paulcsmith
I try to avoid it but I think for inputs and buttons it works. Just because there are so many tags you can use with it and so many options
Stephen Dolan
@stephendolan
Right, like if my component wants to make the target="_blank"
I'd have to add a new param to every caller
Paul Smith
@paulcsmith
It’s weird but flexible and a bit more concise.
Stephen Dolan
@stephendolan
Rather than just keeping the signature the same
Paul Smith
@paulcsmith
Yeah exactly
Stephen Dolan
@stephendolan
That's really nice. I'll try a refactor on that composition LuckyCasts repo and see how it feels to add a few more pages
Paul Smith
@paulcsmith
The other option is bite the bullet and make button classes with @apply but it’d be cooler to keep it all in Lucky if it works!
Awesome! Thanks. Would definitely love feedback on it
Stephen Dolan
@stephendolan
Yeah, I've just heard Adam Wathan absolutely shred using @apply with Tailwind so I'm trying to compartmentalize stuff into built-in components
Like my ideal world is I have a private GitHub repo with a bunch of TailwindUI components
And I include it as a submodule in every lucky project's src/components/ui directory
Paul Smith
@paulcsmith
The other cool thing is you could do stuff like having an enum for button size and stuff like that. So you get type safe button states in Lucky
That’d be awesome
Stephen Dolan
@stephendolan
ooooh
Paul Smith
@paulcsmith
Yeah I try to avoid @apply but for buttons it isn’t too bad. But agree that it’d be cooler to not have to use it :D
_
Stephen Dolan
@stephendolan
Yeah, this is gonna be a great little episode! And definitely feels like it's in the "advanced" camp
Stuff that's hard to describe via text, but easy to explain in a video
Yeah the video really helps. I'm so glad you are doing these. These are the things components are so so good at, but just haven't had time to document or go in-depth. So I really appreciate this :D ANd if you could backport some of this to the guides that'd be cool. But I know that's a lot of work so no worries if you can't!
Stephen Dolan
@stephendolan
Don't worry, I'm at least logging issues as I go! Already added one for documenting named slots :D
The wife and I are renovating the backyard and a bathroom before her sister is out to visit for a few weeks, so I haven't had the bandwidth for another website PR-blitz. Plan to keep those coming until we hit 1.0 whenever I can, though!
Ohhh wait so is with_defaults a Lucky thing or Crystal thing?
Paul Smith
@paulcsmith
with_defaults is a Lucky thing created for stuff like this :D
And no worries. I'm also low bandwidth. Finishing up my garage right now with drywall/paint/new storage. So I totally get it!
Stephen Dolan
@stephendolan
I see! I need to dig into the source and understand that a bit better
I'll probably do a one-two punch of an episode on with_defaults by itself
Then a beautiful convergence of named slots and with_defaults for the component composition video
Paul Smith
@paulcsmith
Good idea :D
Stephen Dolan
@stephendolan
Btw, to the extent anyone wants to deep dive this stuff and doesn't want to spam this single room for Lucky, I do have a Discord set up for LuckyCasts! https://discord.gg/Zv92bx
I know this is used for a lot of beginner questions and intros, and don't want this to get too scary :D
I know I'd have felt intimidated jumping in with a "How do I start my server?" question in the middle of all of that ^
haha
Michael Lang
@mwlang
I actually like the chatter here. Let's me know Crystal and Lucky are alive and kicking.
Stephen Dolan
@stephendolan
Man, so conflicted between whether to build LuckyCasts.com or make LuckyCast videos this week
Ghost
@ghost~56ba344de610378809c0a277
I would make a video about making the website?
Stephen Dolan
@stephendolan
🤯
Michael Lang
@mwlang
so, meta. Do that :-)
Stephen Dolan
@stephendolan
Haha yeah, I guess I've just never personally gotten a lot from those kind of live coding sessions
And thinking about editing down and narrating over hours of dev makes my head hurt :)
Michael Lang
@mwlang
I'm pretty sure it's how Ryan Bates got going with Rails Casts, so you know it's a winning formula.