element-hq / hydrogen-web

Lightweight matrix client with legacy and mobile browser support
Apache License 2.0
632 stars 123 forks source link

In the element theme, the font-size in :root should be scoped to hydrogen #482

Open svieujot opened 3 years ago

svieujot commented 3 years ago

To avoid bleeding outsize of the hydrogen container when hydrogen is embedded in a web page.

https://github.com/vector-im/hydrogen-web/blob/25d0cbe9a2120169db2e00942d216b31afbcf021/src/platform/web/ui/css/themes/element/theme.css#L21

bwindels commented 3 years ago

We could move this line to index.html so it is not included for embedded cases, but I wonder if this will effectively require to move away from rem units in CSS, as they couple the root font-size to the scale factor of the hydrogen. They don't seem ideal for the embedded use case, as they prevent other sections on the page from using rem units as well. Instead, we could use: