Skip to content

Don't manipulate the Turbo Frame itself#19

Merged
leonvogt merged 2 commits into
mainfrom
18-highlighting-turbo-frames-could-break-layouts
Jun 9, 2024
Merged

Don't manipulate the Turbo Frame itself#19
leonvogt merged 2 commits into
mainfrom
18-highlighting-turbo-frames-could-break-layouts

Conversation

@leonvogt
Copy link
Copy Markdown
Owner

@leonvogt leonvogt commented Jun 3, 2024

closes #18

This PR introduces a new approach to highlighting Turbo Frames.
Instead of modifying the Turbo Frame itself, we add an additional div for each Turbo Frame and apply our styling to this div.
The added div will have a position: absolute; property and be placed on top of the Turbo Frames.

This change results in slightly decreased performance because more elements are appended to the DOM. However, it minimizes the risk of unwanted layout changes, which I believe justifies the performance impact.
If users with hundreds of Turbo Frames on a page notice a performance issue, we have solutions such as the Turbo Frame blacklist or page-specific option changes.

@leonvogt leonvogt linked an issue Jun 3, 2024 that may be closed by this pull request
@leonvogt leonvogt force-pushed the 18-highlighting-turbo-frames-could-break-layouts branch from 38dc555 to ccfba4d Compare June 4, 2024 20:32
@leonvogt leonvogt marked this pull request as draft June 5, 2024 15:01
@leonvogt leonvogt changed the title Draft: Don't manipulate the Turbo Frame itself Don't manipulate the Turbo Frame itself Jun 5, 2024
@leonvogt leonvogt force-pushed the 18-highlighting-turbo-frames-could-break-layouts branch from ccfba4d to 8b57ecb Compare June 9, 2024 11:51
@leonvogt leonvogt force-pushed the 18-highlighting-turbo-frames-could-break-layouts branch from 8b57ecb to b98f227 Compare June 9, 2024 12:11
@leonvogt leonvogt marked this pull request as ready for review June 9, 2024 12:28
@leonvogt leonvogt merged commit 43fdeb4 into main Jun 9, 2024
@leonvogt leonvogt deleted the 18-highlighting-turbo-frames-could-break-layouts branch June 9, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Highlighting Turbo Frames could break layouts

1 participant