Skip to content

Commit

Permalink
Deduplicate icons using Compound (#28239)
Browse files Browse the repository at this point in the history
* Deduplicate icons using Compound

Signed-off-by: Michael Telatynski <[email protected]>

* Update snapshots

Signed-off-by: Michael Telatynski <[email protected]>

* Update e2e tests

Signed-off-by: Michael Telatynski <[email protected]>

* Iterate

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Oct 21, 2024
1 parent c278d2f commit 02e0aca
Show file tree
Hide file tree
Showing 48 changed files with 156 additions and 203 deletions.
4 changes: 2 additions & 2 deletions playwright/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ test.describe("Timeline", () => {
const toggleEventButton = viewSourceEventExpanded.getByRole("button", { name: "toggle event" });
// Check size and position of toggle on expanded view source event
// See: _ViewSourceEvent.pcss
await expect(toggleEventButton).toHaveCSS("height", "12px"); // --ViewSourceEvent_toggle-size
await expect(toggleEventButton).toHaveCSS("height", "16px"); // --ViewSourceEvent_toggle-size
await expect(toggleEventButton).toHaveCSS("align-self", "flex-end");
// Click again to collapse the source
await toggleEventButton.click({ position: { x: 0, y: 0 } });
Expand All @@ -679,7 +679,7 @@ test.describe("Timeline", () => {
);

// Click view source event toggle
await viewSourceEventIrc.getByRole("button", { name: "toggle event" }).click({ position: { x: 0, y: 0 } });
await viewSourceEventIrc.getByRole("button", { name: "toggle event" }).click({ position: { x: 8, y: 8 } });

// Make sure the expand toggle worked
await expect(page.locator(".mx_EventTile[data-layout=irc] .mx_ViewSourceEvent_expanded")).toBeVisible();
Expand Down
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.
Binary file modified playwright/snapshots/widgets/layout.spec.ts/apps-drawer-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion res/css/components/views/location/_ZoomButtons.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);

.mx_ZoomButtons_icon {
$ZoomButtons_icon-size: 10px;
$ZoomButtons_icon-size: 12px;

height: $ZoomButtons_icon-size;
width: $ZoomButtons_icon-size;
Expand Down
4 changes: 2 additions & 2 deletions res/css/structures/_SpacePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Please see LICENSE files in the repository root for full details.
&.mx_SpaceButton_new .mx_SpaceButton_icon {
&::before {
background-color: $primary-content;
mask-image: url("$(res)/img/element-icons/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
transition: all 0.2s ease-in-out; /* TODO transition */
}
}
Expand Down Expand Up @@ -434,7 +434,7 @@ Please see LICENSE files in the repository root for full details.
}

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

.mx_SpacePanel_iconExplore::before {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/context_menus/_MessageContextMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Please see LICENSE files in the repository root for full details.
}

.mx_MessageContextMenu_iconCollapse::before {
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
}

.mx_MessageContextMenu_iconReport::before {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/elements/_InviteReason.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
content: "";
margin-right: 8px;
background-color: $secondary-content;
mask-image: url("$(res)/img/feather-customised/eye.svg");
mask-image: url("$(res)/img/element-icons/eye.svg");
display: inline-block;
width: 18px;
height: 14px;
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/messages/_MImageBody.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Please see LICENSE files in the repository root for full details.
margin-right: 8px;

background-color: $accent;
mask-image: url("$(res)/img/feather-customised/eye.svg");
mask-image: url("$(res)/img/element-icons/eye.svg");
display: inline-block;
width: 18px;
height: 14px;
Expand Down
18 changes: 7 additions & 11 deletions res/css/views/messages/_ViewSourceEvent.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ Please see LICENSE files in the repository root for full details.
}

.mx_ViewSourceEvent_toggle {
--ViewSourceEvent_toggle-size: 12px;
--ViewSourceEvent_toggle-size: 16px;

visibility: hidden;
/* override styles from AccessibleButton */
border-radius: 0;
/* icon */
mask-repeat: no-repeat;
mask-position: 0 center;
mask-size: auto var(--ViewSourceEvent_toggle-size);
width: var(--ViewSourceEvent_toggle-size);
min-width: var(--ViewSourceEvent_toggle-size);
background-color: $accent;
mask-image: url("$(res)/img/element-icons/maximise-expand.svg");

svg {
color: $accent;
width: var(--ViewSourceEvent_toggle-size);
height: var(--ViewSourceEvent_toggle-size);
}

.mx_EventTile:hover & {
visibility: visible;
Expand All @@ -47,8 +46,5 @@ Please see LICENSE files in the repository root for full details.
&.mx_ViewSourceEvent_expanded .mx_ViewSourceEvent_toggle {
align-self: flex-end;
height: var(--ViewSourceEvent_toggle-size);
mask-position: 0 bottom;
margin-bottom: 5px;
mask-image: url("$(res)/img/element-icons/minimise-collapse.svg");
}
}
2 changes: 1 addition & 1 deletion res/css/views/right_panel/_BaseCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Please see LICENSE files in the repository root for full details.
width: 100%;
mask-repeat: no-repeat;
mask-position: center;
mask-image: url("$(res)/img/element-icons/message/overflow-large.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/overflow-horizontal.svg");
background-color: $secondary-content;
}

Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -982,11 +982,11 @@ $left-gutter: 64px;
}

.mx_EventTile_collapseButton {
mask-image: url("$(res)/img/element-icons/minimise-collapse.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/collapse.svg");
}

.mx_EventTile_expandButton {
mask-image: url("$(res)/img/element-icons/maximise-expand.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/expand.svg");
}

.mx_EventTile_tileError {
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_JumpToBottomButton.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Please see LICENSE files in the repository root for full details.
content: "";
position: absolute;
inset: 0;
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
mask-repeat: no-repeat;
mask-size: 20px;
mask-size: 24px;
mask-position: center 6px;
transform: rotate(180deg);
background: var(--cpd-color-icon-tertiary);
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_RoomListHeader.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Please see LICENSE files in the repository root for full details.
mask-size: contain;
mask-repeat: no-repeat;
background-color: $secondary-content;
mask-image: url("$(res)/img/element-icons/roomlist/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
}

&:hover {
Expand Down Expand Up @@ -104,5 +104,5 @@ Please see LICENSE files in the repository root for full details.
mask-image: url("$(res)/img/element-icons/roomlist/hash-search.svg");
}
.mx_RoomListHeader_iconPlus::before {
mask-image: url("$(res)/img/element-icons/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
}
2 changes: 1 addition & 1 deletion res/css/views/rooms/_RoomSublist.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Please see LICENSE files in the repository root for full details.
}

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

.mx_RoomSublist_menuButton::before {
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_TopUnreadMessagesBar.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Please see LICENSE files in the repository root for full details.
position: absolute;
width: 36px;
height: 36px;
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
mask-repeat: no-repeat;
mask-size: 20px;
mask-size: 24px;
mask-position: center;
background: var(--cpd-color-icon-tertiary);
}
Expand Down
6 changes: 3 additions & 3 deletions res/css/views/voip/LegacyCallView/_LegacyCallViewButtons.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ Please see LICENSE files in the repository root for full details.
bottom: 0;

&::before {
width: 14px;
height: 14px;
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
width: 16px;
height: 16px;
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
}

&.mx_LegacyCallViewButtons_dropdownButton_collapsed::before {
Expand Down
5 changes: 0 additions & 5 deletions res/img/element-icons/add-photo.svg

This file was deleted.

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

This file was deleted.

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

This file was deleted.

1 change: 0 additions & 1 deletion res/img/element-icons/message/chevron-up.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/element-icons/message/overflow-large.svg

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/feather-customised/alert-triangle.svg

This file was deleted.

6 changes: 0 additions & 6 deletions res/img/feather-customised/eye.svg

This file was deleted.

4 changes: 0 additions & 4 deletions res/img/feather-customised/plus.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/feather-customised/widget/external-link.svg

This file was deleted.

15 changes: 0 additions & 15 deletions res/img/icon-address-delete.svg

This file was deleted.

Loading

0 comments on commit 02e0aca

Please sign in to comment.