nunomaduro / termwind

🍃 In short, it's like Tailwind CSS, but for the PHP command-line applications.
MIT License
2.29k stars 78 forks source link

Elements with classes that apply escape codes do not work with classes that manipulate the content #53

Closed sebdesign closed 3 years ago

sebdesign commented 3 years ago

Since #52 was merged, classes like font-bold italic underline line-through invisible are wrapping the content of the element with escape codes.

But classes like uppercase, truncate, snacecase are transforming the content of the element.

So when these classes are combined, e.g. font-bold uppercase, the escape codes will be capitalized which breaks them. Also, if the classes are set in reverse order, e.g. uppercase font-bold this does not happen because the classes are applied in the order they appear (it should not).

E.g. <div class="font-bold uppercase">text</div> renders <bg=default;options=>\e[1MTEXT\e[0M</> instead of <bg=default;options=>\e[1mTEXT\e[0m</>.

nunomaduro commented 3 years ago

This is indeed a bug. Good catch.