mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-08 05:13:43 +03:00
Pledge edit button: Style the dialog on small screens
This commit is contained in:
parent
be62f41e43
commit
c703c7cefa
|
@ -20,6 +20,13 @@ jQuery( document ).ready( function( $ ) {
|
|||
const bounds = button.getBoundingClientRect();
|
||||
const modalWidth = 300; // Modal width is hardcoded, because it's not visible yet.
|
||||
|
||||
if ( button.closest('.wp-block-wporg-pledge-edit-button') ) {
|
||||
return {
|
||||
top: bounds.y + offsetTop + bounds.height,
|
||||
left: bounds.x + offsetLeft,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
top: bounds.y + offsetTop + bounds.height,
|
||||
left: bounds.x + offsetLeft + bounds.width - modalWidth,
|
||||
|
|
|
@ -15,7 +15,6 @@ const Edit = () => {
|
|||
return (
|
||||
<div { ...blockProps }>
|
||||
<button>
|
||||
<span className="dashicons dashicons-edit" aria-hidden="true"></span>
|
||||
Edit Pledge
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -29,11 +29,25 @@
|
|||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Update layout to floating modal on smaller screens. */
|
||||
@media (max-width: 889px) {
|
||||
position: fixed;
|
||||
top: 80px !important;
|
||||
right: var(--wp--preset--spacing--30) !important;
|
||||
left: var(--wp--preset--spacing--30) !important;
|
||||
width: calc(100% - var(--wp--preset--spacing--30) * 2);
|
||||
z-index: 251; /* header + 1. */
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
top: var(--wp--preset--spacing--30) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.pledge-dialog__background {
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
z-index: 251; /* header + 1. */
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
|
@ -42,4 +56,9 @@
|
|||
&[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Update layout to floating modal on smaller screens. */
|
||||
@media (max-width: 889px) {
|
||||
background-color: rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue