refactor: use tailwind spacing scale utilities instead of arbitrary px values - #154
Open
wendyyuchensun wants to merge 1 commit into
Open
refactor: use tailwind spacing scale utilities instead of arbitrary px values#154wendyyuchensun wants to merge 1 commit into
wendyyuchensun wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
把 6 處數值剛好落在 Tailwind 預設 spacing scale 上的 arbitrary value,換成對應的 utility class:
單位隨之由 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 補償。