-
Notifications
You must be signed in to change notification settings - Fork 42
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
Can't customize input classes #691
Comments
@edalzell Have you looked at the docs for the Longhand version of a flux:input? https://fluxui.dev/components/input#longhand You should be able to apply your classes directly to the input using this approach. (And could also build you own custom component for easy reuse) |
That's still not the direct I don't really want to build a custom component for something as simple as a text input where I need to customize the input classes. I realize there are several ways around it, but none of them feel right for something basic like this, IMO. |
I completely agree with @edalzell, I have been hacking away - there are some basics that requires a little too much time - if the solution is always publish or make your own, you then find yourself on the pathway of creating your own component library and going back to a life before flux. I believe @calebporzio is working a more approachable solution to customisation, colors, radius etc I love flux, the idea of flux as well as everything @calebporzio does, however there’s something not quite right in the air - but hopeful things will clear up. |
@edalzell @igmltd I see what you are saying. The To address that, I've been using CSS to globally tweak, when needed (via In case this helps, for my global Flux CSS tweaks, I use blocks similar to this in my
Has taken a bit of exploration and experimentation... #cssishard. |
blade-tailor looks promising. I haven't tested it yet, but I think this the cleanest approach which doesn't involve publishing components. |
Ya, again that seems ok (but still kinda gorpy) for site-wide changes, but not per component. |
Yeah, I think the best you can do right now is using nast tailwind like this: I agree, this isn't ideal - It's a pretty tough problem to solve otherwise, so I think your suggestion, an Another alternative is exposing an I'll think about this a little and get back to you when I'm back in the office (I'm on a trip right now). |
Hey, @igmltd, curious what you mean by this? "there’s something not quite right in the air" What exactly is not right? I want to make sure Flux is a good as it can be so I'm extremely interested in what might cause a statement like this. |
Hi @calebporzio thanks - what I meant was isolated to the styling and theming side of things - a lot of the times it all feel a little to "hacky" to style or modify to fit a project - and then publishing seems to be the easiest thing to do, but the most unwanted thing to do - especially with updates coming in thick and fast. So that statement was specifically referring to just that - knowing it will clear up in time once theres a solution you're content with. Your commitment and passion is clear, myself and I'm sure everyone else, also wants this to be the best - and it already is in a lot of ways. I think every early adopter also knows we get to help you shape this for those to come - it's ride or die for me. Sometimes just pointing a negative can also dismiss the fact that everything else that has not been mentioned is loved and appreciated beyond thanks. |
I'm currently working on the same topic. I was really excited when Flux was announced. I wanted to use Flux to replace all the elements in my project accordingly. Unfortunately, I stumbled relatively quickly over the customizability of the elements. For me, it has actually turned out that it is unfortunately not really usable at this stage. The adjustments are far too complex, the aim should be to be able to adapt without publishing the stubs and possibly in a central location. But at least in the expected places. As an example, I recently stumbled upon the checkboxes. I simply wanted to reduce the space after the label. This didn't work the usual way of assigning my own classes. Then I noticed that all the formatting of the label is defined in the It gets even more extensive with the above-mentioned There the This is quite complex to understand and certainly not what I expected. Especially if you are a design-savvy programmer and want to adapt the elements to your own design, you quickly stumble. For me, the adaptations are unfortunately much more time-consuming than creating my own elements. |
It is a bit hacky, I agree, but a better hack, cuz you now get per component customization, and you can still use the tw/laravel class merge stuff.
Thanks Caleb, I know you wanna make this perfect. I believe in you! And I do really want to use this instead of our custom components, this is the only thing holding me back. But I already purchased a full license cuz I wanna keep you in your high end fishing gear! |
I already posted the link here but I feel that should be the default way of adjusting components in Flux. Although the example below is a bit extensive, the syntax is clean & simple. I would prefer this over Tailor::component('flux::button')
->props([
'variant' => 'primary', // Customise prop defaults
'huge' => false, // Add new props
])
->classes(fn ($variant, $huge) => [
'border-4 rounded-full -rotate-2 !shadow-drop-1g',
'scale-150' => $huge,
'[&>[data-flux-icon]]:: text-orange-500 size-10 -mx-2 mb-0.5 self-end',
match ($variant) {
'primary' => 'border-blue-300',
'danger' => 'border-red-800',
default => '',
},
]),
->attributes([ // Add new attributes
'data-thing' => 'foo',
]); |
As mentioned here: #653, I'm trying to create a text input but I can't customize the
input
classes.I'm trying to make:
Without publishing the stubs. I'd love an
inputClasses
prop or something I could pass stuff into.The text was updated successfully, but these errors were encountered: