Skip to content
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

Improve pills #6398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
25d1c71
Convert Pill to TS
SimonBrandner Jul 18, 2021
be40bb9
Move pill CSS into a separate file
SimonBrandner Jul 18, 2021
8a0d067
Cleanup _Pill.scss
SimonBrandner Jul 18, 2021
a69c11e
Unify pill colors
SimonBrandner Jul 18, 2021
3748b76
Make space pills more squarish
SimonBrandner Jul 18, 2021
3b29ed4
Add hover styling
SimonBrandner Jul 18, 2021
8903966
Missing ()
SimonBrandner Jul 18, 2021
2286054
Fix tooltip positioning weirdness
SimonBrandner Jul 18, 2021
3debbb8
Remove unnecessary CSS
SimonBrandner Jul 18, 2021
0c823db
Make space avatars in pill more squarish
SimonBrandner Jul 18, 2021
a6f26ae
Fix cursor behaviour
SimonBrandner Jul 18, 2021
b0ff201
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Aug 6, 2021
ba2d44a
rethemendex
SimonBrandner Aug 6, 2021
76f87f1
Make member optional
SimonBrandner Aug 6, 2021
be8a5c7
Use an enum for pill type
SimonBrandner Aug 6, 2021
d520f1a
Use PillType in other files
SimonBrandner Aug 6, 2021
ef82db8
Disable naming conv
SimonBrandner Aug 6, 2021
9bd20a7
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Oct 16, 2021
fa7116b
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Oct 26, 2021
6a7bedf
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Oct 26, 2021
7545ed5
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Nov 15, 2021
05111dc
Revert space squareness
SimonBrandner Nov 16, 2021
1787c78
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Dec 5, 2021
7773cd6
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Dec 10, 2021
b865718
Fix missing import
SimonBrandner Dec 10, 2021
64b0bb3
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Mar 3, 2022
eade4d2
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Mar 3, 2022
c7d55cb
Fix import
SimonBrandner Mar 3, 2022
675f674
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Mar 26, 2022
56b6f33
Merge remote-tracking branch 'upstream/develop' into feature/improved…
SimonBrandner Apr 6, 2022
8a54c09
Merge branch 'develop' into feature/improved-pills
SimonBrandner May 1, 2022
5e787ae
Merge branch 'develop' into feature/improved-pills
SimonBrandner May 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
@import "./views/elements/_InviteReason.scss";
@import "./views/elements/_ManageIntegsButton.scss";
@import "./views/elements/_MiniAvatarUploader.scss";
@import "./views/elements/_Pill.scss";
@import "./views/elements/_PowerSelector.scss";
@import "./views/elements/_ProgressBar.scss";
@import "./views/elements/_QRCode.scss";
Expand Down
2 changes: 1 addition & 1 deletion res/css/structures/_RoomDirectory.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ limitations under the License.
line-height: $font-20px;
padding: 0 5px;
color: $accent-fg-color;
background-color: $rte-room-pill-color;
background-color: $pill-bg-color;
}

.mx_RoomDirectory_topic {
Expand Down
64 changes: 64 additions & 0 deletions res/css/views/elements/_Pill.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
Copyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>

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.
*/

.mx_Pill {
padding: $font-1px 0.4em $font-1px 0;
line-height: $font-17px;
border-radius: $font-16px;
vertical-align: text-top;
display: inline-flex;
align-items: center;

cursor: pointer;

color: $accent-fg-color !important; // To override .markdown-body
background-color: $pill-bg-color !important; // To override .markdown-body

&.mx_UserPill_me,
&.mx_AtRoomPill {
background-color: $alert !important; // To override .markdown-body
}

&:hover {
background-color: $pill-hover-bg-color !important; // To override .markdown-body
}

&.mx_UserPill_me:hover {
background-color: #ff6b75 !important; // To override .markdown-body | same on both themes
}

// We don't want to indicate clickability
&.mx_AtRoomPill:hover {
background-color: $alert !important; // To override .markdown-body
cursor: unset;
}

.mx_BaseAvatar {
position: relative;
display: inline-flex;
align-items: center;
border-radius: 10rem;
margin-right: 0.24rem;
}

a& {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: calc(100% - 1ch);
text-decoration: none !important; // To override .markdown-body
}
}
80 changes: 0 additions & 80 deletions res/css/views/elements/_RichText.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,6 @@
// naming scheme; it's completely unclear where or how they're being used
// --Matthew

.mx_UserPill,
.mx_RoomPill,
.mx_AtRoomPill {
display: inline-flex;
align-items: center;
vertical-align: middle;
border-radius: $font-16px;
line-height: $font-15px;
padding-left: 0;
}

a.mx_Pill {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: 100%;
}

.mx_Pill {
padding: $font-1px;
padding-right: 0.4em;
vertical-align: text-top;
line-height: $font-17px;
}

/* More specific to override `.markdown-body a` text-decoration */
.mx_EventTile_content .markdown-body a.mx_Pill {
text-decoration: none;
}

/* More specific to override `.markdown-body a` color */
.mx_EventTile_content .markdown-body a.mx_UserPill,
.mx_UserPill {
color: $primary-content;
background-color: $other-user-pill-bg-color;
}

.mx_UserPill_selected {
background-color: $accent !important;
}

/* More specific to override `.markdown-body a` color */
.mx_EventTile_highlight .mx_EventTile_content .markdown-body a.mx_UserPill_me,
.mx_EventTile_content .markdown-body a.mx_AtRoomPill,
.mx_EventTile_content .mx_AtRoomPill,
.mx_MessageComposer_input .mx_AtRoomPill {
color: $accent-fg-color;
background-color: $alert;
}

/* More specific to override `.markdown-body a` color */
.mx_EventTile_content .markdown-body a.mx_RoomPill,
.mx_RoomPill {
color: $accent-fg-color;
background-color: $rte-room-pill-color;
}

.mx_EventTile_body .mx_UserPill,
.mx_EventTile_body .mx_RoomPill {
cursor: pointer;
}

.mx_UserPill .mx_BaseAvatar,
.mx_RoomPill .mx_BaseAvatar,
.mx_AtRoomPill .mx_BaseAvatar {
position: relative;
display: inline-flex;
align-items: center;
border-radius: 10rem;
margin-right: 0.24rem;
pointer-events: none;
}

.mx_Emoji {
// Should be 1.8rem for our default 1.4rem message bodies,
// and scale with the size of the surrounding text
font-size: calc(18 / 14 * 1em);
vertical-align: bottom;
}

.mx_Markdown_BOLD {
font-weight: bold;
}
Expand Down
18 changes: 8 additions & 10 deletions res/css/views/rooms/_BasicMessageComposer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ limitations under the License.
}

&.mx_BasicMessageComposer_input_shouldShowPillAvatar {
span.mx_UserPill, span.mx_RoomPill {
position: relative;
span.mx_UserPill, span.mx_RoomPill, span.mx_SpacePill {
user-select: all;
position: relative;
cursor: unset; // We don't want indicate clickability

&:hover {
// We don't want indicate clickability | To override the overriding of .markdown-body
background-color: $pill-bg-color !important;
}

// avatar psuedo element
&::before {
Expand All @@ -72,14 +78,6 @@ limitations under the License.
font-size: $font-10-4px;
}
}

span.mx_UserPill {
cursor: pointer;
}

span.mx_RoomPill {
cursor: default;
}
}

&.mx_BasicMessageComposer_input_disabled {
Expand Down
4 changes: 2 additions & 2 deletions res/themes/dark/css/_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ $roomheader-addroom-fg-color: $primary-content;

// Rich-text-editor
// ********************
$rte-room-pill-color: $room-highlight-color;
$other-user-pill-bg-color: $room-highlight-color;
$pill-bg-color: $room-highlight-color;
$pill-hover-bg-color: #545a66;
// ********************

// Inputs
Expand Down
4 changes: 2 additions & 2 deletions res/themes/legacy-dark/css/_legacy-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ $light-fg-color: $header-panel-text-secondary-color;
// used for focusing form controls
$focus-bg-color: $room-highlight-color;

$other-user-pill-bg-color: $room-highlight-color;
$rte-room-pill-color: $room-highlight-color;
$pill-bg-color: $room-highlight-color;
$pill-hover-bg-color: #545a66;

// informational plinth
$info-plinth-bg-color: $header-panel-bg-color;
Expand Down
6 changes: 3 additions & 3 deletions res/themes/legacy-light/css/_legacy-light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ $selection-fg-color: $primary-bg-color;

$focus-brightness: 105%;

$other-user-pill-bg-color: rgba(0, 0, 0, 0.1);

// informational plinth
$info-plinth-bg-color: #f7f7f7;
$info-plinth-fg-color: #888;
Expand Down Expand Up @@ -117,10 +115,12 @@ $settings-subsection-fg-color: #61708b;

$rte-bg-color: #e9e9e9;
$rte-code-bg-color: rgba(0, 0, 0, 0.04);
$rte-room-pill-color: #aaa;

$header-panel-text-primary-color: #91a1c0;

$pill-bg-color: #aaa;
$pill-hover-bg-color: #ccc;

$topleftmenu-color: #212121;
$roomheader-bg-color: $primary-bg-color;
$roomheader-addroom-bg-color: #91a1c0;
Expand Down
3 changes: 2 additions & 1 deletion res/themes/light-custom/css/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,6 @@ $eventbubble-reply-color: var(--eventbubble-reply-color, $eventbubble-reply-colo
$reaction-row-button-selected-bg-color: var(--reaction-row-button-selected-bg-color, $reaction-row-button-selected-bg-color);

$menu-selected-color: var(--menu-selected-color, $menu-selected-color);
$other-user-pill-bg-color: var(--other-user-pill-bg-color, $other-user-pill-bg-color);
$pill-bg-color: var(--other-user-pill-bg-color, $pill-bg-color);
$pill-hover-bg-color: var(--other-user-pill-bg-color, $pill-hover-bg-color);
$icon-button-color: var(--icon-button-color, $icon-button-color);
4 changes: 2 additions & 2 deletions res/themes/light/css/_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ $roomheader-addroom-fg-color: #5c6470;

// Rich-text-editor
// ********************
$rte-room-pill-color: #aaa;
$other-user-pill-bg-color: rgba(0, 0, 0, 0.1);
$pill-bg-color: #aaa;
$pill-hover-bg-color: #ccc;
$rte-bg-color: #e9e9e9;
$rte-code-bg-color: rgba(0, 0, 0, 0.04);
// ********************
Expand Down
Loading