Skip to content

Commit f06846d

Browse files
fix: clean up CSS build output (#3072)
BREAKING CHANGE: Importing styles from `stream-chat-react/dist/css/v2/*` would no longer work, import from `stream-chat-react/dist/css/*` instead.
1 parent 30a516a commit f06846d

11 files changed

Lines changed: 43 additions & 86 deletions

β€Žpackage.jsonβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
"@eslint/js": "^9.39.4",
142142
"@semantic-release/changelog": "^6.0.3",
143143
"@semantic-release/git": "^10.0.1",
144-
"@stream-io/stream-chat-css": "^5.16.1",
145144
"@testing-library/dom": "^10.4.0",
146145
"@testing-library/jest-dom": "^6.6.3",
147146
"@testing-library/react": "^16.2.0",
@@ -186,8 +185,8 @@
186185
},
187186
"scripts": {
188187
"clean": "rm -rf dist",
189-
"build": "yarn clean && concurrently './scripts/copy-css.sh' 'yarn build-translations' 'vite build' 'tsc --project tsconfig.lib.json' 'yarn build-styling'",
190-
"build-styling": "sass src/styling/index.scss dist/css/index.css",
188+
"build": "yarn clean && concurrently 'yarn build-translations' 'vite build' 'tsc --project tsconfig.lib.json' 'yarn build-styling'",
189+
"build-styling": "sass src/styling/index.scss:dist/css/index.css src/styling/_emoji-replacement.scss:dist/css/emoji-replacement.css; cp -r src/styling/assets dist/css/assets",
191190
"build-translations": "i18next-cli extract",
192191
"coverage": "vitest run --coverage",
193192
"lint": "yarn prettier --list-different && yarn eslint && yarn validate-translations",
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
$emoji-flag-unicode-range: U+1F1E6-1F1FF;
2+
3+
/* png based woff for most browsers */
4+
@font-face {
5+
font-family: ReplaceFlagEmojiPNG;
6+
src: url('assets/NotoColorEmoji-flags.woff2') format('woff2');
7+
/* using the unicode-range attribute to limit the reach of the Flag Emoji web font to only flags */
8+
unicode-range: $emoji-flag-unicode-range;
9+
}
10+
11+
/* svg based for firefox */
12+
@font-face {
13+
font-family: ReplaceFlagEmojiSVG;
14+
src: url('assets/EmojiOneColor.woff2') format('woff2');
15+
unicode-range: $emoji-flag-unicode-range;
16+
}
17+
18+
.str-chat--windows-flags {
19+
// TODO: consider adding the rule for reactions (list & selector) if we ever decide to make them use native emojis
20+
.str-chat__textarea__textarea, // class name from theme v1
21+
.str-chat__message-textarea,
22+
.str-chat__message-text-inner *,
23+
.str-chat__emoji-item--entity,
24+
.emoji-mart-emoji-native * {
25+
font-family: ReplaceFlagEmojiPNG, var(--str-chat__font-family), sans-serif;
26+
font-display: swap;
27+
}
28+
}
29+
30+
@-moz-document url-prefix('') {
31+
.str-chat--windows-flags {
32+
.str-chat__textarea__textarea, // class name from theme v1
33+
.str-chat__message-textarea,
34+
.str-chat__message-text-inner *,
35+
.str-chat__emoji-item--entity,
36+
.emoji-mart-emoji-native * {
37+
font-family: ReplaceFlagEmojiSVG, var(--str-chat__font-family), sans-serif;
38+
font-display: swap;
39+
}
40+
}
41+
}

β€Žsrc/styling/_variables.scssβ€Ž

Lines changed: 0 additions & 2 deletions
This file was deleted.
-8.6 KB
Binary file not shown.

β€Žsrc/styling/assets/icons/stream-chat-icons.svgβ€Ž

Lines changed: 0 additions & 50 deletions
This file was deleted.
-8.4 KB
Binary file not shown.
-4.88 KB
Binary file not shown.
-4.05 KB
Binary file not shown.

β€Žsrc/styling/icons.scssβ€Ž

Lines changed: 0 additions & 25 deletions
This file was deleted.

β€Žsrc/styling/index.scssβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
@use 'palette-variables';
77
@use './variables.css';
88
@use 'base';
9-
@use 'icons';
109
@use 'fonts';
1110

1211
// alias is necessary to allow sass create namespaces with different names (and not same name styling)

0 commit comments

Comments
Β (0)