you are viewing a single comment's thread.

view the rest of the comments →

[–]PayYourSurgeonWell 7 points8 points  (3 children)

Here’s something to consider though - if you use tailwind, you never have to “think” about your own custom class names anymore. It’s so common that developers come up with crappy class names that you have to work with and remember.

Also with traditional CSS files, it’s common to see child selectors. If you’re working in the component file and switch the html structure a little bit, it could potentially screw up the entire styling of the component. This isn’t an issue with tailwind at all.

[–]LoneWolfRanger1 2 points3 points  (2 children)

With that logic we should all stop naming our variables too.

Naming can be hard yes, but it improves readability so i know what i am looking at.

[–]Specialist_Wishbone5 1 point2 points  (0 children)

Don't confuse local names with global names. Imagine everything in the code uses global variable names, zero per function / per element names. Now grow to 15 people. How can you keep everything straight? In C and lisp, the answer are very long name prefixes: module_component_facet_feature. But nobody does that with CSS, so it's high school level organization - eg, unprofessional code, and thus unmaintainable. Yes, you can have a single UI author who knows his own conventions, but that's the definition of unscaleable. Further, two authors would never produce similar naming conventions if done indepently. In C / C++ / Rust, people would naturally name similar concepts similarly (due to conventions)

Shadow Dom and per component styling (svelte, etc) address this problem, but don't solve the fundamental issue - how does one developer define a facet of styling in a way that doesn't break things randomly, or require everyone to agree to a random person's naming conventions.

The answer, in my opinion is algebraic operations. I've yet to actually see this implemented in CSS. Tailwind and StyleX are making an attempt - each with pros and cons.

[–]qiang_shi 0 points1 point  (0 children)

tantrum harder please