botfront / rasa-webchat

A feature-rich chat widget for Rasa and Botfront
https://botfront.io/rasa
Apache License 2.0
948 stars 496 forks source link

How can I change css? #429

Closed andrebernardezbrana closed 2 years ago

andrebernardezbrana commented 2 years ago

I am using the widget in React and would like to customize it, colors, sizes, etc.

If I make a css class like .rw-header it is overwritting by the default class with the same name.

¿?

Rikkokiri commented 2 years ago

If you simply want to change the banner color etc. there are some properties available for customizing that.. (see src/index.hs:

defaultHighlightCss: PropTypes.string,
defaultHighlightAnimation: PropTypes.string,
mainColor: PropTypes.string,
conversationBackgroundColor: PropTypes.string,
userTextColor: PropTypes.string,
userBackgroundColor: PropTypes.string,
assistTextColor: PropTypes.string,
assistBackgoundColor: PropTypes.string

These are set the same way as for example socketUrl (see README or ask if you are unsure).

Or, as you mentioned, you can use the classnames listed in the README (or ones you find exploring widget code using browser dev tools) to define css rules.

I don't know what your background and comfort level with CSS is, so I'm sorry if this already obvious to you:

Again, sorry if all this was obvious to you - and if not, feel free to ask more questions! (Also: I'm not a maintainer on this project, I've just worked with it a lot.)

andrebernardezbrana commented 2 years ago

Thank you very much, you have helped me a lot and I appreciate all the explanation. I think I already have it.

Thanks😁

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.