wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

Make card have border on dark mode #290

Closed ettiennelouw closed 1 year ago

ettiennelouw commented 1 year ago

Added gray border-gray-600 on card for dark mode to outline of card and to title bottom border.

Before image

After image

PH7-Jack commented 1 year ago

@ettiennelouw I think that it can be a prop to enable borders in the card. @dansysanalyst @putera @trippo What's your option about it?

putera commented 1 year ago

What's your option about it?

I think this is good for the dark mode. 👍🏽

ettiennelouw commented 1 year ago

I can make it a prop might make it more configurable. On light mode it has a shadow but then just give it a light shade of gray on light and the light shade on dark aswell but enable or disable with prop? I will make the change.

PH7-Jack commented 1 year ago

@ettiennelouw Will be good if you add an prop option to enable borders

trippo commented 1 year ago

I think is better to change the bg color of card

ettiennelouw commented 1 year ago

Made the border configurable but with defaults to match the rest of the components.

Default Light

Screenshot 2022-05-27 at 21 10 13

Default Dark

Screenshot 2022-05-27 at 21 10 19

Matches all components

Screenshot 2022-05-27 at 21 15 27

Custom Pass to card <x-card title="Your title here" border="border-orange-600 dark:border-red-600"> to override with custom border styles.

Screenshot 2022-05-27 at 21 12 44
PH7-Jack commented 1 year ago

@ettiennelouw Great, thanks, but change the default card style without border in the dark mode. Many websites are using the card without borders in the dark mode, like the WireUI documentation, if enable the borders in the dark mode, the wireui docs will be strange.

ettiennelouw commented 1 year ago

@PH7-Jack instead of making a border property, I just moved the classes for the card, header and footer to the PHP class so that you can pass in the classes that you want for instance border, dark:border. Just had to do a little check on the header class as you had dark:border-0, if you can just check the logic in the file.

I think this might make it a bit more flexible and cater for all kinds of classes and styles someone wants to add to the card.

<x-card title="Your title here" cardClasses="border border-gray-200 dark:border-secondary-600" headerClasses="dark:border-secondary-600">
code sdf sdf sd fsd f sdf

     <x-slot name="footer">
         <div class="flex items-center justify-between">
                <x-button label="Delete" flat negative />
               <x-button label="Save" primary />
         </div>
    </x-slot>
</x-card>
ettiennelouw commented 1 year ago

Awsome all comitted.