Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
fix: logo lack of contrast (calcom#12401)
Browse files Browse the repository at this point in the history
Co-authored-by: Peer Richelsen <[email protected]>
  • Loading branch information
MehulZR and PeerRich authored Nov 17, 2023
1 parent 27d59b6 commit 176564f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function RenderIcon({
return (
<img
src={eventLocationType.iconUrl}
className={classNames(invertLogoOnDark(eventLocationType?.iconUrl), "me-[10px] h-4 w-4")}
className={classNames(invertLogoOnDark(eventLocationType?.iconUrl, true), "me-[10px] h-4 w-4")}
alt={`${eventLocationType.label} icon`}
/>
);
Expand Down
13 changes: 11 additions & 2 deletions packages/lib/invertLogoOnDark.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// we want to invert all logos that contain -dark in their name
// we don't want to invert logos that are not coming from the app-store

export default function invertLogoOnDark(url?: string) {
return (url?.includes("-dark") || !url?.startsWith("/app-store")) && "dark:invert";
export default function invertLogoOnDark(
url?: string,
// The background color of the logo's display location is opposite of the general theme of the application.
// Ex. General App theme is black but the logo's background color is white.
opposite?: boolean
) {
return url?.includes("-dark") || !url?.startsWith("/app-store")
? opposite
? "invert dark:invert-0"
: "dark:invert"
: "";
}

0 comments on commit 176564f

Please sign in to comment.