Irodori彩り

StyleX

6 token ngữ nghĩa chính thức

Tổng 6 màu

Giới thiệu StyleX

StyleX là thư viện CSS-in-JS của Meta dùng để định nghĩa token thiết kế phân tích tĩnh qua defineVars. Token được đặt cùng component và biên dịch thành atomic CSS.

Cách sử dụng

Khai báo token brand qua stylex.defineVars và áp dụng bằng API stylex.props. StyleX đảm bảo style xác định và không xung đột.

Tài liệu chính thức

Primary

colors.primary

Brand primary — stylex.defineVars docs example

Secondary

colors.secondary

Secondary brand color — docs example

Text

colors.text

Primary text color — docs example

Background

colors.background

Page background — docs example

Accent

colors.accent

Accent — docs example (dark: lightblue)

Primary text

colors.primaryText

Typography token — docs example (dark: white)

Nguồn: StyleX · defineVars docs example