Various fixes for different font sizes (#1352)
This commit is contained in:
parent
cd742b6805
commit
92a3d8126a
@ -93,9 +93,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.emoji {
|
.emoji {
|
||||||
width: 1.125rem !important;
|
width: calc(1.125 * var(--message-text-size, 1rem)) !important;
|
||||||
height: 1.125rem !important;
|
height: calc(1.125 * var(--message-text-size, 1rem)) !important;
|
||||||
vertical-align: -4px !important;
|
vertical-align: text-bottom !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { GlobalActions } from '../../../global/types';
|
|||||||
import { SettingsScreens, ISettings } from '../../../types';
|
import { SettingsScreens, ISettings } from '../../../types';
|
||||||
import { ApiSticker, ApiStickerSet } from '../../../api/types';
|
import { ApiSticker, ApiStickerSet } from '../../../api/types';
|
||||||
|
|
||||||
import { IS_MAC_OS, IS_TOUCH_ENV } from '../../../util/environment';
|
import { IS_IOS, IS_MAC_OS, IS_TOUCH_ENV } from '../../../util/environment';
|
||||||
import { pick } from '../../../util/iteratees';
|
import { pick } from '../../../util/iteratees';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import useFlag from '../../../hooks/useFlag';
|
import useFlag from '../../../hooks/useFlag';
|
||||||
@ -111,6 +111,9 @@ const SettingsGeneral: FC<OwnProps & StateProps & DispatchProps> = ({
|
|||||||
}, [setSettingOption]);
|
}, [setSettingOption]);
|
||||||
|
|
||||||
const handleMessageTextSizeChange = useCallback((newSize: number) => {
|
const handleMessageTextSizeChange = useCallback((newSize: number) => {
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--composer-text-size', `${Math.max(newSize, IS_IOS ? 16 : 15)}px`,
|
||||||
|
);
|
||||||
document.documentElement.style.setProperty('--message-text-size', `${newSize}px`);
|
document.documentElement.style.setProperty('--message-text-size', `${newSize}px`);
|
||||||
|
|
||||||
setSettingOption({ messageTextSize: newSize });
|
setSettingOption({ messageTextSize: newSize });
|
||||||
|
|||||||
@ -153,16 +153,23 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: var(--pattern-color);
|
background: var(--pattern-color);
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 0.9375rem;
|
font-size: calc(var(--message-text-size, 1rem) - .0625rem);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1.5rem;
|
line-height: 1.75;
|
||||||
padding: 0 .5rem;
|
padding: 0 .5rem;
|
||||||
border-radius: 0.75rem;
|
border-radius: 2rem;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
|
|
||||||
body.is-ios &,
|
body.is-ios &,
|
||||||
body.is-macos & {
|
body.is-macos & {
|
||||||
font-size: .875rem;
|
font-size: calc(var(--message-text-size, 1rem) - .125rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji-small {
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
width: calc(1.25 * var(--message-text-size, 1rem));
|
||||||
|
height: calc(1.25 * var(--message-text-size, 1rem));
|
||||||
|
background-size: calc(1.25 * var(--message-text-size, 1rem));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
--border-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
> .Button {
|
> .Button {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: .5rem;
|
margin-left: .5rem;
|
||||||
@ -170,6 +174,7 @@
|
|||||||
width: .5625rem;
|
width: .5625rem;
|
||||||
height: 1.25rem;
|
height: 1.25rem;
|
||||||
transition: opacity 200ms;
|
transition: opacity 200ms;
|
||||||
|
font-size: 1rem !important;
|
||||||
|
|
||||||
.corner {
|
.corner {
|
||||||
fill: var(--color-background);
|
fill: var(--color-background);
|
||||||
@ -263,13 +268,13 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
padding-top: calc(1rem - var(--border-width));
|
padding: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2 - var(--border-width, 0) * 2) calc(.9rem - var(--border-width));
|
||||||
padding-bottom: calc(1rem - var(--border-width));
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 1.375rem;
|
line-height: 1.375;
|
||||||
font-family: Roboto, -apple-system, "Apple Color Emoji", "Helvetica Neue", sans-serif;
|
font-family: Roboto, -apple-system, "Apple Color Emoji", "Helvetica Neue", sans-serif;
|
||||||
unicode-bidi: plaintext;
|
unicode-bidi: plaintext;
|
||||||
text-align: initial;
|
text-align: initial;
|
||||||
|
font-size: var(--composer-text-size, 1rem);
|
||||||
|
|
||||||
body.is-ios &,
|
body.is-ios &,
|
||||||
body.is-macos & {
|
body.is-macos & {
|
||||||
@ -295,23 +300,14 @@
|
|||||||
.forced-placeholder,
|
.forced-placeholder,
|
||||||
.placeholder-text {
|
.placeholder-text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: .9375rem;
|
|
||||||
color: var(--color-placeholders);
|
color: var(--color-placeholders);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
unicode-bidi: plaintext;
|
unicode-bidi: plaintext;
|
||||||
text-align: initial;
|
text-align: initial;
|
||||||
|
line-height: 1.3125;
|
||||||
body.is-macos & {
|
font-size: var(--composer-text-size, 1rem);
|
||||||
bottom: 1rem;
|
top: calc((3.25rem - var(--composer-text-size, 1rem) * 1.375) / 2);
|
||||||
}
|
bottom: auto;
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
bottom: .625rem;
|
|
||||||
|
|
||||||
body.is-ios & {
|
|
||||||
bottom: .6875rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.forced-placeholder {
|
.forced-placeholder {
|
||||||
@ -362,15 +358,13 @@
|
|||||||
min-height: 3.5rem;
|
min-height: 3.5rem;
|
||||||
max-height: 26rem;
|
max-height: 26rem;
|
||||||
line-height: 1.3125;
|
line-height: 1.3125;
|
||||||
padding-top: calc(1.15625rem - var(--border-width));
|
padding: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;
|
||||||
padding-bottom: calc(1.15625rem - var(--border-width));
|
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
height: 2.875rem;
|
height: 2.875rem;
|
||||||
min-height: 2.875rem;
|
min-height: 2.875rem;
|
||||||
max-height: 16rem;
|
max-height: 16rem;
|
||||||
padding-top: calc(0.84375rem - var(--border-width));
|
padding: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2) 0;
|
||||||
padding-bottom: calc(0.84375rem - var(--border-width));
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,6 +375,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.forced-placeholder,
|
||||||
|
.placeholder-text {
|
||||||
|
top: calc((3.5rem - var(--composer-text-size, 1rem) * 1.3125) / 2);
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
top: calc((2.875rem - var(--composer-text-size, 1rem) * 1.3125) / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:not(:only-child) {
|
&:not(:only-child) {
|
||||||
.form-control {
|
.form-control {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|||||||
@ -105,7 +105,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.site-description {
|
.site-description {
|
||||||
line-height: 1rem;
|
line-height: 1.25;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
|
||||||
body.is-ios & {
|
body.is-ios & {
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
font-size: 0.875rem;
|
font-size: calc(var(--message-text-size, 1rem) - .125rem);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1.25rem;
|
line-height: 1.25rem;
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
@ -219,6 +219,7 @@
|
|||||||
bottom: -.0875rem;
|
bottom: -.0875rem;
|
||||||
width: .5625rem;
|
width: .5625rem;
|
||||||
height: 1.125rem;
|
height: 1.125rem;
|
||||||
|
font-size: 1rem !important;
|
||||||
|
|
||||||
.corner {
|
.corner {
|
||||||
fill: var(--background-color);
|
fill: var(--background-color);
|
||||||
@ -311,6 +312,7 @@
|
|||||||
|
|
||||||
&:not(.custom-shape) .text-content .emoji {
|
&:not(.custom-shape) .text-content .emoji {
|
||||||
width: calc(1.25 * var(--message-text-size, 1rem));
|
width: calc(1.25 * var(--message-text-size, 1rem));
|
||||||
|
height: calc(1.25 * var(--message-text-size, 1rem));
|
||||||
background-size: calc(1.25 * var(--message-text-size, 1rem));
|
background-size: calc(1.25 * var(--message-text-size, 1rem));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -689,4 +691,5 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 1px 2px;
|
padding: 1px 2px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
font-size: calc(var(--message-text-size, 1rem) - 0.0625rem);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,9 @@ addReducer('init', (global) => {
|
|||||||
|
|
||||||
setLanguage(language, undefined, true);
|
setLanguage(language, undefined, true);
|
||||||
|
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--composer-text-size', `${Math.max(messageTextSize, IS_IOS ? 16 : 15)}px`,
|
||||||
|
);
|
||||||
document.documentElement.style.setProperty('--message-text-size', `${messageTextSize}px`);
|
document.documentElement.style.setProperty('--message-text-size', `${messageTextSize}px`);
|
||||||
document.body.classList.add('initial');
|
document.body.classList.add('initial');
|
||||||
document.body.classList.add(`animation-level-${animationLevel}`);
|
document.body.classList.add(`animation-level-${animationLevel}`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user