skip to Main Content

Apparently, if one installs TailwindCSS on Ruby on Rails, this will generate a html element with a series of classes that centers in a very strange way all the views you have in the app.

<main class="container mx-auto mt-28 px-5 flex">

The above element appears in every view after one installs TailwindCSS. What would be the best approach to customize/remove this element?

Would be also grateful if anyone can also explain why they choose to spawn this element. On their github, someone created an issue about this, but their response wasn’t very clear to me: " is added in order to centralize the content". Thank you.

2

Answers


  1. Chosen as BEST ANSWER

    Thank you, Alex (user:207090). TailwindCSS modified the app/views/layouts/application.html.erb file.


  2. Really not sure what the issue is here, the main tag has a clear semantic, classically people would have things like a "container" or "content" div but now they can use main instead, Rails adds it in order to give a top level tag for styling/containing the main content of a page, feel free to restyle it however you please, or remove it if you don’t need it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search