diff --git a/css/emoji-mart.css b/css/emoji-mart.css index c8d28f9..40b33ee 100644 --- a/css/emoji-mart.css +++ b/css/emoji-mart.css @@ -4,6 +4,11 @@ line-height: 1.15; } +.emoji-mart-dark-bg{ + color: #fff !important; + background-color: #222 !important; +} + .emoji-mart { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; font-size: 16px; @@ -143,6 +148,10 @@ border-radius: 100%; } +.emoji-mart-category .emoji-mart-emoji-dark:hover:before{ + background-color: #444; +} + .emoji-mart-category-label { z-index: 2; position: relative; @@ -151,13 +160,17 @@ top: 0; } -.emoji-mart-category-label span { +.emoji-mart-category-label-span { display: block; width: 100%; font-weight: 500; padding: 5px 6px; - background-color: #fff; - background-color: rgba(255, 255, 255, .95); + background-color: rgb(255, 255, 255, 0.95); + color: #000; +} + +.emoji-mart-category-label-span-dark { + background-color: rgba(0, 0, 0, 0.95) !important; } .emoji-mart-category-list { diff --git a/src/components/category.js b/src/components/category.js index adf9a7f..ab67669 100644 --- a/src/components/category.js +++ b/src/components/category.js @@ -158,6 +158,7 @@ export default class Category extends React.Component { i18n, notFound, notFoundEmoji, + darkMode, } = this.props, emojis = this.getEmojis(), labelStyles = {}, @@ -174,10 +175,6 @@ export default class Category extends React.Component { labelStyles = { height: 28, } - - labelSpanStyles = { - position: 'absolute', - } } return ( @@ -193,7 +190,11 @@ export default class Category extends React.Component { className="emoji-mart-category-label" > @@ -209,7 +210,10 @@ export default class Category extends React.Component { (emoji.short_names && emoji.short_names.join('_')) || emoji } > - {NimbleEmoji({ emoji: emoji, data: this.data, ...emojiProps })} + {NimbleEmoji( + { emoji: emoji, data: this.data, ...emojiProps }, + darkMode, + )} ))} diff --git a/src/components/emoji/nimble-emoji.js b/src/components/emoji/nimble-emoji.js index 74d8b47..404d5ae 100644 --- a/src/components/emoji/nimble-emoji.js +++ b/src/components/emoji/nimble-emoji.js @@ -74,7 +74,7 @@ const _convertStyleToCSS = (style) => { return div.getAttribute('style') } -const NimbleEmoji = (props) => { +const NimbleEmoji = (props, darkMode) => { if (props.data.compressed) { uncompress(props.data) } @@ -97,7 +97,9 @@ const NimbleEmoji = (props) => { let { unified, custom, short_names, imageUrl } = data, style = {}, children = props.children, - className = 'emoji-mart-emoji', + className = darkMode + ? 'emoji-mart-emoji emoji-mart-emoji-dark' + : 'emoji-mart-emoji', nativeEmoji = unified && unifiedToNative(unified), // combine the emoji itself and all shortcodes into an accessible label label = [nativeEmoji] diff --git a/src/components/picker/nimble-picker.js b/src/components/picker/nimble-picker.js index 7873a4f..0d1c45c 100644 --- a/src/components/picker/nimble-picker.js +++ b/src/components/picker/nimble-picker.js @@ -504,6 +504,7 @@ export default class NimblePicker extends React.PureComponent { skinEmoji, notFound, notFoundEmoji, + darkMode, } = this.props, { skin } = this.state, width = perLine * (emojiSize + 12) + 12 + 2 + measureScrollbar() @@ -511,12 +512,13 @@ export default class NimblePicker extends React.PureComponent { return (
{ return ( {/* * Use a