Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Trix dynamic styles in the head #1133

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Keep Trix dynamic styles in the head #1133

merged 2 commits into from
Jan 22, 2024

Commits on Jan 18, 2024

  1. Keep Trix dynamic styles in the head

    Trix dynamically adds some styles to the head that we need to keep around.
    Otherwise, the editor will not render correctly after a page change.
    
    We can detect those styles because Trix also adds a `data-tag-name`
    attribute to the style elements it adds.
    
    Ideally, we would move those styles to Trix's CSS file, but for now we'll
    just skip removing them. We don't want to force everyone upgrading to
    Turbo v8 to also upgrade Trix.
    
    Ref:
    
    - https://github.com/basecamp/trix/blob/06d8b1db5fb682d007c5ca041884f6297674c8b7/src/trix/elements/trix_editor_element.js#L108-L162
    - https://github.com/basecamp/trix/blob/06d8b1db5fb682d007c5ca041884f6297674c8b7/src/trix/core/helpers/custom_elements.js#L11
    afcapel committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    8fbb573 View commit details
    Browse the repository at this point in the history
  2. Use data-turbo-permanent to keep styles around

    And use it to keep the progress bar styles around, instead of relying
    on an id.
    afcapel committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    cfd6edb View commit details
    Browse the repository at this point in the history