diff --git a/res/css/_sc/feature-improvement/consistency__TextEvent/index.pcss b/res/css/_sc/feature-improvement/consistency__TextEvent/index.pcss index 6c8c2233b30a..575c86a872d6 100644 --- a/res/css/_sc/feature-improvement/consistency__TextEvent/index.pcss +++ b/res/css/_sc/feature-improvement/consistency__TextEvent/index.pcss @@ -19,12 +19,9 @@ limitations under the License. @import "./views/rooms/_EventTile.pcss"; @import "./views/messages/_DecryptionFailureBody.pcss"; -@import "./views/messages/_TextualEvent.pcss"; -@import "./views/messages/_RedactedBody.pcss"; @define-mixin consistency__TextEvent { @mixin EventTile_color; + @mixin EventTile_font; @mixin DecryptionFailureBody; - @mixin TextualEvent; - @mixin RedactedBody; } diff --git a/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_DecryptionFailureBody.pcss b/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_DecryptionFailureBody.pcss index 6f2b5fd676d0..82e6af7bb4e2 100644 --- a/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_DecryptionFailureBody.pcss +++ b/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_DecryptionFailureBody.pcss @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +/* Since mx_DecryptionFailureBody is neither in mx_EventTile_info nor + mx_GenericEventListSummary, it requires rules which style it directly. */ @define-mixin DecryptionFailureBody { .mx_DecryptionFailureBody { color: $tertiary-content; diff --git a/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_RedactedBody.pcss b/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_RedactedBody.pcss deleted file mode 100644 index aa623d71a6cc..000000000000 --- a/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_RedactedBody.pcss +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2024 Suguru Hirahara - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -@define-mixin RedactedBody { - .mx_RedactedBody { - font: var(--cpd-font-body-sm-regular); - } -} diff --git a/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_TextualEvent.pcss b/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_TextualEvent.pcss deleted file mode 100644 index 13c651447c37..000000000000 --- a/res/css/_sc/feature-improvement/consistency__TextEvent/views/messages/_TextualEvent.pcss +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2024 Suguru Hirahara - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -@define-mixin TextualEvent { - .mx_TextualEvent { - font: var(--cpd-font-body-sm-regular); - } -} diff --git a/res/css/_sc/feature-improvement/consistency__TextEvent/views/rooms/_EventTile.pcss b/res/css/_sc/feature-improvement/consistency__TextEvent/views/rooms/_EventTile.pcss index 9bdeabc10e4b..ff8a63bc0d44 100644 --- a/res/css/_sc/feature-improvement/consistency__TextEvent/views/rooms/_EventTile.pcss +++ b/res/css/_sc/feature-improvement/consistency__TextEvent/views/rooms/_EventTile.pcss @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -/* Specify text color with color property instead of opacity. Note this mixin is - applied to GELS as well */ +/* Specify text color with color property instead of opacity. + Note this mixin is applied to GELS as well. */ @define-mixin EventTile_color { :where(.mx_EventTile_info, .mx_GenericEventListSummary) { /* Get rid of opacity values for coloring from CSS files as it is very @@ -41,3 +41,19 @@ limitations under the License. } } } + +/* Specify font for consistency */ +@define-mixin EventTile_font { + :where(.mx_EventTile_info, .mx_GenericEventListSummary) { + --font: var(--cpd-font-body-sm-regular); /* Replace with js when needed */ + + .mx_EventTile_line { + /* Set the same font to the element directly below it. This way, + it is possible to avoid applying the font value to elements + inside it, such as code element in mx_ViewSourceEvent. */ + > * { + font: var(--font); + } + } + } +}