Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're going to use Tailwind with Laravel, you're going to break your pages up into Blade Components to keep things consistent, right?


Yep, but they are called templates in backend frameworks, You write HTML with sprinkled in logic in Elixir/PHP/Python/Ruby etc.

Components is the terminus used in (usually) JavaScript frontend development where you write JS logic and HTML is only used in the render/view/etc function.


Even backend frameworks distinguish between templates and components.

For example, Laravel has Blade templates and Blade components. From the documentation on the latter:

"Components and slots provide similar benefits to sections, layouts, and includes"

If you use Tailwind with Blade templates, but don't use {components, sections, layouts, includes}, then you'll have a hard time keeping things consistent. Because you'll define how a button looks over and over in each template. In that case, something like Bootstrap or Pollen would be easier.

But the right way is probably to break your templates into smaller pieces (e.g. components) so you can use Tailwind but still share things like buttons between templates.


Ah i see, thanks for the clarification, not using Laravel myself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: