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

How to delete internal <style id="__twind">? #57

Closed
nauvalazhar opened this issue Jan 2, 2021 · 2 comments
Closed

How to delete internal <style id="__twind">? #57

nauvalazhar opened this issue Jan 2, 2021 · 2 comments
Labels
❓ Question Further information is requested

Comments

@nauvalazhar
Copy link

Hi, thank you for this cool library!

I was working on a React app project, everything went fine until I wrote my own Tailwind configuration. The configuration I wrote down lost in the specificity battle (because of generated internal style).

My configuration:

const plugin = require('tailwindcss/plugin')

module.exports = {
    purge: [],
    darkMode: 'media', // or 'media' or 'class'
    theme: {
        extend: {
            fontFamily: {
                sans: [
                    '"Source Sans Pro"',
                ], 
....

Specificity:
image

I found the internal style in DevTools which this library generates. In the documentation I found that to use the twind function I didn't need the setup function. How can I just use the twind function to group Tailwind classes? Without any internal styles and my configuration works fine.

Thanks.

@sastan
Copy link
Collaborator

sastan commented Jan 2, 2021

You do not need to call the setup function. But if you want to customize the preflight eg the initial styles, or the theme you must. In your case there are two options which can be combined:

  1. You can disable the preflight:
setup({ preflight: false })
  1. Add your custom theme:
setup({
  theme: {
     extend: {
            fontFamily: {
                sans: [
                    '"Source Sans Pro"',
                ], 
            }
      }
  }
})

For more details see https://github.com/tw-in-js/twind/blob/main/docs/setup.md

@sastan sastan added the ❓ Question Further information is requested label Jan 2, 2021
@nauvalazhar
Copy link
Author

Ah, I see. Thank you for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants