Skip to content

pantoken-root / packages/model/src / defineToken

Hàm: defineToken() ​

defineToken(input): Token

Beta

Xây dựng một Token hợp lệ từ đầu vào không đầy đủ, mặc định syntax thành "*" và inherits thành true. Các plugin nhập khẩu cái này từ @pantoken/model để tránh phụ thuộc vào @pantoken/core; để suy luận cú pháp CSS thông minh, sử dụng defineToken từ @pantoken/core.

Tham số ​

input ​

TokenInput

Trả về ​

Token

Ví dụ ​

ts
import { defineToken } from "@pantoken/model";

defineToken({ name: "--instui-brand", value: "#0374B5" });
// → { name: "--instui-brand", syntax: "*", inherits: true, value: "#0374B5" }