Skip to content

Commit

Permalink
feat: theme tokens update after figma variables release (#8)
Browse files Browse the repository at this point in the history
* feat: theme tokens update after figma variables release

* fix(theme): rename tokens

---------

Co-authored-by: mwleklinskiVL <[email protected]>
  • Loading branch information
adrian-potepa and wleklinskimateusz authored Jul 17, 2023
1 parent e0ecd6f commit 124ce87
Show file tree
Hide file tree
Showing 5 changed files with 2,015 additions and 1,893 deletions.
2 changes: 1 addition & 1 deletion src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const Button = () => {
const [clicked, setClicked] = useState(false);
return (
<tet.button
color="$a-color-action-destructive-active"
color="action-destructive-active"
onClick={() => setClicked(true)}
disabled={clicked}
>
Expand Down
14 changes: 7 additions & 7 deletions src/tetrisly/tetrisly.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ describe("check tetrisly provider, and correct styling", () => {
it("with no theme provided should use default theme", () => {
render(
<TetrislyProvider>
<tet.button color="$g-color-blue-+1">Click me</tet.button>
<tet.button color="blue-+1">Click me</tet.button>
</TetrislyProvider>
);
const button = screen.getByText("Click me");
expect(button).toHaveStyle(`color: ${theme.colors["$g-color-blue-+1"]}`);
expect(button).toHaveStyle(`color: ${theme.colors["blue-+1"]}`);
});
it("with theme provided should use theme", () => {
const customColor = "rgb(255, 0, 0)";
render(
<TetrislyProvider
theme={{
colors: {
"$g-color-blue-+1": customColor,
"blue-+1": customColor,
},
}}
>
<tet.button color="$g-color-blue-+1" backgroundColor="$g-color-blue-+2">
<tet.button color="blue-+1" backgroundColor="blue-+2">
Click me
</tet.button>
</TetrislyProvider>
Expand All @@ -37,19 +37,19 @@ describe("check tetrisly provider, and correct styling", () => {
<TetrislyProvider
theme={{
colors: {
"$g-color-blue-+1": customColor,
"blue-+1": customColor,
},
}}
>
<tet.button color="$g-color-blue-+1" backgroundColor="$g-color-blue-+2">
<tet.button color="blue-+1" backgroundColor="blue-+2">
Click me
</tet.button>
</TetrislyProvider>
);
const button = screen.getByText("Click me");
expect(button).toHaveStyle(`color: ${customColor}`);
expect(button).toHaveStyle(
`background-color: ${theme.colors["$g-color-blue-+2"]}`
`background-color: ${theme.colors["blue-+2"]}`
);
});
});
Loading

0 comments on commit 124ce87

Please sign in to comment.