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

btn-outline not working properly #189

Closed
GazDuckington opened this issue Sep 8, 2021 · 3 comments
Closed

btn-outline not working properly #189

GazDuckington opened this issue Sep 8, 2021 · 3 comments

Comments

@GazDuckington
Copy link

Hi, I've come across a strange problem.
When I was trying to create a button I noticed that I cannot create a btn-outline style using @apply like so:
Screenshot_2021-09-08-19_447x61
what I expected to happen was that the "green accent" button would behave the same way as "green_accent2"
the codes:
green accent: green_accent{ @apply btn btn-outline btn-accent btn-sm; }
green_accent2 : <button class="btn btn-outline btn-accent btn-sm">green_accent2</button>
any help would be appreciated, as I know next to nothing about CSS 🙂

@saadeghi
Copy link
Owner

saadeghi commented Sep 8, 2021

@RegalOctopus I wish I could fix this on my end but unfortunately this is how @apply works.
When we use

class="btn btn-outline btn-accent btn-sm"

styles apply in exact order as defined in plugin source but when we put classes in @apply:

.mybutton{ @apply btn btn-outline btn-accent btn-sm; }

it won't use the correct order.
I suggest using daisyUI classes directly inside your HTML.
Yes, one class name is cleaner than 3 class names in HTML but I guess @apply won't work as intended in this scenario.

@saadeghi saadeghi closed this as completed Sep 8, 2021
@Garito
Copy link

Garito commented Jun 23, 2022

And what to do if its is not possible to use dasyui classes inline?
Example: third party components...

@saadeghi
Copy link
Owner

Another [dirty] way is to use !important

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

3 participants