The table contents don’t resize after changing the Size
Content in BrowserFrame does not comply with the dark theme. The background is dark but the letter remains black. I used the contents from the local HTML file.
Please advise,
Thanks
Table or DataGrid? In my case, Table changes its size. DataGrid doesn’t change its size by design, because it has separate settings like rowHeight, headerRowHeigh so the theme cannot change them.
It seems that this file has own color settings. Make sure that local HTML file has the following color definition: color: var(--text-main-color);
It appears that iframe cannot see styles prom parent, as a result setting color: var(--text-main-color); has no effect. There is no easy way to get styles from the parent other than using JS code like:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
</style>
<script>
document.addEventListener("DOMContentLoaded", function (event) {
const parentElement = window.parent.document.getElementsByClassName("v-app")[0];
const color = getComputedStyle(parentElement, null)["color"];
window.document.body.style.color = color;
});
</script>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
As I was saying, iframe cannot see styles from parent because it is kind of separate page, so you need to implement styles for every element that is used in iframe according to your needs. This is not related to Jmix itself, it’s common practice when working with iframes.