-
Notifications
You must be signed in to change notification settings - Fork 4
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
Class styles don't seem to work. #17
Comments
Are you calling |
I'm using I just tried this with the same results.: <script lang="ts">
import { Toast } from 'vue-dk-toast'
export default {
setup() {
const toast = inject<Toast>('$toast')
if (toast) toast('Blue', {
duration: false,
positionY: 'top',
positionX: 'right',
disableClick: false,
class: ['bg-blue-400', 'rounded-sm'],
slotLeft: '<svg className="max-w-6 max-h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',
})
return {
}
}
}
</script> |
If you check dev-tools do the classes get applied to the element? |
Okay, think it might just be an issue with style specificity in that case. Could you check the styles to see if any of the I've made the classes as flat and low specificity as possible but would be good to know if it doesn't play nice with Tailwind |
Does Tailwind append a stylesheet to Just wondering if you could get around this by initialising Tailwind before the toast, so the stylesheet appears first |
That's a good question. |
Ah yeah, maybe import the Tailwind CSS file in |
Yup, that did it. Moved the Does not work if you keep the Not sure if that's the best way of doing it, but I'll work with it for now. |
Any chance you can remove the styles that are non-essential? It would allow for a more bare-bones styling approach. |
Noice, no problem. Changing base styles would be a breaking change at this point and I think it wouldn't serve much purpose in terms of usability. Maybe an extra option to remove them 🤔 I'll think on that one |
I spoke too soon. |
Styles don't seem to work. I've used the class attribute to add multiple classes. None of them show up.
I would prefer this to having to use the style attribute and write out all the styles.
Here's an example:
The text was updated successfully, but these errors were encountered: