Create pop-up.liquid file in Theme > Edit code > Sections folder, then past this code into that file
Open Popup
## {{ section.settings.title }}
×
{{ section.settings.content }}
{% schema %}
{
"name": "Popup",
"settings": [
{
"id": "trigger",
"type": "text",
"label": "ID",
"info": "Unique ID for popup trigger"
},
{
"id": "title",
"type": "text",
"label": "Title"
},
{
"id": "content",
"type": "richtext",
"label": "Content"
}
],
"presets": [{
"name": "Popup",
"category": "Window"
}]
}
{% endschema %}
{% stylesheet %}
.popup__overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
background: rgb(0, 0, 0, 0.7);
transition: opacity 500ms ease-in-out;
visibility: hidden;
opacity: 0;
}
.popup__overlay:target {
visibility: visible;
opacity: 1;
z-index: 99;
}
.popup__box {
padding: 24px;
background: #fff;
border-radius: 8px;
width: 40%;
position: relative;
}
.popup__box h2 {
color: #333;
font-size: 2em;
font-weight: bold;
font-family: Verdana, sans-serif;
margin-top: 0;
}
.popup__close {
position: absolute;
top: 20px;
right: 30px;
transition: all 200ms ease-out;
color: #333;
font-size: 30px;
font-weight: bold;
line-height: 1.25;
text-decoration: none;
}
.popup__close:hover {
color: #660000;
}
.popup__content {
max-height: 30%;
overflow: auto;
}
@media screen and (max-width: 1280px) {
.popup__box {
width: 60%;
}
}
@media screen and (max-width: 720px) {
.popup__box {
width: 80%;
}
}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
Try it and let me know