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

[DX] Usage TailwindCSS #34

Open
Amar-Gill opened this issue Feb 20, 2023 · 1 comment
Open

[DX] Usage TailwindCSS #34

Amar-Gill opened this issue Feb 20, 2023 · 1 comment

Comments

@Amar-Gill
Copy link

I have a project where I am using @nuxtjs/tailwindcss and@nuxt/content modules. Plus the @nuxt-themes/typography layer.

When I have a button with type="submit" in my app, I noticed the background-color is being overwritten to transparent. I narrowed it down to the following rule:

button, [type="button"], [type="reset"], [type="submit"] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

I have prepared a minimal reproduction in Stackblitz:

https://stackblitz.com/edit/nuxt-starter-hbzcrc?file=app.vue

Furthermore, only background styles applied with tailwind are overwritten. In the reproduction you can see my custom css class does not get overwritten. There appears to be some type of conflict between tailwind module and nuxt typography styles.

Here is a more complete rule set applied to the button. The btn-primary styles are being overwritten:

element {
}
button, [type="button"], [type="reset"], [type="submit"] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}
.normal-case {
  text-transform: none;
}
.btn-sm {
  height: 2rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  min-height: 2rem;
  font-size: 0.875rem;
}
.btn-primary {
  --tw-border-opacity: 1;
  border-color: hsl(229.09 95.652% 63.922% / 1);
  border-color: hsl(var(--p) / 1);
  border-color: hsl(229.09 95.652% 63.922% / 1);
  border-color: hsl(var(--p) / var(--tw-border-opacity));
  --tw-bg-opacity: 1;
  background-color: hsl(229.09 95.652% 63.922% / 1);
  background-color: hsl(var(--p) / 1);
  background-color: hsl(229.09 95.652% 63.922% / 1);
  background-color: hsl(var(--p) / var(--tw-bg-opacity));
  --tw-text-opacity: 1;
  color: hsl(229.09 100% 92.784% / 1);
  color: hsl(var(--pc) / 1);
  color: hsl(229.09 100% 92.784% / 1);
  color: hsl(var(--pc) / var(--tw-text-opacity));
}
@Tahul Tahul changed the title button [type="submit"] background overwritten when using tailwindcss [DX] Usage TailwindCSS May 17, 2023
Copy link
Contributor

Tahul commented May 17, 2023

Hey :)

I renamed this issue so we can track the usage of Typography with TailwindCSS.

I need to make a pass on that not only on Typography but on all themes, so this suits better as a naming.

Thank you so much for the reproduction!

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

2 participants