Skip to content

Commit 30b0214

Browse files
committed
fix: stop rendering inherited styles in css preview (#4478)
Huge amount of css variables adds something like 8k of dom elements to highlighted css preview. Here as fast fix killed inherited styles so at least only root will lag and everything else will not get performance hit.
1 parent 26715b5 commit 30b0214

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

apps/builder/app/builder/features/navigator/css-preview.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const getCssText = (
3232
instanceId: string
3333
) => {
3434
const sourceStyles: StyleMap = new Map();
35-
const inheritedStyles: StyleMap = new Map();
3635
const cascadedStyles: StyleMap = new Map();
3736
const presetStyles: StyleMap = new Map();
3837

@@ -55,8 +54,6 @@ const getCssText = (
5554
if (group) {
5655
if (styleDecl.source.instanceId === instanceId) {
5756
group.set(property, styleDecl.cascadedValue);
58-
} else {
59-
inheritedStyles.set(property, styleDecl.cascadedValue);
6057
}
6158
}
6259
}
@@ -73,7 +70,6 @@ const getCssText = (
7370

7471
add("Style Sources", sourceStyles);
7572
add("Cascaded", cascadedStyles);
76-
add("Inherited", inheritedStyles);
7773
add("Preset", presetStyles);
7874

7975
return result.join("\n");

0 commit comments

Comments
 (0)