Today's newsletter is sponsored by ConfigCat — the feature flag service that helps you release features faster and with less risk. More on them at the end of today's newsletter. I'm working on a UI library for people who love HTML and modern CSS, and one of the many details I'm currently sweating is naming conventions for CSS classes. I'd love your feedback! Colors and styleLet's say you have a button, and by default, it's gray with a dark background.
You want to change it to your primary brand color (blue), and use a light variation with dark text. Would you rather write and maintain verbose HTML that looks like this…
Or more simple but possibly less obvious CSS classes that look like this…
I can see arguments for both, and I'm not sure which one is easier to maintain for developers in the long run. Margins, padding, and other utility classesThe library also includes a bunch of utility classes for modifying various things: margin, padding, border radius, font size, and more. For the most part, these follow a
But where I'm feeling a bit stuck is around margins and padding. Following that same pattern, the names can get a bit verbose. And unlike
Would you prefer the
One one hand, the brevity makes the HTML a lot more scannable and easier to write. On the other hand, it takes a lot more brain power to process what it does. I want your opinion!Do you like one style over the other? What's the right mix of CSS class authoring styles for you? I really want to know what you think! Send me an email and let me know. Are you looking for a service to support dynamic feature flags? ConfigCat is a cross-platform LaunchDarkly alternative that's easy to learn and quick to set up. With SDKs for 19 platforms — including JavaScript, Python, Ruby, Java, and even Rust — you can toggle features on or off without redeploying. ConfigCat subscriptions are the same price regardless of your team size. Get 25% off any paid plan with code Like this? A Go Make Things membership is the best way to support my work and help me create more free content. Cheers, Want to share this with others or read it later? View it in a browser. |
0 Komentar untuk "[Go Make Things] Naming conventions for CSS classes"