Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate icons using Compound Design Tokens #28219

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions res/css/structures/_GenericDropdownMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ Please see LICENSE files in the repository root for full details.

&[aria-checked="true"]::before {
content: "";
width: 12px;
height: 12px;
margin-left: -20px;
margin-right: 8px;
mask-image: url("$(res)/img/feather-customised/check.svg");
width: 16px;
height: 16px;
margin-left: -22px;
margin-right: 6px;
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
mask-size: 100%;
mask-repeat: no-repeat;
background-color: $primary-content;
Expand Down
2 changes: 1 addition & 1 deletion res/css/structures/_RoomStatusBar.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Please see LICENSE files in the repository root for full details.
}

&.mx_RoomStatusBar_unsentCancelAllBtn::before {
mask-image: url("$(res)/img/element-icons/trashcan.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/delete.svg");
}

&.mx_RoomStatusBar_unsentRetry {
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/context_menus/_MessageContextMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Please see LICENSE files in the repository root for full details.
}

.mx_MessageContextMenu_iconRedact::before {
mask-image: url("$(res)/img/element-icons/trashcan.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/delete.svg");
}

.mx_MessageContextMenu_iconResend::before {
Expand Down Expand Up @@ -92,7 +92,7 @@ Please see LICENSE files in the repository root for full details.
}

.mx_MessageContextMenu_iconReply::before {
mask-image: url("$(res)/img/element-icons/room/message-bar/reply.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/reply.svg");
}

.mx_MessageContextMenu_iconReplyInThread::before {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/dialogs/_InviteDialog.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Please see LICENSE files in the repository root for full details.
height: 24px;
grid-column: 1;
grid-row: 1;
mask-image: url("$(res)/img/feather-customised/check.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
mask-size: 100%;
mask-repeat: no-repeat;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Please see LICENSE files in the repository root for full details.
color: $accent;

&::before {
mask-image: url("$(res)/img/feather-customised/check.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
background-color: $accent;
}
}
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/elements/_AccessibleButton.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Please see LICENSE files in the repository root for full details.
background-color: var(--cpd-color-bg-action-primary-rest);

&::before {
mask-image: url("$(res)/img/feather-customised/check.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
}
}

Expand Down
3 changes: 2 additions & 1 deletion res/css/views/elements/_ImageView.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ $button-gap: 24px;
}

.mx_ImageView_button_more::before {
mask-image: url("$(res)/img/image-view/more.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/overflow-horizontal.svg");
mask-size: 28px;
}

.mx_ImageView_button_close {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/elements/_StyledCheckbox.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Please see LICENSE files in the repository root for full details.

height: 100%;
width: 100%;
mask-image: url("$(res)/img/feather-customised/check.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
mask-position: center;
mask-size: 100%;
mask-repeat: no-repeat;
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/elements/_Validation.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Please see LICENSE files in the repository root for full details.
color: $accent;

&::before {
mask-image: url("$(res)/img/feather-customised/check.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
background-color: $accent;
}
}
Expand Down
4 changes: 4 additions & 0 deletions res/css/views/messages/_MessageActionBar.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,8 @@ Please see LICENSE files in the repository root for full details.
--MessageActionBar-icon-size: 12px;
}
}

.mx_MessageActionBar_optionsButton {
--MessageActionBar-icon-size: 22px;
}
}
2 changes: 1 addition & 1 deletion res/css/views/messages/_RedactedBody.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Please see LICENSE files in the repository root for full details.
height: 14px;
width: 14px;
background-color: $icon-button-color;
mask-image: url("$(res)/img/feather-customised/trash.custom.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/delete.svg");
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/right_panel/_ThreadPanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Please see LICENSE files in the repository root for full details.
width: 12px;
height: 12px;
margin-right: 8px;
mask-image: url("$(res)/img/feather-customised/check.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
mask-size: 100%;
mask-repeat: no-repeat;
background-color: $primary-content;
Expand Down
3 changes: 2 additions & 1 deletion res/css/views/rooms/_MessageComposer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ Please see LICENSE files in the repository root for full details.
}

.mx_MessageComposer_buttonMenu::before {
mask-image: url("$(res)/img/image-view/more.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/overflow-horizontal.svg");
mask-size: 24px;
}

.mx_MessageComposer_sendMessage {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/rooms/_VoiceRecordComposerTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Please see LICENSE files in the repository root for full details.
background-color: $voice-record-icon-color;
mask-repeat: no-repeat;
mask-size: contain;
mask-image: url("$(res)/img/element-icons/trashcan.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/delete.svg");
}

.mx_VoiceRecordComposerTile_uploadingState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ Please see LICENSE files in the repository root for full details.
top: 0;
left: 0;
background-color: $alert;
mask-image: url("$(res)/img/feather-customised/alert-triangle.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/warning.svg");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Please see LICENSE files in the repository root for full details.
}

&.mx_LegacyCallViewButtons_button_more::before {
mask-image: url("$(res)/img/voip/call-view/more.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/overflow-horizontal.svg");
}
/* Stateless buttons */

Expand Down
3 changes: 0 additions & 3 deletions res/img/compound/thread-16px.svg

This file was deleted.

7 changes: 0 additions & 7 deletions res/img/compound/user.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/trashcan.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/feather-customised/check.svg

This file was deleted.

7 changes: 0 additions & 7 deletions res/img/feather-customised/trash.custom.svg

This file was deleted.

13 changes: 0 additions & 13 deletions res/img/feather-customised/warning-triangle.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/format/bold.svg

This file was deleted.

7 changes: 0 additions & 7 deletions res/img/format/code.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/format/italics.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/format/quote.svg

This file was deleted.

6 changes: 0 additions & 6 deletions res/img/format/strikethrough.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/image-view/more.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/voip/call-view/more.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/structures/RoomStatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
SyncState,
SyncStateData,
} from "matrix-js-sdk/src/matrix";
import { WarningIcon } from "@vector-im/compound-design-tokens/assets/web/icons";

import { Icon as WarningIcon } from "../../../res/img/feather-customised/warning-triangle.svg";
import { _t, _td } from "../../languageHandler";
import Resend from "../../Resend";
import dis from "../../dispatcher/dispatcher";
Expand Down
5 changes: 2 additions & 3 deletions src/components/views/elements/Pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import React, { ReactElement } from "react";
import classNames from "classnames";
import { Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { Tooltip } from "@vector-im/compound-web";
import LinkIcon from "@vector-im/compound-design-tokens/assets/web/icons/link";
import { LinkIcon, UserSolidIcon } from "@vector-im/compound-design-tokens/assets/web/icons";

import { MatrixClientPeg } from "../../../MatrixClientPeg";
import MatrixClientContext from "../../../contexts/MatrixClientContext";
import { usePermalink } from "../../../hooks/usePermalink";
import RoomAvatar from "../avatars/RoomAvatar";
import MemberAvatar from "../avatars/MemberAvatar";
import { _t } from "../../../languageHandler";
import { Icon as UserIcon } from "../../../../res/img/compound/user.svg";

export enum PillType {
UserMention = "TYPE_USER_MENTION",
Expand Down Expand Up @@ -63,7 +62,7 @@ const PillMemberAvatar: React.FC<{
if (member) {
return <MemberAvatar member={member} size="16px" aria-hidden="true" hideTitle />;
}
return <UserIcon className="mx_Pill_UserIcon mx_BaseAvatar" />;
return <UserSolidIcon className="mx_Pill_UserIcon mx_BaseAvatar" />;
};

export interface PillProps {
Expand Down
Loading
Loading