Tailwind does away with that indirection: you apply your design constraints directly in the component, using plain CSS. It provides "utility classes" like p-0 to p-9, to apply a little to a lot of padding, respectively, to an element. Whatever you choose, it'll be consistent.
This layer of indirection was intended to allow you to re-use your classes in different HTML elements.
But in the age of component-based architecture, is that still useful? We write our HTML once for our components, and then re-use those components across our codebase.
So how about we just define the constraints in, say, CSS variables?
Well, you could do that, but consider how you would use those.
You'd keep switching between your components and your styles, defining new classes in your CSS that rely on the constraints, and then applying these classes in your components. It adds a layer of indirection between the styles and the components to apply them to.
This idea isn't unique to Tailwind. Component libraries like Chakra UI and Material-UI apply it already.
However, to enable the sharing of constraints across your app, these libraries define their styles in JavaScript, using tooling to prevent them from interfering with yours.
This leads to inflated bundle sizes and complex tooling.
To understand Tailwind, you need to understand constraint-based design, in which UI elements adhere to a set of constraints designed to make them compose well together to make a harmonious whole.
To go down this rabbit hole, see: https://styled-system.com/guides/why-powers-of-two
We're seeing #TailwindCSS get quite some traction, so I figured it was about time to try to understand what sets it apart and what problem it solves.
I think I get it now, and to solidify my understanding, I'm going to try to articulate its benefits.
I've been interested in property-based testing for a while, but never had a clear use case for which it was easy to implement. Until recently, and I just submitted a fix for the second edge case fast-check discovered we weren't handling properly.
Really exciting, that feeling of having learned something new that will hopefully be useful more often.
It's here! My masterpiece, the last VSCode extension you will ever need: Whoopee cushion keyboard.
Yes, it makes fart sounds when you type.
That's it. That's the extension.
Get it here: https://marketplace.visualstudio.com/items?itemName=VincentTunru.flatuscode
Or don't, that's probably better.
@nolan That allows you to do away with dev, test, and acceptance environments. Instead, every change has its own environment, with high confidence that it will behave in the same way as your production environment.
@nolan For me, the benefits of serverless are not so much the cost of running your app like you usually would (I'm not sure if that's cheaper - especially if you're locked in).
However, the marginal costs of spinning up additional instances that are otherwise equal to your production environment are so low, that is becomes feasible to do so for every minor new feature you develop.
Lol #JavaScript am I right?
Original found here: https://www.reddit.com/r/dataisbeautiful/comments/jlekud/size_of_things_if_they_were_same_density_as/
Well what do you know - the app actually kept it together!
Turns out looping back your audio output as microphone in software is less foolproof though (the fool being me). Ended up struggling for what felt like an hour until I just put my microphone next to a speaker connected to a different device 😕
If you look up regular expressions on MDN, it now includes an explicit example highlighting that \w does not actually match all alphanumeric characters in most languages.
Hopefully that will result in fewer people being told that their actual, real name is "not valid". #a11y
Some of the more conventional arguments are so easy to brush aside, because they're not about the actual problem.
"I don't mind if strangers look at me going to the bathroom without me knowing."
"A Facebook ad doesn't influence me."
"You can block ads."
Honestly I think this is my new favourite way to explain why I value privacy. It's concise, easily understandable, and emphasises how it's important even if it doesn't directly affect someone personally.
(Front-end) engineering, civil rights, and the intersection between those two.
https://plaudit.pub, https://solidproject.org, @ToSDR, and a never-ending stream of unfinished side projects — though Toots are my own.