Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(ui): respect ribbon button size overrides (#7681)

白熱d555e1297ae2
diff --git a/packages/ui/src/views/components/ribbon/ToolbarButton.tsx b/packages/ui/src/views/components/ribbon/ToolbarButton.tsx
index dc337c1579..2d8469db2a 100644
--- a/packages/ui/src/views/components/ribbon/ToolbarButton.tsx
+++ b/packages/ui/src/views/components/ribbon/ToolbarButton.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import { cva } from '@univerjs/design';
+import { clsx, cva } from '@univerjs/design';
export interface IBaseToolbarButtonProps {
children?: React.ReactNode;
@@ -115,7 +115,7 @@ export function ToolbarButton(props: IBaseToolbarButtonProps) {
return (
<button
type="button"
- className={toolbarButtonVariants({ noIcon, active, className })}
+ className={clsx(toolbarButtonVariants({ noIcon, active, className }))}
style={style}
disabled={disabled}
onClick={handleClick}
diff --git a/packages/ui/src/views/components/ribbon/ToolbarItem.tsx b/packages/ui/src/views/components/ribbon/ToolbarItem.tsx
index 8d7d051d5c..a9d077c060 100644
--- a/packages/ui/src/views/components/ribbon/ToolbarItem.tsx
+++ b/packages/ui/src/views/components/ribbon/ToolbarItem.tsx
@@ -453,7 +453,7 @@ export const ToolbarItem = forwardRef<ITooltipWrapperRef, IToolbarItemProps>((pr
return (
<span
data-u-command={id}
- className={toolbarButtonVariants({
+ className={clsx(toolbarButtonVariants({
noIcon: !icon,
active: activated,
className: clsx(buttonClassName, !hoverable && `
@@ -461,7 +461,7 @@ export const ToolbarItem = forwardRef<ITooltipWrapperRef, IToolbarItemProps>((pr
hover:!univer-bg-transparent
dark:hover:!univer-bg-transparent
`),
- })}
+ }))}
style={buttonStyle}
aria-disabled={disabled}
>