forked from matrix-org/matrix-react-sdk
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix IRC layout, adding a dedicated CSS file for customization and editing rethemendex.sh
#21
Draft
luixxiul
wants to merge
22
commits into
SchildiChat:sc
Choose a base branch
from
luixxiul:_sc_customization
base: sc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…IRC layout This commit does two things: 1. Create a dedicated CSS for customization, making it modular based on mixin 2. Fix line-height on IRC layout When it comes to styling, basically we could just import a custom CSS file after the last existing `@import` on _components.pcss and put every custom stuff like CSS declarations and variables in it to let them override the inherited values in the way which the concept of CSS expects. This commit also takes advantage of PostCSS to make our style codebase modular by creating files, on which only mixins are defined to be used elsewhere. The obvious merit of doing so is that it will remove the burden of applying customization directly on the upstream CSS codebase fixing conflicts. Separating customized styles from the upstream codebase should also greatly reduce the manpower to rebase, without being worried about possible regressions. Doing so will also make it easier to fix the regressions on our codebase which the upstream project has not fixed yet. Even if the properties are annoyingly styled with `!important` by the upstream to cover the regression, they could be overridden by ones with `!important` on the CSS files imported later than that. The way in which the upstream project generates concatenated CSS files has been very stable (essentially same since at least 2018. See: https://github.com/matrix-org/matrix-react-sdk/commits/develop/res/css/rethemendex.sh), so we should be able to depend on the current way how it works for a reasonable time.
Remove comments
… being covered each other
This commit implements the fix modularly.
This commit updates rethemendex.sh, so that any CSS files in "_sc" folder are excluded from being included to alphabetic sorting which causes cascading mess, ensuring `_customization.pcss` is imported at the end of the file. This also removes warning message from README.md as this update takes care of importing our CSS files.
luixxiul
force-pushed
the
_sc_customization
branch
from
March 1, 2024 09:22
5695863
to
d5900bf
Compare
luixxiul
changed the title
Fix IRC layout, adding dedicated CSS for customization and editing
Fix IRC layout, adding a dedicated CSS file for customization and editing Mar 1, 2024
rethemendex.sh
rethemendex.sh
luixxiul
force-pushed
the
_sc_customization
branch
from
March 1, 2024 14:09
09f1ea4
to
9e9a6b6
Compare
Following the reasonable suggestion here https://matrix.to/#/!eSTlitQAfqxWWEHMFD:matrix.org/$ezvD9S1tokciSKpyxoSQEv2npu7Y0_cpYAaGR2mJwJQ?via=supercable.onl&via=matrix.org, I will split this PR into two; one for fixing IRC layout and the other for adding a dedicated CSS file for customization and editing Created the PR: #23 |
Since displayName on ReplyChain is aligned to the left side on our UI as well, the default way of displaying and hiding mxId with visibility declaration is set to be applied. This commit also fixes the variable for line height, removing `unset` as it is no longer necessary.
This was referenced Mar 4, 2024
…bility one Signed-off-by: Suguru Hirahara <[email protected]>
SpiritCroc
pushed a commit
that referenced
this pull request
Oct 6, 2024
* Add labels file Copied from the old matrix-org react-sdk labels (which weren't synced from github it seems). * Add label sync workflow * Remove labels that are defined in element-meta
This was referenced Oct 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR intends to achieve these things:
@mixin
line-height
etc.--
(1)
When it comes to styling, basically we could just import a custom CSS file after the last existing
@import
on_components.pcss
and put every custom stuff like CSS declarations and variables in it to let them override the inherited values in the way which the concept of CSS expects. This commit also takes advantage of PostCSS to make our style codebase modular by creating files, on which only mixins are defined to be used elsewhere. In order to achieve it, I have editedrethemendex.sh
to have it exclude CSS files under_sc
from alphabetical sorting and import_sc/_customization.pcss
at the end.The obvious merit of doing so is that it will remove the burden of applying customization directly on the upstream CSS codebase fixing conflicts. Separating customized styles from the upstream codebase should also greatly reduce the manpower to rebase, without being worried about possible regressions, avoding the tech debt of the upstream project which might not be solved. Doing so will also make it easier to fix the regressions on our codebase which the upstream project has not fixed yet. Additionally, it will make contributing easier for those who would like to contribute but are not familiar with the style codebase for SchildiChat, like me. Using
@mixin
extensively might be opinionated, but this way it should be possible to maintain and develop style rules as modular, as the upstream project has probably hoped somewhat.Even if properties will be styled with
!important
by the upstream to cover a new regression, they will be able to be overridden by ones with!important
on the CSS files imported later than that. It is better than importing CSS styles and leaving them vulnerable to be accidentally overridden by something imported later than that.The way in which the upstream project generates concatenated CSS files has been very stable (essentially same since at least 2018. See: https://github.com/matrix-org/matrix-react-sdk/commits/develop/res/css/rethemendex.sh), so we should be able to depend on the current way how it works for a reasonable time.
--
(2)
Based on that, this PR also intends to fix and improve IRC layout, by fixing the wrong Compound implementation introduced by the upstream project.
For reference, I have voluntarily worked on IRC layout to improve it 2022-2023 as a contributor, and most of the style rules I have worked on still remain there and in effect. See:
Nobody at the upstream project does not seem to have fixed the regressions introduced by Compound's wrong implementation, and this PR should fix those issues earlier than Element will eventually.
For IRC layout, this PR intends to fix these regressions inherited from the upstream:
line-height
to any elements onmx_IRClayout
by default, letting declarations with more specificity override the value.line-height
valuemx_EventTile
on IRC layout--
(3)
This PR also intends to fix bugs not specific to IRC layout:
--
display names are aligned to left 👎
display names are aligned to right 👍
Not aligned 👎
Aligned well 👍
displayName is slightly larger than EventTile 👎
displayName height is same as EventTile 👍
Aligned well 👍
Aligned well 👍
Not aligned at all (16x16) ❌
Aligned (14x14) 👍
Aligned well 👍
Aligned well 👍
Inconsistent ❌
Consistent 👍
Not aligned at all ❌
Aligned well 👍
Not aligned ❌
Aligned well 👍
Ellipsis is rendered in black 👎
Ellipsis is rendered in green 👍
mxID is not aligned with elements around it 👎
mxID is aligned with displayName 👍
On ReplyTile
overflow ❌
Fit well 👍
2x size of line-height
The other bugs which this PR intends to fix:
Before:
before.webm
After:
after.webm