Skip to content

Commit

Permalink
fix: visual defects following theme change
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralsh committed Nov 25, 2024
1 parent 074407e commit 66dc7c5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
4 changes: 1 addition & 3 deletions src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ const Alert = ({
return (
<Flex
bg={alertColours[type].backgroundColor}
py="x2"
paddingLeft="x2"
paddingRight="x1_5"
p="x2"
borderRadius="medium"
borderLeftWidth="4px"
borderLeftColor={alertColours[type].borderColor}
Expand Down
6 changes: 3 additions & 3 deletions src/BrandedNavBar/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const Menu = styled.ul(({ theme }) => ({
zIndex: theme.zIndices.content,
width: "100%",
color: theme.colors.white,
[`${Heading3}`]: {
[`${TopLevelText}`]: {
padding: `${theme.space.x1} 0 ${theme.space.x1} ${theme.space.x3}`,
},
}));
Expand Down Expand Up @@ -226,14 +226,14 @@ type BaseMobileMenuProps = {
showNulogyLogo?: boolean;
};

const BaseMobileMenu: React.FC<React.PropsWithChildren<BaseMobileMenuProps>> = ({
const BaseMobileMenu = ({
menuData,
closeMenu,
subtext,
themeColorObject,
showNulogyLogo,
...props
}) => (
}: BaseMobileMenuProps) => (
<Nav backgroundColor={themeColorObject && themeColorObject.background} {...props}>
<BrandingWrap>
<BrandingText logoColor={themeColorObject?.logoColor} />
Expand Down
1 change: 1 addition & 0 deletions src/Breadcrumbs/BreadcrumbsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const BreadcrumbsListItem = styled.li<{ variant: ComponentVariant }>(
"a, p": {
padding: theme.space.none,
fontSize: theme.fontSizes.small,
lineHeight: theme.lineHeights.smallTextBase,
},
}),
variant({
Expand Down
11 changes: 1 addition & 10 deletions src/Button/ControlIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,7 @@ const StyledButton = styled.button<{

const ControlIcon = React.forwardRef<HTMLButtonElement, ControlIconProps>(
({ icon, toggled, disabled, label, size = "x4", type = "button", ...props }, ref) => (
<StyledButton
height={size}
width={size}
aria-label={label}
ref={ref}
disabled={disabled}
toggled={toggled}
type={type}
{...props}
>
<StyledButton aria-label={label} ref={ref} disabled={disabled} toggled={toggled} type={type} {...props}>
<Icon size={size} icon={icon} />
</StyledButton>
)
Expand Down
2 changes: 1 addition & 1 deletion src/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Svg = React.forwardRef<SVGSVGElement, IconProps>(
);

const Icon = styled(Svg)<IconProps>(space, ({ theme, color = "currentColor", size }) => ({
minWidth: theme.sizes[size] ?? theme.sizes.x3,
minWidth: theme.sizes[size] ?? size ?? theme.sizes.x3,
color: color,
}));

Expand Down
6 changes: 0 additions & 6 deletions src/utils/subPx.js

This file was deleted.

11 changes: 11 additions & 0 deletions src/utils/subPx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type CSSUnit = string;
/**
* Subtracts two CSS measurements using calc()
* @param baseValue The starting CSS measurement
* @param subtractValue The value to subtract (defaults to '1px')
* @returns A CSS calc() expression
*/
export default function subPx(baseValue: CSSUnit, subtractValue?: CSSUnit): string {
const valueToSubtract: CSSUnit = subtractValue ?? "1px";
return `calc(${baseValue} - ${valueToSubtract})`;
}

0 comments on commit 66dc7c5

Please sign in to comment.