-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
replace style binding for z-index with CSS variable #272
Open
jelhan
wants to merge
2
commits into
mansona:main
Choose a base branch
from
jelhan:remove-z-index-style-binding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set default value with CSS class instead. Default value could be customized with CSS variable if needed. If consumer prefers to set it on invocation, it could be set as any other HTML attribute using angle bracket component invocation: ```hbs <NotificationContainer style="z-index: 9999;" /> ``` This should be preferred over style bindings due to security reasons. Especially style bindings requires an `style-src: unsafe-inline` directive Content Security Policy, which is bad for security reasons.
Ember CLI Content Security Policy ships test support in it's upcoming v2 release. It could be used to test compliance with a strict CSP. If a test violates the configured CSP it will fail. The addon comes with reasonable defaults and does not require any configuration for this use case.
jelhan
force-pushed
the
remove-z-index-style-binding
branch
from
April 15, 2020 10:36
666dc52
to
de318da
Compare
There are still inline styles used:
Seems like this code-path is not triggered by tests. Otherwise CI would have told us. Even so this pull request is not fixing all CSP issues I think it could be merged. Fixing it for the animation on |
Closed
pichfl
added a commit
to pichfl/ember-cli-notifications
that referenced
this pull request
Dec 10, 2021
- simplify component class - move @z-index@ handling to CSS custom property Replaces mansona#272
pichfl
added a commit
to pichfl/ember-cli-notifications
that referenced
this pull request
Dec 15, 2021
- simplify component class - move @z-index@ handling to CSS custom property Replaces mansona#272
pichfl
added a commit
to pichfl/ember-cli-notifications
that referenced
this pull request
Dec 15, 2021
- simplify component class - move @z-index@ handling to CSS custom property Replaces mansona#272
pichfl
added a commit
to pichfl/ember-cli-notifications
that referenced
this pull request
Jun 8, 2022
- simplify component class - move @z-index@ handling to CSS custom property Replaces mansona#272
pichfl
added a commit
to pichfl/ember-cli-notifications
that referenced
this pull request
Jun 8, 2022
- simplify component class - move @z-index@ handling to CSS custom property Replaces mansona#272
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the style binding used to set the
z-index
of the container. The default value is set with CSS instead. Default value could be customized with a CSS variable if needed. If consumer prefers to set it on invocation, it could be set as any other HTML attribute using angle bracket component invocation:This should be preferred over style bindings due to security reasons. Especially style bindings requires an
style-src: unsafe-inline
directive Content Security Policy, which is bad for security reasons.The pull request also adds test coverage to prevent a regression regarding CSP compliance. It does so using Ember CLI Content Security Policy, which provides test support in it's v2 release. It could be used to test compliance with a strict CSP. If a test violates the configured CSP it will fail. The addon comes with reasonable defaults and does not require any configuration for this use case.
This is a breaking change and requires a major release.