Các tiện ích để kiểm soát color scheme của một phần tử.
| Class | Styles |
|---|---|
scheme-normal | color-scheme: normal; |
scheme-dark | color-scheme: dark; |
scheme-light | color-scheme: light; |
scheme-light-dark | color-scheme: light dark; |
scheme-only-dark | color-scheme: only dark; |
scheme-only-light | color-scheme: only light; |
Sử dụng các tiện ích như scheme-light và scheme-light-dark để kiểm soát cách phần tử nên được hiển thị:
Thử chuyển đổi color scheme hệ thống của bạn để thấy sự khác biệt
scheme-light
scheme-dark
scheme-light-dark
<div class="scheme-light ..."> <input type="date" /></div><div class="scheme-dark ..."> <input type="date" /></div><div class="scheme-light-dark ..."> <input type="date" /></div>Prefix a color-scheme utility with a variant like dark:* to only apply the utility in that state:
<html class="scheme-light dark:scheme-dark ..."> <!-- ... --></html>Learn more about using variants in the variants documentation.