Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

remove icon button variants

Roman Pominov55f1e488ab8b
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/pages/pages.tsx b/apps/designer/app/designer/features/sidebar-left/panels/pages/pages.tsx
index 76d40b424d..15eb16435a 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/pages/pages.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/pages/pages.tsx
@@ -4,6 +4,7 @@ import {
TreeItemBody,
TreeNode,
type TreeItemRenderProps,
+ styled,
} from "@webstudio-is/design-system";
import { type Publish } from "~/shared/pubsub";
import {
@@ -69,6 +70,20 @@ const staticTreeProps = {
},
};
+const MenuButton = styled(IconButton, {
+ mr: "$1",
+ color: "$hint",
+ "&:hover, &:focus": { color: "$hiContrast" },
+ variants: {
+ parentSelected: {
+ true: {
+ color: "$loContrast",
+ "&:hover, &:focus": { color: "$slate7" },
+ },
+ },
+ },
+});
+
const PagesPanel = ({
onClose,
onCreateNewPage,
@@ -104,12 +119,12 @@ const PagesPanel = ({
(isEditing ? (
<ChevronRightIcon />
) : (
- <IconButton
- variant={isSelected ? "selectedItemAction" : "itemAction"}
+ <MenuButton
+ parentSelected={isSelected}
onClick={() => onEdit(props.itemData.id)}
>
<MenuIcon />
- </IconButton>
+ </MenuButton>
))
}
alwaysShowSuffix={isEditing}
diff --git a/packages/design-system/src/components/icon-button.tsx b/packages/design-system/src/components/icon-button.tsx
index b39dcdf080..b3b2a7d872 100644
--- a/packages/design-system/src/components/icon-button.tsx
+++ b/packages/design-system/src/components/icon-button.tsx
@@ -16,12 +16,23 @@ export const IconButton = styled("button", {
textDecoration: "none",
userSelect: "none",
WebkitTapHighlightColor: "transparent",
+ color: "$hiContrast",
background: "none",
outline: "2px solid transparent",
outlineOffset: 2,
"&::before, &::after": {
boxSizing: "border-box",
},
+ "&:hover, &:active": {
+ backgroundColor: "$slate6",
+ outline: "none",
+ },
+ "&:focus": {
+ backgroundColor: "$slate6",
+ outline: "none",
+ border: "2px solid white",
+ boxShadow: "0px 0px 0px 2px $colors$blue10, 0px 0px 0px 2px $colors$blue10",
+ },
"&:disabled": {
pointerEvents: "none",
backgroundColor: "transparent",
@@ -36,7 +47,7 @@ export const IconButton = styled("button", {
width: "$3",
"&:hover, &:focus": {
background: "none",
- borderColor: "transparent",
+ border: "none",
},
},
"2": {
@@ -55,44 +66,8 @@ export const IconButton = styled("button", {
width: "$8",
},
},
- variant: {
- regular: {
- color: "$hiContrast",
- "&:hover, &:active": {
- backgroundColor: "$slate6",
- outline: "none",
- },
- "&:focus": {
- backgroundColor: "$slate6",
- outline: "none",
- border: "2px solid white",
- boxShadow:
- "0px 0px 0px 2px $colors$blue10, 0px 0px 0px 2px $colors$blue10",
- },
- },
- itemAction: {
- color: "$slate9",
- height: "$4",
- width: "$4",
- borderRadius: 3,
- border: "2px solid transparent",
- "&:hover, &:focus-visible": {
- color: "$hiContrast",
- },
- "&:focus-visible": {
- borderColor: "$blue10",
- },
- },
- selectedItemAction: {
- color: "$loContrast",
- "&:hover, &:focus-visible": {
- color: "$slate7",
- },
- },
- },
},
defaultVariants: {
size: "1",
- variant: "regular",
},
});