timonweb / django-tailwind

Django + Tailwind CSS = 💚
https://django-tailwind.readthedocs.io
MIT License
1.46k stars 92 forks source link

How easy is it to switch between modes after theme app generated? for v2.0.0b1 #62

Closed simkimsia closed 3 years ago

simkimsia commented 3 years ago

Related to this comment about feedback, https://github.com/timonweb/django-tailwind/issues/56#issuecomment-821051122

I saw this

/code # python manage.py tailwind init
app_name [theme]:
Select mode:
1 - jit
2 - default
Choose from 1, 2 [1]:

So I have fear about selecting the wrong one.

My question is how easy is it to switch from default to jit or jit to default after the theme app is generated?

If it's easy to undo then I have less compunction about selecting any mode.

And do you mind not naming default mode default?

Because it's weird that the default choice is jit mode. Maybe call default mode Refresh per build? or any other name that's not also default?

timonweb commented 3 years ago

Good point. Maybe we could call it legacy? The change is simple, it's just one line in the tailwind.config.js so you can choose either.

simkimsia commented 3 years ago

The change is simple, it's just one line in the tailwind.config.js so you can choose either.

I think this should be documented somewhere

Good point. Maybe we could call it legacy?

I don't have strong feelings about the new name. I only have strong feelings not to call it default

simkimsia commented 3 years ago

found it

module.exports = {
    mode: "jit",
    purge: [
        // Templates within theme app (e.g. base.html)
        '../templates/**/*.html',
        // Templates in other apps. Adjust the following line so that it matches
        // your project structure.
        '../../templates/**/*.html',

Ok i love that you have comments there about the project structure. very useful.

Can you also have a comment above mode? about the possible values: jit / legacy?

Thank you 🙏

simkimsia commented 3 years ago

Sorry one follow up question

Let's say I switch to legacy mode by changing the config.JS

Any other actions I need to take to turn on in the new mode?

timonweb commented 3 years ago

no, that's all you have to do