question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to create scaffolds with Tailwind styling

See original GitHub issue

As requested by @mojombo: if you have Tailwind configured, let’s create the scaffold/dbAuth templates with Tailwind classes instead of using all of the rw- custom classes. This makes it more likely that you’ll want to take the time to customize them and keep them around.

Should include:

  • Scaffolds
  • Login/Signup/ResetPassword/ForgotPasswordPages from dbAuth

~This means we could skip creating the scaffold.css file altogether. Any other generator that checks for the existence of this file needs to check for Tailwind config instead, and generate Tailwind-supported versions of themselves (currently just the dbAuth pages).~ As we further fleshed out the idea in the comments below, we’ll keep scaffold.css and just update the styles from raw CSS rules like margin: 0 auto to Tailwind’s @apply directives, like mx-auto. This gives us once place to go to make changes to all scaffolds, but those changes are still just Tailwind classes.

Could also include a flag to force Tailwind: yarn rw g scaffold User --tailwind and one to not use Tailwind if it otherwise would: yarn rw g scaffold User --no-tailwind

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
aggmoulikcommented, Oct 29, 2021

Thank you @cannikin for working on this, it is pretty much needed personally because I had to comment out the scaffold.css file and manually convert it to tailwind format in index.css

0reactions
ortacommented, Oct 16, 2021

+1 to the component classes technique, feels like a scalable way to handle there still being one template file but with different behaviors depending on what you use

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tailwind Scaffold Generator - YouTube
Hello Fellow Alchemists! It's Fantastic Friday! In today's video, I will show you how to use Tailwind Scaffold Generator.
Read more >
Ship scaffold generator that uses a nice Tailwind design #23
The default Rails scaffold is plain to a fault. Let's ship some scaffold templates with this gem that uses Tailwind to demonstrate it....
Read more >
Rails 7 Tailwind Scaffold Question - Reddit
When I create new rails 7 project and spec --css tailwind I like how scaffolds created have styles applied to them.
Read more >
Configuration - Tailwind CSS
If you'd rather scaffold a complete configuration file that includes all of Tailwind's default configuration, use the --full option:
Read more >
Tailwind css / scaffold - rubyonrails-talk
I got 2 questions,. is there an option in the scaffold command that specifies tailwind css? or how do I go about editing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found