brand
data-brand="reputa-premier" — thay đổi toàn bộ brand color tokens. component dùng var(--color-brand-600) tự động nhận giá trị mới.
--color-brand-600 1thay hỗ trợ 4 brand modes qua attribute selectors. tất cả components tự động phản hồi — không cần thay đổi code. chuyển đổi qua dropdown BrandSwitch trên navbar.
data-brand="reputa-premier" — thay đổi toàn bộ brand color tokens. component dùng var(--color-brand-600) tự động nhận giá trị mới.
--color-brand-600 data-brand="tramnghe" — brand teal + Merriweather display. phù hợp y tế, môi trường.
#044f44 data-brand="1thay" — brand vàng + Space Grotesk display. phù hợp startup, sáng tạo.
#FBC000 bấm vào brand switch trên navbar để thấy components thay đổi. dưới đây là một số components hiển thị với token hiện tại:
/* tokens.css — 4 brand modes, mỗi brand override semantic tokens */
[data-brand="reputa-premier"] {
--color-brand-600: #A10B2E;
}
[data-brand="tramnghe"] {
--color-brand-600: #044f44;
--font-display: 'Merriweather', serif;
}
[data-brand="1thay"] {
--color-brand-600: #FBC000;
--font-display: 'Space Grotesk', monospace;
} import { BrandSwitch } from '@1thay/core';
// đặt trong navbar
<BrandSwitch client:load />
// component tự động phản hồi CSS variables
// không cần props, không cần context <script>
(() => {
const m = localStorage.getItem('1thay-brand');
if (m && m !== 'reputa-blue')
document.body.setAttribute('data-brand', m);
})();
</script> brandswitch component cho phep chuyen doi giua 4 brands:
dung nut brandswitch tren navbar de xem hieu ung. component tu dong luu lua chon vao localStorage.
<BrandSwitch client:load />