Skip to content

Commit

Permalink
Build emoji-replacement separately
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Nov 1, 2023
1 parent 7a4aa81 commit d5bc512
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 43 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"generate-docs": "ts-node scripts/generate-docs.ts",
"replace-docs": "ts-node scripts/replacer.ts",
"copy": "cp -R src/v2/styles/* dist/v2/scss",
"compile-to-css": "sass src/v2/styles/index.scss dist/v2/css/index.css --style compressed && sass src/v2/styles/index.layout.scss dist/v2/css/index.layout.css --style compressed",
"compile-to-css": "sass src/v2/styles/index.scss dist/v2/css/index.css --style compressed && sass src/v2/styles/index.layout.scss dist/v2/css/index.layout.css --style compressed && sass src/v2/styles/_emoji-replacement.scss dist/v2/css/emoji-replacement.css --style compressed",
"bundle-sass": "echo '\u001b[34mℹ\u001b[0m Compiling scss files to css bundle' && sass src/v1/index.scss dist/css/index.css --style compressed && echo '\u001b[32m✓\u001b[0m Finished bundling css'",
"copy-assets": "echo '\u001b[34mℹ\u001b[0m Copying assets to distributed directory' && cp -R src/assets dist/assets && echo '\u001b[32m✓\u001b[0m Finished copying assets'",
"copy-styles": "echo '\u001b[34mℹ\u001b[0m Copying scss files to distributed directory' && cp -R src/v1 dist/scss && echo '\u001b[32m✓\u001b[0m Finished copying styles'",
Expand Down
41 changes: 0 additions & 41 deletions src/v1/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,47 +105,6 @@
}
}

/* declare a font faces for our Emoji Replacement font, based on the default font used by Stream Chat React */

$emoji-flag-unicode-range: U+1F1E6-1F1FF;

/* png based woff for most browsers */
@font-face {
font-family: ReplaceFlagEmojiPNG;
src: url('#{$assetsPath}/NotoColorEmoji-flags.woff2') format('woff2');
/* using the unicode-range attribute to limit the reach of the Flag Emoji web font to only flags */
unicode-range: $emoji-flag-unicode-range;
}

/* svg based for firefox */
@font-face {
font-family: ReplaceFlagEmojiSVG;
src: url('#{$assetsPath}/EmojiOneColor.woff2') format('woff2');
unicode-range: $emoji-flag-unicode-range;
}

.str-chat--windows-flags {
.str-chat__textarea__textarea,
.str-chat__message-text-inner *,
.str-chat__emoji-item--entity,
.emoji-mart-emoji-native * {
font-family: ReplaceFlagEmojiPNG, var(--second-font), sans-serif;
font-display: swap;
}
}

@-moz-document url-prefix('') {
.str-chat--windows-flags {
.str-chat__textarea__textarea,
.str-chat__message-text-inner *,
.str-chat__emoji-item--entity,
.emoji-mart-emoji-native * {
font-family: ReplaceFlagEmojiSVG, var(--second-font), sans-serif;
font-display: swap;
}
}
}

.str-chat-channel-list {
float: left;
}
Expand Down
1 change: 0 additions & 1 deletion src/v2/styles/index.layout.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use 'base';
@use 'emoji-replacement';
@use 'global-layout-variables';

@use 'Avatar/Avatar-layout';
Expand Down

0 comments on commit d5bc512

Please sign in to comment.