Skip to content

Commit

Permalink
Create EventTile_font mixin and remove redundant files
Browse files Browse the repository at this point in the history
Signed-off-by: Suguru Hirahara <[email protected]>
  • Loading branch information
luixxiul committed Mar 4, 2024
1 parent c59eb04 commit 42e5891
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
}
}

0 comments on commit 42e5891

Please sign in to comment.