Modern CSS with Tailwind: minor formatting suggestions

Congratulations on a fine book on TailwindCSS. I appreciate your very helpful work. It is very timely and nicely done.

In the Utilities section of Chapter 2, you have a callout for “The Leading Dot”. I understand that this is consistent with the concept of a CSS class description. However, as a reader of your text and as a developer using TailwindCSS, I am not defining these TailwindCSS classes, but just using them, which disallows typing their leading dot. It would be less distracting for me if all those dots just went away. Your blue bold lowercase is enough to set these concepts apart for me.

Also, when showing a named optional utility family, I think it would make more logical sense to pull the dash into the curly braces. For example, rather than showing text-{size}-{color}-{level} to indicate a family of text sizes, colors, and levels respectively, it would be easier on my eyes if this were written text{-size}{-color}{-level}, as everything within each {…} would logically go together. If no size were specified, there would be no dash for size; if no color were specified, there would be no dash for color; etc.

1 Like

Thanks for the feedback. I went back and forth on the both of those.

In the second case, I decided to match the way the Tailwind documentation does patterns, it keeps the dashes outside the braces.

The first case, I also thought I was matching the Tailwind documentation, but either they changed the formatting there, or I’m having a memory lapse, because they are not currently consistently using the leading dot to define classes, though they still use it in some places.

1 Like