1,643 karma · joined March 19, 2014
I blog (very infrequently) at https://www.mikewilson.dev if you want to get a hold of me!
I think a lot of that lies in the fact that all of the pieces stand-alone, which is a selling point, but it makes it difficult to see how they all join together to create the bigger picture.
I'd love to see a good tutorial on setting up a complete environment, with Vault, Consul and Nomad (and Waypoint!) with best practices. Something like "here's how to deploy your rails app with Nomad and Vault" would be great to see the big picture.
"Shoot, was this 13px padding or 14px padding on the other page?" Don't worry about it, just use "p-4, p-6, etc.". Thinking in these terms becomes really powerful.
Another great thing as that you just simply don't have to think about what to name things! I find that so liberating, to be honest, and I don't have to keep switching back and forth between my markup and my css. I don't have to worry about coming up with semantically descriptive names. I just use "text-gray-500". Was this .authorrole? Or was it .authoremail? Hmm, now I want to display an author nickname. Do I just repeat "authorname" class? I find it so freeing to basically not have to worry about this stuff at all.
This part from the blog post kind of confused me a bit, though.
"The promise of Tailwind UI is that it's just a code snippet"
Am I the only one who never looks at the code snippets/tab for Tailwind UI, and instead jumps straight into inspect element? As blueprints the components are great, but I almost always want to make some small tweaks or changes to fit my application. Are there other people out there actually copying/pasting the snippets as they are?
Is it helpful as a software dev? Who knows, but it's been an enjoyable hobby for now. I particularly have enjoyed the motion tracking and adding some special effects to videos of my young daughter.
So, I wouldn't say we're necessarily thriving, but we're doing the best we can to see the silver linings and I’m thankful that I’m able to work at home.
https://fullstackradio.com/32 Is another great episode that I re-listen to once a year, even if it is a bit old.
This along with Waypoint seems like a great solution for smaller side projects.
If a new HTML element is added to the DOM and has a controller, it just works and is now active. This might not be the case with React or Vue, as you'd have to then bootstrap the component.
This makes Stimulus a really good combo when used with Turbolinks or partial Javascript responses.
My only complaint/comment is that some of the HTML that I need to generate ends up being littered with so many data attributes, especially when combining multiple Stimulus controllers/behaviors.
Has anybody found a clean way around that in Rails templates?
I've found this pretty good starting point. Keep in mind the book is still a work in progress. Note, I haven't actually run k8s in production, but this book has helped me get something up and running in VM's pretty quickly using Ansible on top of kubeadm.
https://tailwindcss.com/docs/extracting-components#extractin...
.btn {
@apply bg-blue-500 text-white py-2 px-4 rounded;
} .custom-bg-color {
background-color: theme('colors.gray.500');
}I don't even need to move over to my css file at all - I stay within my template and stay within my flow.
It seems crazy and counter-intuitive at first, but I find that it makes me a lot more productive.
If it turns out that later down the line I realize that "every card should have that size and color for the card title", then I'll pull it out to a separate class or part of a partial or something like that.
The idea being at that point then I have more context around when and how that particular section of a component should be displayed, so I have more context about what I should name the class (i.e. "card-subtitle").
I feel like the documentation explains it fairly well if you're interested in reading more about it:
https://tailwindcss.com/docs/extracting-components#extractin...
I think for your specific example, I would use the `@apply` directive to apply certain utilities to all links.
I've used Tailwind on large, complex apps with around 50 screens (so far), and using extracted components or partials hasn't been a problem at all with keeping things in sync.
``` a { @apply text-gray-700; }
// now becomes a { @apply text-blue-500 underline; } ```
The documentation goes over this pretty well, I think.
https://tailwindcss.com/docs/extracting-components#extractin...
i.e. "text-gray-dark", or "text-gray-700", would have a class with a single css property:
color: #4A5568;
By default Tailwind comes with a default color palette with hand picked colors. They were hand picked by a designer, not determined through an algorithm.
https://tailwindcss.com/docs/customizing-colors#default-colo...
The biggest benefit of this over inline styles is that if I decide to change the color of "gray-700", since those colors come from a configuration, I only need to change it in my configuration.
It takes some getting used to of the rules, but after a day or two I don't even need to think about what the class names are.
To me, the biggest benefit of Tailwind and utility classes in general is that it removes the cognitive overheard of having to think of class names while designing a new page.
For example, if I'm working on a card and I want some text below the main text to have a smaller, gray font size. What do I name that class? "card-sub-text", "card-sub-title"? No - don't even worry about it - "text-sm text-gray-700" and move on.
Later on, if I end up repeating that combination in a number of places, I have more context of what that class name really should be, and I can extract the utility classes to a specific class name.
Really powerful stuff that has helped to increase my velocity quite a bit.
I'll typically have milestones for the next 2 or 3 releases, and then use labels for tracking bugs, features and future items and nice-to-haves. I like this because it makes it easy to keep the code linked to issues the way I'm used to with my day job.
The nice thing is it lets me wear two separate hats. Some days I don't have the mental bandwidth to code, or I'm feeling extra creative when it comes to coming up with roadmap ideas, so I'll go into the issues and just write. On other days, I just open the issues, filter by bugs or features and grab an item and get to work.
I've tried Trello and Basecamp, but having that separate from the code just made too much overhead to keep track of. Having everything under one roof makes it so I actually end up adhering to the list of tasks.