https://discord.gg/botpress logo
Load custom CSS before the default
# 🤝help
c
Hello i have trouble when i try to use custom CSS in bot setup for own styles for buble button -change icon, add some animation, size and so on. During load it show up for around 0,5s default styles, and after this it replace with my own styles from stylesheet. Is there someways to how load first custom stylesheet before default styles? Or atleas showup bubble icon after CSS are loaded completely? This is the part of code ****:root ..... * This i need to load first*
p
I'm not sure I understand what the is currently in your theme css section? But have you tried combining the default and your custom styles so it all loads at once?
c
Well i think default styles/templates is always loaded, i am not able to disable it (atleast i dont know it is possible) i also have some custom CSS that replace chat icon and do some animation + little change possition of whole bubble chat icon. But my custom styles are loaded later then default, to for 0,5-1s it load default styles and then my custom styles and replace it, this leading to move of that chat bubble for a second. Setup is visible on picture https://cdn.discordapp.com/attachments/1366721620370264115/1367035492083957760/image.png?ex=68131e83&is=6811cd03&hm=e30ff6ecf9127b602fdc2e93cead6683e33ff3d4eeb6aa215a2dbe3d2050bb9d&
p
Right, thank you for clarifying. Just to confirm, the problem is visible on your actual website or on the studio/test version? Could you also send me your custom css so I can test it on my own bots?
c
You can make test there - https://www.qunacare.cz/testbot Custom CSS are https://codeshare.io/Gk1yM5 But loading that external SVG icon probably wont work on different domain (at least in my case icon load only on qunacare.cz site but not in botpress workspace.)
p
Are you still facing the style change after 0.5/1s? When I loaded your website, it loaded with the custom style after 0.5s but there was never a previous default style shown.
c
It seems to me still same, i made record on Loom - https://www.loom.com/share/a08b12525f8b43379890338697fb0cf5 Key moment of loading is between 6-8s of recording, where icon appear with default styles and then is replaced with custom styles.
p
I see what you're referring to, but I don't think it's a code issue. Have you tested it from a different location or computer?
c
Sure i tried it in several broswer, problem is only for first load, but every new visitor will have first load. Is there some ways how to disable / remove default styles for webchat / bubble?
2 Views