-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(angular): allow customizing avatar, icon and loading indicator from CSS #291
Conversation
e4b1272
to
ce8f7fa
Compare
ce8f7fa
to
4eb1980
Compare
|
||
<SDKSpecific name="react"> | ||
|
||
TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to link the part of the React docs that show how to use custom icons, where can I find that?
} | ||
} | ||
|
||
// File type icons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File type icons are different from other icons because they contain more than one color, so we can't use them as font, instead we use the encoded SVG images
41eff7e
to
92ac206
Compare
92ac206
to
25b8e60
Compare
# [4.15.0](v4.14.0...v4.15.0) (2024-04-25) ### Bug Fixes * remove unnecessary selector specificity from font-family setting ([#292](#292)) ([04e110d](04e110d)) ### Features * **angular:** allow customizing avatar, icon and loading indicator from CSS ([#291](#291)) ([b4d1658](b4d1658)), closes [/github.com/GetStream/stream-video-js/blob/main/packages/styling/src/Icon/Icon-theme.scss#L16](https://github.com//github.com/GetStream/stream-video-js/blob/main/packages/styling/src/Icon/Icon-theme.scss/issues/L16)
🎉 This PR is included in version 4.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎯 Goal
Allow customizing avatar, icon and loading indicator components from CSS.
Corresponding GitHub issues:
It's only implemented for Angular, React can follow at it's own pace
🛠 Implementation details
This is a non-breaking change, the old CSS code remains, and can be used by React and Angular@4.
Avatar
The
--str-chat__avatar-size
variable allows customizing the avatar sizeIcon
Why use fonts for icons? I generated a custom font from the icons we use in chat UI components, there is one downside that I hate: the font needs to be manually regenerated when we want to add a new icon (which is not that often). However, as far as I know fonts provide the best flexibility for setting size and color properties of icons. It's also used by big libraries such as Google Material Icons so our integrators are probably familiar with the concept.
As a comparison: in video the icons are also customizable from CSS, but we use
mask-image
with encoded SVGs, the downside of that solution is that we have to explicitly provide bothheight
andwidth
, which causes problems if an integrator wants to use an icon with a different aspect-ratio than the built-in icon.Loading indicator
The
--str-chat__loading-indicator-size
allows setting avatar size from CSSI wasn't able to move the loading indicator SVG to CSS, I had troubles applying the color from the CSS variable to the stop color 🤷♀️
For the curious, here is the Angular upgrade guide with the breaking changes:
🎨 UI Changes
No UI changes (hopefully 😅)
Make sure to test with both Angular and React (with both
MessageList
andVirtualizedMessageList
components) SDKs