Skip to content

Commit

Permalink
fix: remove useAppTheme dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyotato committed Aug 10, 2024
1 parent ca0a374 commit 563931e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
24 changes: 8 additions & 16 deletions packages/design-system/src/components/button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ $size-map: (

@mixin button-sizes($sizes, $size) {
width: $size;
// height: $size;
@if ($sizes== "icon") {
aspect-ratio: 1/1;
} @else {
Expand Down Expand Up @@ -43,12 +42,16 @@ $size-map: (
}
}

@mixin theme($theme) {
@if ($theme == "light") {
html[data-theme="light"] {
.button {
background-color: color(default, 50);
border: 1px solid rgba(0, 0, 0, 0.1);
color: color(default, 800);
} @else if($theme == "dark") {
}
}

html[data-theme="dark"] {
.button {
background-color: color(default, 800);
border: 1px solid rgba(255, 255, 255, 0.1);
color: color(default, 50);
Expand All @@ -65,12 +68,6 @@ $size-map: (
}

.button {
&.light {
@include theme("light");
}
&.dark {
@include theme("dark");
}
align-items: center;
border-radius: shape("sm");
box-sizing: border-box;
Expand Down Expand Up @@ -101,12 +98,7 @@ $size-map: (

.tooltip-button {
box-sizing: border-box;
&.light {
@include theme("light");
}
&.dark {
@include theme("dark");
}

position: relative;
outline: none;
}
Expand Down
6 changes: 1 addition & 5 deletions packages/design-system/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ const Button = ({
size = "m",
...others
}: ButtonProps) => {
const { mode } = useAppTheme();
return (
<button
className={style(className, "button", mode == null ? "os" : mode, size)}
{...others}
>
<button className={style(className, "button", size)} {...others}>
{children}
</button>
);
Expand Down

0 comments on commit 563931e

Please sign in to comment.