分類速查 (按功能而非字母)
字母序易查詢,分類易記憶。本文兩者兼備,重點標註屬性關聯。
佈局與定位
- position: static/relative/absolute/fixed/sticky
- top/right/bottom/left/inset (邏輯屬性)
- z-index / stacking context
- display: block/inline/flex/grid/inline-block/none/contents
- float/clear (legacy)
- overflow: visible/hidden/scroll/auto/clip
- box-sizing: content-box/border-box
Flexbox 專屬
- flex-direction: row/column/reverse
- justify-content: flex-start/center/space-between/around/evenly
- align-items: stretch/center/start/end/baseline
- flex-wrap: nowrap/wrap/reverse
- gap/row-gap/column-gap
- flex-grow/shrink/basis → 簡寫 flex
- align-self / order
Grid 專屬
- grid-template-columns/rows/areas
- grid-auto-flow: row/column/dense
- grid-column/row (start/end/span)
- justify-items/align-items/place-items
- justify-content/align-content/place-content
- grid-gap / gap
- subgrid / masonry (實驗)
視覺樣式
- color / background-color / background-image / gradient
- border: width/style/color/radius/image
- box-shadow / filter: drop-shadow/blur/brightness
- opacity / visibility
- transform: translate/rotate/scale/skew/matrix
- transition / animation / @keyframes
排版與文字
- font: family/size/weight/style/line-height/variant/feature-settings
- text-align/decoration/transform/indent/overflow/ellipsis
- white-space: normal/nowrap/pre/pre-wrap/break-spaces
- word-break: normal/break-all/keep-all
- writing-mode: horizontal-tb/vertical-rl/lr
- direction: ltr/rtl
表單與互動
- input/type: text/email/password/number/date/checkbox/radio/file/color/range
- label / fieldset / legend / datalist / output
- :focus / :focus-visible / :focus-within / :user-invalid
- pointer-events: none/auto
- cursor: pointer/default/not-allowed/grab/zoom-in
響應式與邏輯屬性
- @media (width/height/orientation/hover/pointer/prefers-*)
- container queries: @container (size/style)
- 邏輯屬性: margin-inline-start / padding-block-end / inset-block 等
字母序快速索引 (核心 80 詞)
A: absolute, active, align, alpha, anchor, auto
B: background, border, box, block, bold, button
C: color, center, class, css, clear, cursor
D: display, div, document, default
E: element, em
F: float, font, flex, focus
G: grid, gap
H: height, hover, hidden
I: id, inline, important, index
J: justify
L: left, line, list, link
M: margin, max, min, media
N: none, nav
O: object, overflow, opacity
P: padding, position, pointer, pseudo
R: relative, right, repeat, responsive
S: scroll, span, static, strong, style
T: transform, transition, table, td, tr, top
U: url, underline, uppercase
V: vertical, visibility, viewport
W: width, white-space, z-index (Z)
命名慣例建議
- Class: BEM
.block__element--modifier (kebab-case)
- CSS 變數:
--brand-primary (kebab-case, 雙連字號前綴)
- JS 變數/函數: camelCase
- 檔名: kebab-case (
header-nav.vue)
- 組件名: PascalCase (
HeaderNav.vue)