Rename assets
to chunks
A chunk will look like this
const file = {
base: ``,
utilities: ``,
recipes: ``,
};
When the files are changed:
- we merge/dedupe utilities, recipes
- we replace global styles
Allow create jsx components from factory directly. This is useful for custom components.
const Button = chakra("button",{
--test: "fontSizes.xl",
fontSize: "clamp(var(--test), 20px)"
})
Extract css prop from every component-like jsx elements.
function App() {
return <Button css={{ fontSize: "40px" }}>Welcome</Button>;
}
const dict = new TokenDictionary({
tokens: {},
semanticTokens: {},
});
dict.allTokens;
dict.isReference(value);
dict.getReference(value);
dict.allTokens.forEach((token) => {
if (token.attributes.category === "space") {
const negativeToken = negate(token);
dict.allTokens.push(negativeToken);
}
});
// value | attribute | name
dict.registerTransform({
name: "colors",
type: "value",
match: (token) => token.attributes.category === "colors",
transform(token) {
return "....";
},
});
dict.registerFormat({
name: "css-var",
resolveReference: true,
formatter: ({ dictionary }) => {},
});
dict.compile({
format: "css-var",
output(result) {},
});
class TokenDictionary {
_values = [];
constructor({ tokens, semanticTokens }) {
const walkFn = (value, paths) => {
_values.push({ value, paths });
};
walkObject(tokens, walkFn, {
stop(value) {
return isObject(value) && "value" in value;
},
});
}
compile() {}
getReferenceRegex() {}
findReference() {}
resolveReference() {}
}