Skip to content

Commit

Permalink
chore: remove redundant svg color overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
zettca committed Feb 26, 2025
1 parent 3ec907c commit eca2862
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 47 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/ActionsGeneric/ActionsGeneric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ export const HvActionsGeneric = forwardRef<
const actsVisible = actions.slice(0, maxVisibleActions);
const actsDropdown = actions.slice(maxVisibleActions);

const semantic = variant === "semantic";
const iconColor =
(disabled && "secondary_60") || (semantic && "base_dark") || undefined;
const iconColor = (variant === "semantic" && "base_dark") || undefined;

return (
<>
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/AppSwitcher/Action/Action.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const { staticClasses, useClasses } = createClasses(
margin: `0 ${theme.space.xs}`,
textWrap: "balance",
...theme.typography.label,
color: "inherit",
},
titleAnchor: {
WebkitLineClamp: 2,
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/Button/Button.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,3 @@ export const getIconSizeStyles = (size: HvSize) => {
width: height,
};
};

export const getOverrideColors = () => ({
"& svg .color0": {
fill: "currentcolor",
},
});
6 changes: 2 additions & 4 deletions packages/core/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
} from "../types/generic";
import {
getIconSizeStyles,
getOverrideColors,
getSizeStyles,
staticClasses,
useClasses,
Expand Down Expand Up @@ -54,7 +53,7 @@ export type HvButtonProps<C extends React.ElementType = "button"> =
size?: HvSize;
/** Button border radius. */
radius?: HvRadius;
/** Defines the default colors of the button are forced into the icon. */
/** Defines the default colors of the button are forced into the icon. @deprecated unused */
overrideIconColors?: boolean;
/** A Jss Object used to override or extend the styles applied. */
classes?: HvButtonClasses;
Expand Down Expand Up @@ -113,7 +112,7 @@ export const HvButton = fixedForwardRef(function HvButton<
endIcon,
size,
radius,
overrideIconColors = true,
overrideIconColors,
component: Component = "button",
focusableWhenDisabled,
onClick: onClickProp,
Expand Down Expand Up @@ -153,7 +152,6 @@ export const HvButton = fixedForwardRef(function HvButton<
classes.root,
classes[variant],
classes[variantProp as keyof HvButtonClasses], // Placed after type and color CSS for DS3 override
overrideIconColors && css(getOverrideColors()),
{
[classes.icon]: icon,
[classes.disabled]: disabled,
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/DotPagination/DotPagination.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const { useClasses, staticClasses } = createClasses("HvDotPagination", {
height: 16,
width: 16,
minWidth: 16,
color: "inherit",

"&:hover": {
backgroundColor: theme.colors.neutral_20,
Expand All @@ -28,7 +29,9 @@ export const { useClasses, staticClasses } = createClasses("HvDotPagination", {
minWidth: 0,
width: 16,
height: 16,
color: "inherit",
"&& svg": {
color: "inherit",
border: "none",
width: "unset",
height: "unset",
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/FormElement/Adornment/Adornment.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createClasses } from "@hitachivantara/uikit-react-utils";
import { theme } from "@hitachivantara/uikit-styles";

export const { staticClasses, useClasses } = createClasses("HvAdornment", {
root: {
Expand All @@ -15,7 +14,5 @@ export const { staticClasses, useClasses } = createClasses("HvAdornment", {
hideIcon: { display: "none" },
/** @deprecated use `classes.root` */
adornmentButton: {},
disabled: {
"& svg *.color0": { fill: theme.colors.secondary_60 },
},
disabled: {},
});
6 changes: 0 additions & 6 deletions packages/core/src/ListContainer/ListItem/ListItem.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ export const { staticClasses, useClasses } = createClasses("HvListItem", {
boxShadow: "none !important",
outline: "none !important",
},
"$disabled > svg *.color0": {
fill: theme.colors.secondary_60,
},
},
withEndAdornment: {
"& > div": { float: "right" },
Expand All @@ -79,8 +76,5 @@ export const { staticClasses, useClasses } = createClasses("HvListItem", {
boxShadow: "none !important",
outline: "none !important",
},
"$disabled > svg *.color0": {
fill: theme.colors.secondary_60,
},
},
});
3 changes: 0 additions & 3 deletions packages/core/src/Tabs/Tab/Tab.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ export const { staticClasses, useClasses } = createClasses("HvTab", {
"& .MuiTab-iconWrapper": {
margin: 0,
},
"& svg .color0": {
fill: "currentcolor",
},
},
focusVisible: {
...outlineStyles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ export const { staticClasses, useClasses } = createClasses(
"& > button": {
marginLeft: "auto",
},

"& .HvListItem-startAdornment .color0": {
fill: "currentColor",
},
},
listItemSelected: {
background: theme.colors.atmo3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ export const { staticClasses, useClasses } = createClasses(
},
icon: {
display: "flex",
"& .color0": {
fill: "currentColor",
},
"> div:first-of-type": {
marginLeft: "var(--icon-margin-left)",
},
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/VerticalNavigation/stories/Custom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const classes = {
flexDirection: "column",
gap: theme.space.md,
"& span": { color: "inherit" },
"& svg *.color0": { fill: "inherit" },
}),
appName: css({
display: "flex",
Expand Down
3 changes: 0 additions & 3 deletions packages/pentaho/src/Canvas/PanelTab/PanelTab.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export const { staticClasses, useClasses } = createClasses("HvCanvasPanelTab", {
boxShadow: "0px -2px 8px 0px #4141410F",
paddingInlineEnd: 0,
paddingInlineStart: 0,
"& svg .color0": {
fill: "currentcolor",
},
"&:hover": {
cursor: "pointer",
},
Expand Down
10 changes: 0 additions & 10 deletions templates/Canvas/StatusEdge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { css } from "@emotion/css";
import {
BaseEdge,
EdgeLabelRenderer,
Expand All @@ -13,14 +12,6 @@ import { useFlowInstance } from "@hitachivantara/uikit-react-lab";

import { FlowStatus, flowStatusesSpecs } from "./utils";

const classes = {
dropdownMenu: css({
"& svg .color0": {
fill: "var(--color-0)",
},
}),
};

export type StatusEdgeData =
| undefined
| {
Expand Down Expand Up @@ -72,7 +63,6 @@ export const StatusEdge = (props: EdgeProps<StatusEdgeData>) => {
className="nodrag nopan nowheel" // ReactFlow specific classes to prevent drag on icon
>
<HvDropDownMenu
className={classes.dropdownMenu}
icon={status.icon}
dataList={[{ id: "remove", label: "Remove connection" }]}
onClick={handleClick}
Expand Down

0 comments on commit eca2862

Please sign in to comment.