點燈坊

新しいことを始めるのに、遅すぎる挑戰はない

タグ : TailwindCSS

使用 HTML Attribute Folder 隱藏 Utility

TailwindCSS 一個常被詬病的地方就是 class attribute 有冗長的 utility,導致 HTML 的可讀性不佳,透過 HTML Attribute Folder 可將所有 utility 加以隱藏,只留下 class,當需要維護時再點擊 class 展開即可。

min-w Overview

If we don’t set width of the element, the width is automatically adjusted by the viewport. We can apply min-w to ensure a minimum width.

Using w-fit for Horizontal Center

Block element uses w-auto for width. It will occupy the full width of the parent element. We can use w-fit to make width as the content width, then use m-auto to adjust margin automatically for horizontal center.