Skip to content

refactor: use tailwind spacing scale utilities instead of arbitrary px values - #154

Open
wendyyuchensun wants to merge 1 commit into
coseeing:mainfrom
wendyyuchensun:tailwind
Open

refactor: use tailwind spacing scale utilities instead of arbitrary px values#154
wendyyuchensun wants to merge 1 commit into
coseeing:mainfrom
wendyyuchensun:tailwind

Conversation

@wendyyuchensun

@wendyyuchensun wendyyuchensun commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

把 6 處數值剛好落在 Tailwind 預設 spacing scale 上的 arbitrary value,換成對應的 utility class:

  • min-w-[64px] → min-w-16 (header 的 tip / import / export / more / language 按鈕)
  • w-[64px] → w-16 (home 的 LaTeX delimiter segmented control)
  • py-[6px] → py-1.5 (toast)
  • -{bottom,top,right,left}-[14px] → -3.5 (tooltip 箭頭)

單位隨之由 px 變成 rem(4rem / 0.375rem / -0.875rem)。在預設 16px root font-size 下數值等價,且使用者調大瀏覽器預設字級時會跟著縮放,對按鈕最小寬度與 toast padding 來說是應是預期的行為。

其餘 arbitrary value 保留:min-w-[88px] / h-[72px] / max-w-[280px] / h-[600px] / min-w-[768px] 雖是 4 的倍數,但對應的 class 要 Tailwind 4 的 dynamic spacing scale 才存在;按鈕的 px-[11px] / py-[7px] 等是刻意的 border 補償。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant