Closed wkashdan closed 6 months ago
Deployed Styleguide and Lab.Notes
Thanks @wkashdan Do you mind adding the screenshot and the context you provided me over DM? Specifically, I think you mentioned this happens on scroll, which is unexpected.
The fix you're removing (https://github.com/square/maker/pull/561) corrects text alignment in the Editor and Published sites so I'm not sure if we can remove it.
I think the fix is actually fine because it only runs on mounted
and updated
. I think this begs the question: why is the Vue subtree getting "updated" on scroll? I think even if we remove the getComputedStyle
here, unless we prevent the "updates" happening on scroll, we'll always have unexpected perf issues.
Closing, as @privatenumber recommended not going with this approach
Describe the problem this PR addresses
The text element calls
getComputedStyle
which is very inefficient sometimes causing many milliseconds of lag and layout recalculations.Describe the changes in this PR
This PR removes calculating the computed text alignment. This means the padding fix will only be set when text alignment is directly set on the element and has letter spacing (whether inherited or not).