Impossible to override position of amp-user-notitifcation
The file: extensions/amp-user-notification/0.1/amp-user-notification.css specifies the position of the element as fixed using !important like this:
amp-user-notification { position: fixed !important;
Given in AMP is not possible to use !important, it is then impossible to override the position of this component.
/cc @erwinmombay
It is not possible. This is because whether the component is shown depends on HTTP requests and so this can only be used with positions that are invariant to other page layout, to avoid impact on page flow when notification is shown.
You can e.g. put it at the bottom or some other place on the page.
@kul3r4 this was a conscious decision. you can still manipulate top/left/right/bottom. i know we did say we were open to loosening the restriction but we'd need to hear a good argument for it.
Ancestry.com: https://www.ancestry.com currently shows a cookie notice at the top of their site.
They have tried to implement the same using amp-user-notification but because it gets tagged on with "position: fixed!important", which ends up covering the logo and sign in at the top of the page which are both big CTAs.
Given they are using amp-user-notification with local storage (not remote checks) to decide whether or not to show the notification (not remotely configured), is there any way to override the "position: fixed!important", as without it, they won't be able to build this site to 100% parity?
Paging @erwinmombay
Hello. Just pinging to see if there are any thoughts on this?
@nainar AMP tries to avoid janking the page around. Other proposals that can show the notice without causing layout jank after first paint would be fine.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.