Feature: Add the possibility to set attributes on the style element #9

Closed
alinmateut wants to merge 1 commit from nonce into master
alinmateut commented 2023-06-14 18:42:43 +02:00 (Migrated from github.com)

I added the possibility to set attributes on the <style> element. This is useful especially when you want to set Content-Security-Policy "default-src 'none'; style-src 'self' 'nonce-randomNonce'", since a nonce attribute needs to be added on the <style> element before it's insertion in the DOM.

I added the possibility to set attributes on the `<style>` element. This is useful especially when you want to set Content-Security-Policy `"default-src 'none'; style-src 'self' 'nonce-randomNonce'"`, since a `nonce` attribute needs to be added on the `<style>` element before it's insertion in the DOM.
marijnh commented 2023-06-15 09:57:45 +02:00 (Migrated from github.com)

It seems odd and potentially dangerous to have an option that only takes effect when there's no support for adopted style sheets. It doesn't look like new CSSStyleSheet supports this kind of attributes.

It seems odd and potentially dangerous to have an option that only takes effect when there's no support for adopted style sheets. It doesn't look like `new CSSStyleSheet` supports this kind of attributes.
alinmateut commented 2023-06-15 13:31:53 +02:00 (Migrated from github.com)

Yes, I agree with you. I'll close the PR until I find a proper solution.

Yes, I agree with you. I'll close the PR until I find a proper solution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
marijn/style-mod!9
No description provided.