Add formatting buttons for WysisygComposer
This commit is contained in:
parent
b336e18eae
commit
01858354f8
14 changed files with 271 additions and 24 deletions
|
@ -295,6 +295,7 @@
|
|||
@import "./views/rooms/_TopUnreadMessagesBar.pcss";
|
||||
@import "./views/rooms/_VoiceRecordComposerTile.pcss";
|
||||
@import "./views/rooms/_WhoIsTypingTile.pcss";
|
||||
@import "./views/rooms/wysiwyg_composer/_FormattingButtons.pcss";
|
||||
@import "./views/rooms/wysiwyg_composer/_WysiwygComposer.pcss";
|
||||
@import "./views/settings/_AvatarSetting.pcss";
|
||||
@import "./views/settings/_CrossSigningPanel.pcss";
|
||||
|
|
|
@ -233,6 +233,17 @@ limitations under the License.
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
The wysisyg composer increase the size of the MessageComposer. We temporary move the buttons
|
||||
Soon the dom structure of the MessageComposer will change with the next evolution of the wysiwyg composer
|
||||
and this workaround will disappear
|
||||
*/
|
||||
.mx_MessageComposer_wysiwyg {
|
||||
.mx_MessageComposer_e2eIcon.mx_E2EIcon,.mx_MessageComposer_button, .mx_MessageComposer_sendMessage {
|
||||
margin-top: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.mx_MessageComposer_upload::before {
|
||||
mask-image: url('$(res)/img/element-icons/room/composer/attach.svg');
|
||||
}
|
||||
|
|
114
res/css/views/rooms/wysiwyg_composer/_FormattingButtons.pcss
Normal file
114
res/css/views/rooms/wysiwyg_composer/_FormattingButtons.pcss
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
||||
|
||||
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_FormattingButtons {
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
|
||||
.mx_FormattingButtons_Button {
|
||||
--size: 26px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
height: var(--size);
|
||||
line-height: var(--size);
|
||||
width: auto;
|
||||
padding-left: var(--size);
|
||||
margin-right: 6px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
|
||||
&:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 7px;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
background-color: $icon-button-color;
|
||||
mask-repeat: no-repeat;
|
||||
mask-size: contain;
|
||||
mask-position: center;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 0;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&::after {
|
||||
background: rgba($secondary-content, 0.1);
|
||||
}
|
||||
|
||||
&::before {
|
||||
background-color: $secondary-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mx_FormattingButtons_active {
|
||||
&::after {
|
||||
background: rgba($accent, 0.1);
|
||||
}
|
||||
|
||||
&::before {
|
||||
background-color: $accent;
|
||||
}
|
||||
}
|
||||
|
||||
.mx_FormattingButtons_Button_bold::before {
|
||||
mask-image: url('$(res)/img/element-icons/room/composer/bold.svg');
|
||||
}
|
||||
|
||||
.mx_FormattingButtons_Button_italic::before {
|
||||
mask-image: url('$(res)/img/element-icons/room/composer/italic.svg');
|
||||
}
|
||||
|
||||
.mx_FormattingButtons_Button_underline::before {
|
||||
mask-image: url('$(res)/img/element-icons/room/composer/underline.svg');
|
||||
}
|
||||
|
||||
.mx_FormattingButtons_Button_strike-through::before {
|
||||
mask-image: url('$(res)/img/element-icons/room/composer/strike_through.svg');
|
||||
}
|
||||
}
|
||||
|
||||
.mx_FormattingButtons_Tooltip {
|
||||
padding: 0 2px 0 2px;
|
||||
|
||||
.mx_FormattingButtons_Tooltip_KeyboardShortcut {
|
||||
color: $tertiary-content;
|
||||
|
||||
kbd {
|
||||
margin-top: 2px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
text-transform: capitalize;
|
||||
font-size: 12px;
|
||||
font-family: Inter, sans-serif;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue