Using hover Variant in Dark Mode
The hover
variant is only for light mode. We can compose dark
and hover
to take effect.
失くすものさえない今が強くなるチャンスよ
The hover
variant is only for light mode. We can compose dark
and hover
to take effect.
For Card layout, we often add 2 buttons at the bottom. One is on the extreme left, and the other is on the extreme right.
justify-evenly
makes all Flex Items spaced out evenly, even space before
the first item and after
the last item.
justify-around
makes all Flex Items spaced out evenly, but space before
the first item and after
the last item are half as much as space between the items.
justify-between
makes all Flex Items spaced out evenly, but the first item is on the extreme left and the last item is on the extreme right.
justify-center
makes Flex Items justify to the center.
justify-end
makes Flex Items justify from right to left.
justify-start
makes Flex Items justify from left to right. This is the default utility for flex
.
Responsive Navbar is the essential component in every modern Web design. This can be done by only Alpine and TailwindCSS without any package.
Responsive auto-hidden Navbar is the essential component in every modern Web design. This can be done by only Alpine and TailwindCSS without any package.
Not only use x-show
to hide the element, but we can also use -translate-x-full
or -translate-y-full
to hide the element.
When using transtion
for CSS Transition, we can add duration
to achieve a more obvious visual effect.
Three columns layout is a common layout for modern Web design. This can be done by float
.
Two columns layout is a common layout for modern Web design. This can be done by float
.
Using block
and hidden
with md
and lg
variant, we can toggle different blocks to display by the device without any JavaScript.
When the width of all Flex items is larger than the parent element, we can use shrink
to control how Flex items shrink.
static
is the default utility for position. That’s why we seldom use static
in a practical project.
sticky
is very similar to fixed
. fixed
is locked at the beginning, but sticky
is stuck only when scrolling to the specified position.
We can set the position to the element by absolute
, regardless of the actual HTML position.
By relative
and absolute
, we can implement some special layout.
Since relative
is offset by the original element, it may overlap other elements. We have to consider overlap priority to determine the final HTML result.
When using top
, bottom
, left
and right
with relative
, it is positioned to the original element.
fixed
and absolute
will create a new layer; relative
remains in the original layer.
By absolute
with top
, bottom
, left
, right
, and m-auto
, we can implement some special layout.
By fixed
with top
, bottom
, left
, right
, and m-auto
, we can implement some special layout.
When using top
, bottom
, left
and right
with absolute
, it is placed relative to its closest positioned ancestor.
When using top
, bottom
, left
and right
with fixed
, it is positioned relative to the window
element.
fixed
locks the element at the specified position, regardless of scrolling to another position.
When using TailwindCSS, <button>
has been reset by CSS Reset. We have to use utilities to compose a simple button.
11ty is great for JAMstack, but we have to use vanilla JavaScript and CSS to create templates. With Alpine and TailwindCSS, we can create templates by declarative style directly in HTML, and we can finally use HTMLMinifier to optimize our HTML under production mode.
TailwindCSS is great for JAMstack, but we have to integrate TailwindCSS with 11ty manually.
absolute
and fixed
are very similar, but there are some subtle differences.
由於 Tailwind CSS 會將 <ul>
Reset,因此原本 <ul>
不再顯示原本 Style,必須加上 Utility 才能正常顯示。
Menu 若使用 Treeview,通常都是 URL 即可,若要能支援無限階層,則必須在 Component 內 Recursive 使用自身 Component。
若資料本身具有階層特性,則適合使用 Treeview 呈現,若要能支援無限階層,則必須在 Component 內 Recursive 使用自身 Component。
若資料本身具有階層特性,則適合使用 Treeview 呈現,若要能支援無限階層,則必須在 Component 內 Recursive 使用自身 Component。
Tab 為實務上常見 UI,可完全使用 Tailwind CSS 實現。
若不想設定 Grid 的 Row 高度,可使用 grid-flow-row
自動產生 Row。
若不想設定 Grid 的 Column 寬度,可使用 grid-flow-col
自動產生 Column。
若想設定 Grid 的每個 Column 相同寬度,可使用 auto-cols-
直接加上寬度。