reflex-dev / reflex

🕸️ Web apps in pure Python 🐍
https://reflex.dev
Apache License 2.0
20.19k stars 1.16k forks source link

tailwind.config.js: disabling tailwind's preflight #3185

Closed seewindcn closed 6 months ago

seewindcn commented 6 months ago

Describe the bug about tailwind preflight, it maybe conflict with other components, like ant-design.

To Reproduce Steps to reproduce the behavior:

Expected behavior it can be disable by tailwind.config.js:

module.exports = {
  corePlugins: {
    preflight: false,
  }
}

Screenshots If applicable, add screenshots to help explain your problem. ant-design-button

Specifics (please complete the following information):

Additional context Add any other context about the problem here.

picklelo commented 6 months ago

Do you want this disabled by default? For any specific app, you should be able to set this in your rxconfig.py:

import reflex as rx

config = rx.Config(
    app_name="pcweb",
    tailwind={
        "module.exports": {
             "corePlugins": {
                  "preflight": False,
             }
       }
   }
)
seewindcn commented 6 months ago

yes, but your code doesn't work. in reflex, web/tailwind.config.js.jinja2:

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: {{content|json_dumps}},
    theme: {{theme|json_dumps}},
    plugins: [
    {% for plugin in plugins %}
        require({{plugin|json_dumps}}),
    {% endfor %}
    ],
    {% if presets is defined %}
    presets: [
    {% for preset in presets %}
        require({{preset|json_dumps}})
    {% endfor %}
    ],
    {% endif %}
    {% if darkMode is defined %}
    darkMode: {{darkMode|json_dumps}},
    {% endif %}
};

it do not handle the corePlugins.

seewindcn commented 6 months ago

@Alek99 is there any schedule to fix? or could I pull request to fix it?

masenf commented 6 months ago

@seewindcn no one on the team is currently working on this issue.

But if you submit a PR, we will review it and help get it merged in.