Shopify themes, liquid, logos, and UX
I would like to add a line like this on top of the newsletter form on mobile view.
Here is the site: https://568839.myshopify.com/
Hi @galleriste
Try this one.
<style>
#shopify-section-template--18152640217353__newsletter_BwUhTB {
padding-right: 9px !important;
padding-left: 9px !important;
margin-right: 0 !important;
margin-left: 0 !important;
border-top: 0.9px solid rgb(var(--secondary-button-text-color), 0.2);
}
</style>
And Save.
Result:
Is this only for mobile? This border wil add for all screen. Let me know if you need some adjustment. Thanks!
Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!
It only added it to the one pages newsletter. Can you make it so its always there when you add a newsletter section. also for desktop
Yes I can, but your store is password-protected.
If you'd like to add a line above the newsletter form in the Focal theme, especially for mobile view, you can do it by tweaking the theme's code a little. Here's how you can do it step by step:
Go to Your Theme Settings:
Find the Newsletter Section:
Add the Line in the Code:
<hr style="border: 1px solid #e0e0e0; margin-bottom: 15px;">
Make It Mobile-Specific (Optional):
<div class="mobile-line"> <hr> </div>
@media only screen and (max-width: 768px) { .mobile-line hr { border: 1px solid #e0e0e0; margin-bottom: 15px; } }
Save and Preview:
Test Responsiveness:
Let me know if you need any further help! 😊
How would you add it here?
To add the <hr> line above the newsletter form in the Focal theme's code snippet you shared, here’s how you can integrate it step by step Updated Code with the Line Above the Newsletter Form:
Find the part of the code where the newsletter form starts. In your snippet, it begins with this line:
{% form 'customer', id: newsletter_id, class: 'form newsletter__form' -%}
Now, insert the <hr> tag just above this form block to add the line above the newsletter form. Here’s the modified version:
<hr style="border: 1px solid #e0e0e0; margin-bottom: 15px;"> <div class="container container--flush"> {% assign text_position = section.settings.text_position | split: '-' | last %} <div {% if section.settings.reveal_on_scroll %}reveal{% endif %} class="image-with-text-block__content image-with-text-block__content--tight container"> {% if section.settings.subheading != blank -%} <h2 class="heading heading--small">{{ section.settings.subheading | escape }}</h2> {% endif -%} {% if section.settings.content != blank -%} {{- section.settings.content -}} {% endif -%} {% assign newsletter_id = 'newsletter-' | append: section.id -%} <!-- Adding the horizontal line here --> <hr style="border: 1px solid #e0e0e0; margin-bottom: 15px;"> {% form 'customer', id: newsletter_id, class: 'form newsletter__form' -%} {% if form.posted_successfully -%} <script> window.addEventListener('DOMContentLoaded', () => { if (history.scrollRestoration) { history.scrollRestoration = 'manual'; // Prevent the browser to scroll on captcha page } }); </script> {% endif -%}
Placement of <hr>: The <hr> tag is placed right before the form block for the newsletter. This ensures the line appears just above the form itself.
Styling: The inline CSS (style="border: 1px solid #e0e0e0; margin-bottom: 15px;") styles the horizontal line to match the rest of your theme’s design.
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024