mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-09 15:09:02 +00:00
emoji-sets: fix native emoji alignment
This commit is contained in:
parent
a824ba8856
commit
b8fdad91c3
10
repo/emoji-sets/client.css
Normal file
10
repo/emoji-sets/client.css
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* notion-enhancer: emoji sets
|
||||||
|
* (c) 2021 Arecsu
|
||||||
|
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
|
||||||
|
* (https://notion-enhancer.github.io/) under the MIT license
|
||||||
|
*/
|
||||||
|
|
||||||
|
[aria-label][role='image'][style*='Apple Color Emoji']:not([data-emoji-sets-unsupported]) {
|
||||||
|
margin-left: 2.5px !important;
|
||||||
|
}
|
@ -7,8 +7,8 @@
|
|||||||
export default async function ({ web, env }, db) {
|
export default async function ({ web, env }, db) {
|
||||||
const style = await db.get(['style']),
|
const style = await db.get(['style']),
|
||||||
// real emojis are used on macos instead of the twitter set
|
// real emojis are used on macos instead of the twitter set
|
||||||
nativeEmojiSelector = `[style*='"Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", EmojiSymbols']:not(data-emoji-sets-unsupported)`,
|
nativeEmojiSelector = `[aria-label][role="image"][style*="Apple Color Emoji"]:not([data-emoji-sets-unsupported])`,
|
||||||
imgEmojiSelector = '.notion-emoji:not(data-emoji-sets-unsupported)',
|
imgEmojiSelector = '.notion-emoji:not([data-emoji-sets-unsupported])',
|
||||||
imgEmojiOverlaySelector = `${imgEmojiSelector} + [src*="notion-emojis"]`;
|
imgEmojiOverlaySelector = `${imgEmojiSelector} + [src*="notion-emojis"]`;
|
||||||
|
|
||||||
await web.whenReady();
|
await web.whenReady();
|
||||||
@ -44,7 +44,6 @@ export default async function ({ web, env }, db) {
|
|||||||
$emoji.style.height = '1em';
|
$emoji.style.height = '1em';
|
||||||
$emoji.style.display = 'inline-block';
|
$emoji.style.display = 'inline-block';
|
||||||
$emoji.innerText = '';
|
$emoji.innerText = '';
|
||||||
await new Promise((res, rej) => requestAnimationFrame(res));
|
|
||||||
} else {
|
} else {
|
||||||
$emoji.dataset.emojiSetsUnsupported = true;
|
$emoji.dataset.emojiSetsUnsupported = true;
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,15 @@
|
|||||||
"js": {
|
"js": {
|
||||||
"client": ["client.mjs"]
|
"client": ["client.mjs"]
|
||||||
},
|
},
|
||||||
"css": {},
|
"css": {
|
||||||
|
"client": ["client.css"]
|
||||||
|
},
|
||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"key": "style",
|
"key": "style",
|
||||||
"label": "emoji style",
|
"label": "emoji style",
|
||||||
|
"tooltip": "**initial use may involve some lag and load-time for emojis until they have all been cached**",
|
||||||
"values": [
|
"values": [
|
||||||
"twitter",
|
"twitter",
|
||||||
"apple",
|
"apple",
|
||||||
|
Loading…
Reference in New Issue
Block a user