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

Don't add main element to application.html.erb #139

Closed
shafy opened this issue Feb 4, 2022 · 4 comments · Fixed by #146
Closed

Don't add main element to application.html.erb #139

shafy opened this issue Feb 4, 2022 · 4 comments · Fixed by #146

Comments

@shafy
Copy link
Contributor

shafy commented Feb 4, 2022

When installing Tailwind it adds a main element like this <main class="container mx-auto mt-28 px-5 flex"> to application.html.erb. While this might be fine with a newly created apps, it's annoying for existing apps since it messes with your existing layout.

I'd either remove this completely or only add it if the <body> of application.html.erb looks like a default Rails app.

I'm happy to look into this.

@dixpac
Copy link
Contributor

dixpac commented Feb 5, 2022

@shafy sure give it a try 👍🏼 . <main> is added in order to centralize the content, if you are able to accomplish the same without it 👍🏼

@shafy
Copy link
Contributor Author

shafy commented Feb 6, 2022

I see. My point is that if you add this gem to an existing project, you probalby already have your HTML set up and wouldn't expect the installer to mess with it. It should be fine when you start a new Rails project with --css tailwind. Or am I missing something?

@dixpac
Copy link
Contributor

dixpac commented Feb 16, 2022

You are not missing anything.
Scaffolds are created mainly for the use case when you start fresh rails application, same as rails default scaffold. If you are adding gem to already existing application, you probably already have app specific UI feel.

I agree that it is a bit inconvenient that you have to remove the wrapper in the main layout, if you are able to keep the same scaffolding UI look and feel without the need to the wrapper go for it 🙏

@shafy
Copy link
Contributor Author

shafy commented Feb 19, 2022

Ok thanks for clarifying @dixpac - I'll have a look and report back :-)

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

Successfully merging a pull request may close this issue.

2 participants