<button type="button" class="flex items-center px-5 py-2 bg-[#152DB5] rounded-[9.9rem]">
<svg><!-- ... --></svg>
<span class="inline-block align-middle text-[1.4rem] font-[700] leading-[2.2rem] tracking-[-0.01em] text-[#fff]">코드 올리기</span>
</button>
Hello!
I use Tailwind CSS. Image2 is button that use tailwind CSS. Image1 is button that pure CSS.
Why text baseline height different when use Tailwind CSS?
two span use same font style is
font-size: 1.4rem;
font-weight: 700;
line-height: 20px;
letter-spacing: -0.01em;
Tailwind CSS defines a default
line-heightfor each font-size utility. You can view the default values in the Font Size Documentation Page under properties.You can also provide a default
font-size,line-height,letter-spacing,font-weightand disable the default values by changing them in yourtailwind.config.jsfile: link.