Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

(Also not a Tailwind user) I guess the common response to this is that well chosen semantic names usually help later down the line after these kinds of changes happen, especially with devs coming in and out.

I've actually come across C code that had "#define ONE_THOUSAND_TWENTY_FOUR 4096" because that was the audio buffer size and later had to be increased to 4096 but the macro name was never changed. AUDIO_BUFFER_SIZE would probably have been a better name in the first place.

Most code is not that bad though, haha. But that is still my first reaction. What if instead of slightly changing the gray color, you now want them to be blue and underlined? Or take HN for example, the username, vote buttons, and timestamp are all #828282, but have different class names. Is keeping this in sync ever a problem in Tailwind? This is only my first time looking at Tailwind, but it seems it's not really meant for "complex" apps where you'd run into these problems often?



If I wanted to change all links from gray to blue/underlined, the best practice there would probably be to use a different utility class (text-blue-500 and underline) and update my templates/partials/whatever.

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...


What if I had two types of links, both of which were currently "text-blue-500 and underline" but I wanted to make one italics at some time in the future?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: