Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yukukotani committed Oct 14, 2024
1 parent b59c216 commit 7cfd09a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const StyledBox = styled("div", {

### Theme

Create a config file anywhere you want.
Create a config file anywhere you want. Currently `colors`, `spaces`, `sizes`, `fontSizes`, and `radii` tokens are supported.

```tsx
export const config = defineConfig({
Expand Down
22 changes: 20 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
export type ConfigSchema = {
tokens?: {
[K in TokenKind]?: Record<string, TokensConfigValue>;
/**
* tokens for color properties such as `color` or `backgroundColor`
*/
colors?: Record<string, TokensConfigValue>;
/**
* Tokens for space properties such as `margin` or `gap`
*/
spaces?: Record<string, TokensConfigValue>;
/**
* Tokens for size properties such as `width` or `height`
*/
sizes?: Record<string, TokensConfigValue>;
/**
* Tokens for `fontSize` property
*/
fontSizes?: Record<string, TokensConfigValue>;
/**
* Tokens for `borderRadius` property
*/
radii?: Record<string, TokensConfigValue>;
};
};

type TokenKind = "colors" | "spaces" | "sizes" | "fontSizes" | "radii";
type TokensConfigValue = string;

// biome-ignore lint/suspicious/noEmptyInterface: This is to be overridden in user's theme config.
Expand Down

0 comments on commit 7cfd09a

Please sign in to comment.