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

Improve _ShareType.scss #8737

Merged
merged 12 commits into from
Jun 2, 2022
Merged

Improve _ShareType.scss #8737

merged 12 commits into from
Jun 2, 2022

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Jun 1, 2022

Before After
before after
  • Stop setting declarations more than needed. The mixin complicates the style inheritance structure, hides declarations which possibly specify elements in a wrong way, and also wastes resources.
  • Protect the buttons from being regressed unexpectedly by setting enough specificity to prevent a regression. Please note that every top level block is treated equally among all files.
  • Remove element='button' from AccessibleButton, which is a redundant setting. If it should be a button HTML element, it is AccessibleButton that should be fixed. -> should be addressed with another PR.

Signed-off-by: Suguru Hirahara luixxiul@users.noreply.github.com

type: task


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

The reset mixin can cause style inconsistencies by disrupting cascading arbitrarily, increasing the number of specified declarations more than needed. Though it might be useful for development, it is not necessary to use it, makes it difficult to grasp the style structure, and can be removed to optimize the structure.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Since AccessibleButton has role='button' by default, setting the element button property is redundant.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
box-sizing is not required for the buttons or the wrapper.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
@github-actions github-actions bot added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Jun 1, 2022
@MadLittleMods MadLittleMods added the Z-Community-PR Issue is solved by a community member's PR label Jun 1, 2022
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
AccessibleButton is div by default

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
@luixxiul luixxiul marked this pull request as ready for review June 2, 2022 02:30
@luixxiul luixxiul requested a review from a team as a code owner June 2, 2022 02:30
Copy link
Contributor

@weeman1337 weeman1337 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @luixxiul !

Just some smaller comments (you are cleaning up, so lets do it right 😄 )

res/css/components/views/location/_ShareType.scss Outdated Show resolved Hide resolved
res/css/components/views/location/_ShareType.scss Outdated Show resolved Hide resolved
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
This reverts commit af78d27.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
This reverts commit 7d783a7.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Copy link
Contributor

@weeman1337 weeman1337 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@weeman1337 weeman1337 merged commit abfc66a into matrix-org:develop Jun 2, 2022
@luixxiul
Copy link
Contributor Author

luixxiul commented Jun 2, 2022

Vielen Dank für Verifizierung 😃

@luixxiul luixxiul deleted the ShareType branch June 2, 2022 12:21
JanBurp pushed a commit to JanBurp/matrix-react-sdk that referenced this pull request Jun 14, 2022
* Specify the button style explicitly removing the dependency on the mixin

The reset mixin can cause style inconsistencies by disrupting cascading arbitrarily, increasing the number of specified declarations more than needed. Though it might be useful for development, it is not necessary to use it, makes it difficult to grasp the style structure, and can be removed to optimize the structure.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove element='button' from AccessibleButton

Since AccessibleButton has role='button' by default, setting the element button property is redundant.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Protect mx_ShareType_option from being regressed structurally

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* yarn run lint:style --fix

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Wrap buttons with declarations for spacing

box-sizing is not required for the buttons or the wrapper.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* yarn run lint:style --fix

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* fix eslint errors

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix LocationShareMenu-test.tsx

AccessibleButton is div by default

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Reflect the review

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Revert "Remove element='button' from AccessibleButton"

This reverts commit af78d27.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Revert "Fix LocationShareMenu-test.tsx"

This reverts commit 7d783a7.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
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