jQuery-Selectric icon indicating copy to clipboard operation
jQuery-Selectric copied to clipboard

use classes instead inline styles to change elements behaviour

Open remort opened this issue 6 years ago • 0 comments

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.

remort avatar Feb 14 '19 09:02 remort