Skip to content

Commit bcaf1f6

Browse files
fix: decouple modern-normalize from the SDK (#3180)
### 🎯 Goal Decouple `modern-normalize` from the SDK and provide a minimal normalization rules. This change will require a documentation changes suggesting integrators to consider using `modern-normalize` within their projects. Continuation of the issue #3134.
1 parent 5259c17 commit bcaf1f6

9 files changed

Lines changed: 32 additions & 14 deletions

File tree

β€Žexamples/vite/package.jsonβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"human-id": "^4.1.3",
13+
"modern-normalize": "^3.0.1",
1314
"react": "link:../../node_modules/react",
1415
"react-dom": "link:../../node_modules/react-dom",
1516
"stream-chat-react": "link:../../"

β€Žexamples/vite/src/index.scssβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
@layer stream-new, stream-new-plugins, stream-overrides, stream-app-overrides;
1+
@layer modern-normalize, stream-new, stream-new-plugins, stream-overrides, stream-app-overrides;
22

33
// Geist font is preloaded in index.html to avoid layout shift on mount.
44
//@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap');
55

66
// v3 CSS import
7+
@import url('modern-normalize') layer(modern-normalize);
78
@import url('stream-chat-react/dist/css/index.css') layer(stream-new);
89
@import url('./AppSettings/AppSettings.scss') layer(stream-app-overrides);
910
@import url('./CustomMessageActions/CustomMessageActions.scss')

β€Žpackage.jsonβ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"lodash.mergewith": "^4.6.2",
8080
"lodash.throttle": "^4.1.1",
8181
"lodash.uniqby": "^4.7.0",
82-
"modern-normalize": "^3.0.1",
8382
"nanoid": "^3.3.4",
8483
"react-dropzone": "^14.2.3",
8584
"react-fast-compare": "^3.2.2",
@@ -104,7 +103,8 @@
104103
"emoji-mart": "^5.4.0",
105104
"react": "^19.0.0 || ^18.0.0 || ^17.0.0",
106105
"react-dom": "^19.0.0 || ^18.0.0 || ^17.0.0",
107-
"stream-chat": "^9.43.0"
106+
"stream-chat": "^9.43.0",
107+
"modern-normalize": "^3.0.1"
108108
},
109109
"peerDependenciesMeta": {
110110
"@breezystack/lamejs": {
@@ -118,6 +118,9 @@
118118
},
119119
"@emoji-mart/react": {
120120
"optional": true
121+
},
122+
"modern-normalize": {
123+
"optional": true
121124
}
122125
},
123126
"files": [

β€Žsrc/components/MessageComposer/styling/MessageComposer.scssβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@
202202
textarea {
203203
background: transparent;
204204
color: var(--str-chat__input-text-default);
205+
font: var(--str-chat__font-body-default);
205206
resize: none;
206207
border: none;
207208
box-shadow: none;
208209
outline: none;
209210
width: 100%;
210-
font-size: var(--str-chat__typography-font-size-md);
211211
scrollbar-width: none;
212212
}
213213
}

β€Žsrc/components/Search/styling/Search.scssβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
border: none;
3939
background: none;
4040
width: 100%;
41-
font-size: inherit;
42-
line-height: inherit;
41+
font: inherit;
4342

4443
&:focus {
4544
outline: none;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use './css-normalize/minimal';
2+
13
.str-chat {
24
--str-chat__focus-outline-color: var(--str-chat__border-utility-focused);
35
--str-chat__focus-outline: 2px solid var(--str-chat__focus-outline-color);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@layer minimal-normalize {
2+
.str-chat {
3+
*,
4+
::before,
5+
::after {
6+
box-sizing: border-box;
7+
}
8+
9+
button,
10+
input,
11+
optgroup,
12+
select,
13+
textarea {
14+
font-family: inherit;
15+
font-size: 100%;
16+
line-height: 1.15;
17+
margin: 0;
18+
}
19+
}
20+
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,3 @@
5555
@use '../components/Tooltip/styling' as Tooltip;
5656
@use '../components/TypingIndicator/styling' as TypingIndicator;
5757
@use '../components/VideoPlayer/styling' as VideoPlayer;
58-
59-
// Layers have to be kept the last
60-
@import 'modern-normalize' layer(css-reset);

β€Žyarn.lockβ€Ž

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6047,11 +6047,6 @@ minizlib@^3.0.1, minizlib@^3.1.0:
60476047
dependencies:
60486048
minipass "^7.1.2"
60496049

6050-
modern-normalize@^3.0.1:
6051-
version "3.0.1"
6052-
resolved "https://registry.yarnpkg.com/modern-normalize/-/modern-normalize-3.0.1.tgz#4e2dc8da282ab854d53d70d7155a8027f59fbed6"
6053-
integrity sha512-VqlMdYi59Uch6fnUPxnpijWUQe+TW6zeWCvyr6Mb7JibheHzSuAAoJi2c71ZwIaWKpECpGpYHoaaBp6rBRr+/g==
6054-
60556050
moment-timezone@^0.5.43:
60566051
version "0.5.43"
60576052
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790"

0 commit comments

Comments
Β (0)