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

Compound color pass #11079

Merged
merged 35 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f4784c3
Integrate compound design tokens
Jun 13, 2023
a0451d0
Pareto color pass on the light theme
Jun 13, 2023
c5edcb8
Merge branch 'develop' into gsouquet/compound-color-pass
Jun 16, 2023
5e260ea
bugfixes in the light color pass
Jun 16, 2023
e234662
Merge branch 'develop' into gsouquet/compound-color-pass
Jun 19, 2023
d7a115a
Compound color pass dark theme
Jun 19, 2023
ee40c00
Compound color pass high contrast
Jun 19, 2023
a32156f
Merge branch 'develop' into gsouquet/compound-color-pass
Jun 27, 2023
4293b01
Fix typo
Jun 28, 2023
0bd9b3b
fix tooltip
Jun 29, 2023
19484d1
Fix PR feedback
Jun 29, 2023
ec12dbb
Merge branch 'develop' into gsouquet/compound-color-pass
Jul 5, 2023
7fb4333
fix composer button mixin
Jul 5, 2023
0ed5b4c
Normalise some of the auth page colors
Jul 5, 2023
2db7e35
Update based on figma feedback
Jul 5, 2023
ed2d479
lintfix
Jul 5, 2023
34d40d9
regenerate theme index
Jul 5, 2023
0eb671c
Fix cypress tests
Jul 5, 2023
18f8ff2
fix more e2e tests
Jul 5, 2023
c3c141f
update colors based on feedback
Jul 5, 2023
3565fe7
fix color pass
Jul 6, 2023
2fb87a1
Fix theme overrides
Jul 6, 2023
4e8db00
Restore -transparent
Jul 6, 2023
273ea8f
fix color mapping
Jul 7, 2023
f3cf7e7
Merge branch 'develop' into gsouquet/compound-color-pass
Jul 12, 2023
1e189b0
Final colour pass update
Jul 12, 2023
243da49
Do not consume compound colors directly
Jul 12, 2023
950465b
rethemedex
Jul 12, 2023
a3646e2
Update pass
Jul 12, 2023
b46a5d1
Final tweaks
Jul 12, 2023
3e329ea
a11y pass
Jul 12, 2023
0127888
scope opacity to checkbox and not label
Jul 12, 2023
de7815a
Add missing customisations var for theming
Jul 12, 2023
333bdf8
lintfix
Jul 12, 2023
2197248
remove unwanted test
Jul 12, 2023
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
12 changes: 1 addition & 11 deletions cypress/e2e/room/room-header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,7 @@ describe("Room Header", () => {
const buttonsHighlighted = ["Threads", "Notifications", "Room info"];

for (const name of buttonsHighlighted) {
cy.findByRole("button", { name: name })
.click() // Highlight the button
.then(($btn) => {
// Note it is not possible to get CSS values of a pseudo class with "have.css".
const color = $btn[0].ownerDocument.defaultView // get window reference from element
.getComputedStyle($btn[0], "before") // get the pseudo selector
.getPropertyValue("background-color"); // get "background-color" value

// Assert the value is equal to $accent == hex #0dbd8b == rgba(13, 189, 139)
expect(color).to.eq("rgb(13, 189, 139)");
});
cy.findByRole("button", { name: name }).click(); // Highlight the button
}
});

Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/settings/appearance-user-settings-tab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ describe("Appearance user settings tab", () => {

cy.get(".mx_GenericEventListSummary").within(() => {
// Assert that $primary-content is applied to GELS summary on the light theme
// $primary-content on the light theme = #17191c = rgb(23, 25, 28)
// $primary-content on the light theme = #17191c = rgb(27, 29, 34)
cy.get(".mx_TextualEvent.mx_GenericEventListSummary_summary")
.should("have.css", "color", "rgb(23, 25, 28)")
.should("have.css", "color", "rgb(27, 29, 34)")
.should("have.css", "opacity", "0.5");
});

Expand All @@ -320,9 +320,9 @@ describe("Appearance user settings tab", () => {

cy.get(".mx_GenericEventListSummary").within(() => {
// Assert that $secondary-content is specified for GELS summary on the high contrast theme
// $secondary-content on the high contrast theme = #5e6266 = rgb(94, 98, 102)
// $secondary-content on the high contrast theme = #5e6266 = rgb(71, 74, 81)
cy.get(".mx_TextualEvent.mx_GenericEventListSummary_summary")
.should("have.css", "color", "rgb(94, 98, 102)")
.should("have.css", "color", "rgb(71, 74, 81)")
.should("have.css", "opacity", "1");
});
});
Expand Down
20 changes: 0 additions & 20 deletions cypress/e2e/threads/threads.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ describe("Threads", () => {
"Hello there. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt " +
"ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi";

// --MessageTimestamp-color = #acacac = rgb(172, 172, 172)
// See: _MessageTimestamp.pcss
const MessageTimestampColor = "rgb(172, 172, 172)";
const ThreadViewGroupSpacingStart = "56px"; // --ThreadView_group_spacing-start
// Exclude timestamp and read marker from snapshots
const percyCSS = ".mx_MessageTimestamp, .mx_MessagePanel_myReadMarker { visibility: hidden !important; }";
Expand All @@ -75,13 +72,6 @@ describe("Threads", () => {
// User sends message
cy.findByRole("textbox", { name: "Send a message…" }).type("Hello Mr. Bot{enter}");

// Check the colour of timestamp on the main timeline
cy.get(".mx_EventTile_last .mx_EventTile_line .mx_MessageTimestamp").should(
"have.css",
"color",
MessageTimestampColor,
);

// Wait for message to send, get its ID and save as @threadId
cy.contains(".mx_EventTile[data-scroll-tokens]", "Hello Mr. Bot")
.invoke("attr", "data-scroll-tokens")
Expand Down Expand Up @@ -151,13 +141,6 @@ describe("Threads", () => {
cy.get(".mx_ThreadView").within(() => {
// User responds in thread
cy.findByRole("textbox", { name: "Send a message…" }).type("Test{enter}");

// Check the colour of timestamp on EventTile in a thread (mx_ThreadView)
cy.get(".mx_EventTile_last[data-layout='group'] .mx_EventTile_line .mx_MessageTimestamp").should(
"have.css",
"color",
MessageTimestampColor,
);
});

// User asserts summary was updated correctly
Expand Down Expand Up @@ -307,9 +290,6 @@ describe("Threads", () => {
// Check the number of the replies
cy.get(".mx_ThreadPanel_replies_amount").findByText("2").should("exist");

// Check the colour of timestamp on thread list
cy.get(".mx_EventTile_details .mx_MessageTimestamp").should("have.css", "color", MessageTimestampColor);

// Make sure the notification dot is visible
cy.get(".mx_NotificationBadge_visible").should("be.visible");

Expand Down
18 changes: 10 additions & 8 deletions res/css/_common.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ legend {
background-color: transparent;
color: $input-darker-fg-color;
border-radius: 4px;
border: 1px solid rgba($primary-content, 0.1);
border: 1px solid $secondary-hairline-color;
/* these things should probably not be defined globally */
margin: 9px;
}
Expand All @@ -263,7 +263,7 @@ legend {
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="text"]::placeholder,
:not(.mx_textinput):not(.mx_Field):not(.mx_no_textinput) > input[type="search"]::placeholder,
.mx_textinput input::placeholder {
color: rgba($input-darker-fg-color, 0.75);
color: $input-placeholder;
}
}

Expand Down Expand Up @@ -584,9 +584,9 @@ legend {

/* flip colours for the secondary ones */
font-weight: var(--cpd-font-weight-semibold);
border: 1px solid $accent;
border: 1px solid currentColor;
color: $accent;
background-color: $button-secondary-bg-color;
background-color: transparent;
font-family: inherit;
}

Expand Down Expand Up @@ -808,18 +808,19 @@ legend {
mask-size: contain;
height: 18px;
min-width: 18px;
background-color: $secondary-content !important;
background-color: $icon-button-color !important;
}

@define-mixin composerButtonHighLight {
background: rgba($accent, 0.25);
/* TODO: Refactor as this will break for apps that override the accent color */
background: var(--cpd-color-green-300);
/* make the icon the accent color too */
&::before {
background-color: $accent !important;
}
}

@define-mixin composerButton $border-radius, $hover-color {
@define-mixin composerButton $border-radius, $hover-color, $hover-bg {
--size: 26px;
position: relative;
cursor: pointer;
Expand All @@ -840,6 +841,7 @@ legend {
mask-repeat: no-repeat;
mask-size: contain;
mask-position: center;
z-index: 2;
}

&::after {
Expand All @@ -855,7 +857,7 @@ legend {

&:hover {
&::after {
background: rgba($hover-color, 0.1);
germain-gg marked this conversation as resolved.
Show resolved Hide resolved
background: $hover-bg;
}

&::before {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ limitations under the License.

.mx_KebabContextMenu_icon {
width: 24px;
color: $secondary-content;
color: $icon-button-color;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
background: transparent;

border-radius: 4px;
color: $secondary-content;
color: $icon-button-color;

--icon-transform: rotate(-90deg);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ limitations under the License.

&.Inactive {
--icon-color: $secondary-content;
--background-color: $system;
--background-color: $panels;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
}

.mx_DeviceTypeIcon_deviceIconWrapper {
--background-color: $system;
--background-color: $panels;
--icon-color: $secondary-content;

height: 40px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.
padding: 0 $spacing-16;
margin-bottom: $spacing-32;

background-color: $system;
background-color: $panels;
border-radius: 8px;
color: $secondary-content;
}
Expand Down
2 changes: 1 addition & 1 deletion res/css/compound/_Icon.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ limitations under the License.
}

.mx_Icon_bg-accent-light {
background-color: rgba($accent, 0.1);
background-color: $accent-300;
germain-gg marked this conversation as resolved.
Show resolved Hide resolved
}

.mx_Icon_alert {
Expand Down
3 changes: 2 additions & 1 deletion res/css/structures/_FilePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ limitations under the License.

.mx_MessageTimestamp {
text-align: right;
font: var(--cpd-font-body-md-regular);
color: $secondary-content;
font: var(--cpd-font-body-sm-regular);
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions res/css/structures/_LeftPanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_MatrixChat--with-avatar {
.mx_LeftPanel,
.mx_LeftPanel .mx_LeftPanel_roomListContainer {
background-color: transparent;
}
}
t3chguy marked this conversation as resolved.
Show resolved Hide resolved

.mx_LeftPanel_outerWrapper {
display: flex;
flex-direction: column;
Expand Down
4 changes: 2 additions & 2 deletions res/css/structures/_RoomView.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ limitations under the License.
height: var(--RoomHeader-indicator-dot-size);
border-radius: 50%;
transform: scale(1);
background: rgba(var(--RoomHeader-indicator-pulseColor), 1);
box-shadow: 0 0 0 0 rgba(var(--RoomHeader-indicator-pulseColor), 1);
background: var(--RoomHeader-indicator-pulseColor);
box-shadow: 0 0 0 0 var(--RoomHeader-indicator-pulseColor);
animation: mx_Indicator_pulse 2s infinite;
animation-iteration-count: 1;

Expand Down
2 changes: 1 addition & 1 deletion res/css/structures/_SpacePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ limitations under the License.

.mx_UserMenu {
padding: 0 2px 8px;
border-bottom: 1px solid $quinary-content;
border-bottom: 1px solid $separator;
margin: 12px 14px 4px 18px;
max-width: 226px;
}
Expand Down
2 changes: 1 addition & 1 deletion res/css/structures/_UserMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ limitations under the License.
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $primary-content;
background: $icon-button-color;
}
}

Expand Down
2 changes: 1 addition & 1 deletion res/css/views/beta/_BetaCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

.mx_BetaCard {
padding: $spacing-24;
background-color: $system;
background-color: $panels;
border-radius: 8px;
box-sizing: border-box;
color: $secondary-content;
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/context_menus/_IconizedContextMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ limitations under the License.
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background-color: $secondary-content;
background-color: $icon-button-color;
}
}

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 @@ -29,7 +29,7 @@ limitations under the License.
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $primary-content;
background: $icon-button-color;
}
}

Expand Down
2 changes: 1 addition & 1 deletion res/css/views/dialogs/_PollCreateDialog.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
.mx_PollCreateDialog_busy {
position: absolute;
inset: 0;
background-color: rgba($background, 0.6);
background-color: $overlay-background;
z-index: 1;
}

Expand Down
1 change: 0 additions & 1 deletion res/css/views/elements/_AccessibleButton.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ limitations under the License.

&.mx_AccessibleButton_kind_primary_outline {
color: $accent;
background-color: $button-secondary-bg-color;
}

&.mx_AccessibleButton_kind_secondary {
Expand Down
2 changes: 2 additions & 0 deletions res/css/views/elements/_GenericEventListSummary.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ limitations under the License.
/* Make all state events one order smaller than the other events */
.mx_EventTile {
font: var(--cpd-font-body-sm-regular);
color: $secondary-content;
}
}

Expand All @@ -121,6 +122,7 @@ limitations under the License.
.mx_TextualEvent.mx_GenericEventListSummary_summary {
font: var(--cpd-font-body-sm-regular);
display: inline-flex;
color: $secondary-content;
}

.mx_GenericEventListSummary_avatars {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/elements/_SSOButtons.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ limitations under the License.
}

.mx_SSOButton:hover {
background-color: $panel-hover;
background-color: $panel-actions;
}

.mx_SSOButton_default {
Expand Down
3 changes: 1 addition & 2 deletions res/css/views/elements/_StyledCheckbox.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ limitations under the License.
height: $size;
width: $size;
size: 0.5rem;

border: 1px solid rgba($muted-fg-color, 0.5);
border: 1px solid $strong-input-border-color;
box-sizing: border-box;
border-radius: $border-radius;

Expand Down
5 changes: 2 additions & 3 deletions res/css/views/messages/_DisambiguatedProfile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ limitations under the License.
}

.mx_DisambiguatedProfile_mxid {
font: var(--cpd-font-body-sm-semibold);
margin-inline-start: 5px;
opacity: 0.5; /* Match mx_TextualEvent */
color: $primary-content;
color: $secondary-content;
font-size: var(--cpd-font-size-body-sm);
}
}

Expand Down
10 changes: 5 additions & 5 deletions res/css/views/messages/_ReactionsRowButton.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ limitations under the License.
display: inline-flex;
line-height: $font-20px;
padding: 1px 6px;
border: 1px solid $message-action-bar-border-color;
border: 1px solid $quinary-content;
border-radius: 10px;
background-color: $header-panel-bg-color;
background-color: $secondary-hairline-color;
user-select: none;

&:hover {
border-color: $reaction-row-button-hover-border-color;
border-color: $quinary-content;
}

&.mx_ReactionsRowButton_selected {
background-color: $reaction-row-button-selected-bg-color;
border-color: $accent;
background-color: $accent-300;
border-color: $accent-800;
}

&.mx_AccessibleButton_disabled {
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/messages/_RedactedBody.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License.

.mx_RedactedBody {
white-space: pre-wrap;
color: $muted-fg-color;
color: $secondary-content;
vertical-align: middle;

padding-left: 20px;
Expand All @@ -23,7 +23,7 @@ limitations under the License.
&::before {
height: 14px;
width: 14px;
background-color: $muted-fg-color;
background-color: $icon-button-color;
mask-image: url("$(res)/img/feather-customised/trash.custom.svg");
mask-repeat: no-repeat;
mask-position: center;
Expand Down
Loading