mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/css: work around chrome issues and add contain rules
This commit is contained in:
parent
f6b0b12a5b
commit
2a89f10589
6 changed files with 31 additions and 22 deletions
|
@ -147,6 +147,7 @@ pre, code {
|
||||||
input, textarea {
|
input, textarea {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
button, a.button {
|
button, a.button {
|
||||||
|
|
|
@ -58,7 +58,7 @@ div.emoji-picker {
|
||||||
}
|
}
|
||||||
|
|
||||||
div.emoji-list {
|
div.emoji-list {
|
||||||
overflow: scroll;
|
overflow-y: auto;
|
||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -124,27 +124,30 @@ export const EmojiPicker = ({ style, selected, onSelect, room, allowFreeform, cl
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="emoji-list">
|
<div className="emoji-list">
|
||||||
{emojis.map(group => {
|
{/* Chrome is dumb and doesn't allow scrolling without an inner div */}
|
||||||
if (!group?.length) {
|
<div className="emoji-list-inner">
|
||||||
return null
|
{emojis.map(group => {
|
||||||
}
|
if (!group?.length) {
|
||||||
const categoryID = group[0].c
|
return null
|
||||||
const customPack = customEmojiPacks.find(pack => pack.id === categoryID)
|
}
|
||||||
return <EmojiGroup
|
const categoryID = group[0].c
|
||||||
key={categoryID}
|
const customPack = customEmojiPacks.find(pack => pack.id === categoryID)
|
||||||
emojis={group}
|
return <EmojiGroup
|
||||||
categoryID={categoryID}
|
key={categoryID}
|
||||||
selected={selected}
|
emojis={group}
|
||||||
pack={customPack}
|
categoryID={categoryID}
|
||||||
isWatched={typeof categoryID === "string" && watchedEmojiPackKeys.includes(categoryID)}
|
selected={selected}
|
||||||
onSelect={onSelectWrapped}
|
pack={customPack}
|
||||||
setPreviewEmoji={setPreviewEmoji}
|
isWatched={typeof categoryID === "string" && watchedEmojiPackKeys.includes(categoryID)}
|
||||||
/>
|
onSelect={onSelectWrapped}
|
||||||
})}
|
setPreviewEmoji={setPreviewEmoji}
|
||||||
{allowFreeform && query && <button
|
/>
|
||||||
className="freeform-react"
|
})}
|
||||||
onClick={onClickFreeformReact}
|
{allowFreeform && query && <button
|
||||||
>React with "{query}"</button>}
|
className="freeform-react"
|
||||||
|
onClick={onClickFreeformReact}
|
||||||
|
>React with "{query}"</button>}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{previewEmoji ? <div className="emoji-preview">
|
{previewEmoji ? <div className="emoji-preview">
|
||||||
<div className="big-emoji">{renderEmoji(previewEmoji)}</div>
|
<div className="big-emoji">{renderEmoji(previewEmoji)}</div>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
div.room-list-wrapper {
|
div.room-list-wrapper {
|
||||||
|
contain: strict;
|
||||||
grid-area: roomlist;
|
grid-area: roomlist;
|
||||||
background: var(--room-list-background);
|
background: var(--room-list-background);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -32,6 +33,7 @@ div.room-entry {
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
contain-intrinsic-height: 3rem;
|
contain-intrinsic-height: 3rem;
|
||||||
content-visibility: auto;
|
content-visibility: auto;
|
||||||
|
contain: strict;
|
||||||
|
|
||||||
&:hover, &:focus {
|
&:hover, &:focus {
|
||||||
background-color: var(--room-list-entry-hover-color);
|
background-color: var(--room-list-entry-hover-color);
|
||||||
|
|
|
@ -10,4 +10,5 @@ div.room-view {
|
||||||
"autocomplete" 0
|
"autocomplete" 0
|
||||||
"input" auto
|
"input" auto
|
||||||
/ 1fr;
|
/ 1fr;
|
||||||
|
contain: strict;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ div.timeline-event {
|
||||||
"avatar gap sender sender" auto
|
"avatar gap sender sender" auto
|
||||||
"avatar gap content status" auto
|
"avatar gap content status" auto
|
||||||
/ 2.5rem .5rem 1fr 2rem;
|
/ 2.5rem .5rem 1fr 2rem;
|
||||||
|
contain: layout;
|
||||||
|
|
||||||
&.highlight {
|
&.highlight {
|
||||||
background-color: var(--timeline-highlight-bg-color);
|
background-color: var(--timeline-highlight-bg-color);
|
||||||
|
@ -73,6 +74,7 @@ div.timeline-event {
|
||||||
grid-area: content;
|
grid-area: content;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
|
contain: content;
|
||||||
}
|
}
|
||||||
|
|
||||||
> div.event-send-status {
|
> div.event-send-status {
|
||||||
|
|
Loading…
Add table
Reference in a new issue