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

Remove inline styles that break plots in strict CSP setups #7109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Aug 18, 2024

  1. Remove inline styles that break plots in strict CSP setups

    Support strict Content Security Policies that don't allow unsafe inline
    styles by:
    * Removing add/deleteRelatedStyleRule from modebar and use event
      listeners to emulate the on hover behavior by setting style properties
      directly on the element, which is allowed in strict CSP environments.
    * Output the main/library-wide CSS rules that are inlined when the
      library loads into a static CSS file so that users can include it
      within their applications in an acceptable manner. This allows
      `addRelatedStyleRule` calls to fail without affecting functionality.
    * Provide a way to prevent `addRelatedStyleRule` from running when the
      static CSS file is already included in the app to prevent superfluous
      errors in console output.
    * Replace inline styles from "newplotlylogo" with attribute to set the
      fill color directly on the elements.
    
    Note: The `dist/plotly.css` file will need to be added to the release
    files.
    
    Fixes plotly#2355 Plotly uses inline CSS
    martian111 committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    46ea43c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c0503e2 View commit details
    Browse the repository at this point in the history