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

Stop using mx_GroupLayout for styling #8711

Merged
merged 21 commits into from
Jun 15, 2022
Merged

Stop using mx_GroupLayout for styling #8711

merged 21 commits into from
Jun 15, 2022

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented May 28, 2022

For element-hq/element-web#22434

For mx_EventTile, mx_GroupLayout is globally a parent element. Because mx_GroupLayout includes mx_EventTile as a child element on _GroupLayout.scss, any rules to style mx_EventTile differently require to have mx_GroupLayout as a parent selector in order to cancel cascading effect (see: ThreadsList), which makes style rules unnecessarily complicated and bloated.

Since mx_GroupLayout has currently mx_EventTile as a sole direct child element on _GroupLayout.scss, it should be able to be safely removed in favor of mx_EventTile[data-layout=group], which is used much more widely to style EventTile on the group layout. With this PR, mx_GroupLayout is used only one time on _EventTilePreview.scss 🎉

Actually _GroupLayout.scss can be (and should be) deleted altogether by moving the rest of the rules on the file because there is no "Group Layout", but it is out of scope of this PR.

type: task

Signed-off-by: Suguru Hirahara [email protected]


This change is marked as an internal change (Task), so will not be included in the changelog.

@github-actions github-actions bot added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label May 28, 2022
@luixxiul luixxiul marked this pull request as ready for review May 29, 2022 02:09
@luixxiul luixxiul requested a review from a team as a code owner May 29, 2022 02:09
@turt2live turt2live added the Z-Community-PR Issue is solved by a community member's PR label Jun 2, 2022
@luixxiul luixxiul marked this pull request as draft June 3, 2022 08:35
@luixxiul luixxiul changed the title Stop using mx_GroupLayout as the top level declaration for styling Stop using mx_GroupLayout for styling and delete _GroupLayout.scss Jun 3, 2022
…o _EventTile.scss

- Remove _GroupLayout.scss

Signed-off-by: Suguru Hirahara <[email protected]>
- Move the variables to the top
- Remove the duplicate variable
- Replace the global variable with a scss variable as it is no longer used on other files

Signed-off-by: Suguru Hirahara <[email protected]>
The declaration with not() function is stronger than the declaration with '[data-layout=group]'. Setting margin value should be left to selectors in each case.

Signed-off-by: Suguru Hirahara <[email protected]>
Signed-off-by: Suguru Hirahara <[email protected]>
- Add [data-layout=group] to EventTile (it had been included in mx_GroupLayout)

Signed-off-by: Suguru Hirahara <[email protected]>
Into .mx_EventTile[data-shape=ThreadsList]

Signed-off-by: Suguru Hirahara <[email protected]>
@luixxiul luixxiul marked this pull request as ready for review June 3, 2022 09:11
@luixxiul luixxiul changed the title Stop using mx_GroupLayout for styling and delete _GroupLayout.scss Stop using mx_GroupLayout for styling Jun 3, 2022
@luixxiul
Copy link
Contributor Author

luixxiul commented Jun 3, 2022

Though the change itself is fairly small, I've split it into meaningful chunks for the sake of reviewers. Please ask me if there is something which is not clear enough. I could provide some screenshots of DOM if requested.

@@ -128,7 +145,6 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
display: inline-block;
padding-bottom: 0px;
padding-top: 0px;
margin: 0px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Suguru Hirahara <[email protected]>
@@ -803,7 +819,7 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
}

.mx_DisambiguatedProfile {
margin-right: $spacing-12;
margin-inline: 0 $spacing-12;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@SimonBrandner SimonBrandner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane

@SimonBrandner SimonBrandner enabled auto-merge (squash) June 15, 2022 15:48
@luixxiul
Copy link
Contributor Author

mm cypress: 12-spotlight/spotlight.spec.ts keeps failing...

@SimonBrandner SimonBrandner merged commit 81c894f into matrix-org:develop Jun 15, 2022
@luixxiul luixxiul deleted the GroupLayout branch June 15, 2022 17:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants