Skip to content

use classes instead inline styles to change elements behaviour #240

@remort

Description

@remort

Since I set up CSP (Content Security Policy) on a website that uses selectric for an customizable search form, browser throws errors about blocking inline styles due to CSP policy. At the same time everything seems to be working fine (that's strange).

I tried to exclude CSP checks on backend for this particular view which uses this form with selectric. But it doesn't work since selectric starts working after view is loaded (and CSP exceptions applied to the view).

All I can is totally disable CSP for the view. But it's a security no-no.

Couldn't to find if selectric is able to change HTML elements behaviour by adding/removing CSS classes instead of styles directly. And... it seems that working with classes is a more progressive/safe/modern way to work with HTML elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions