nunomaduro/termwind

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

sebdesign opened this issue · 1 comments

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

This is indeed a bug. Good catch.