Align blog post margins to header - Dawn Theme

Solved

Align blog post margins to header - Dawn Theme

Szaghal
Visitor
2 0 1

On the blog post page for the Dawn theme, the content is not aligning with the margins of the website, AKA in alignment with the header. I dont have this issue with any of the other pages including the main blog page, only on specific blog posts. 

 

Screenshot 2025-05-12 at 9.23.44 PM.png

Accepted Solution (1)

tim
Shopify Partner
4710 575 1702

This is an accepted solution.

This is done intentionally.

Because in your blog post editor you can't really create responsive content, it was decided to limit the width of this section.

 

Containers inside main "Blog post" section have class page-width--narrow which limits the width of the section to 726 pixels while the rest of the site is usually limited by page-width class which has max width of 1200px.

 

You can go "edit code", find sections/main-article.liquid, search and remove this class, for example https://github.com/Shopify/dawn/blob/main/sections/main-article.liquid#L46 -- change from

   class="page-width page-width--narrow{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"

 

to

   class="page-width {% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"

There are 5 lines with this class.

 

If you do not want to modify theme code (will be helpful when updating theme to newer version), you can instead in Customizer add a "Custom liquid" section right below the "Blog post" one and paste this code:

 

<script>
  document.querySelectorAll('.page-width--narrow')
    .forEach(e=> e.classList.remove('page-width--narrow'));
</script>

 

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 6 (6)

BiDeal-Discount
Shopify Partner
789 103 176

Hi @Szaghal 

Can you share me your store url & password (if applicable) then I will check & give you the solution

- Helpful? Like & Accept solution! Coffee tips fuel my dedication.
- BiDeal Bundle Volume Discounts: Upsell with discount bundles, quantity breaks, volume discounts & mix-and-match bundles. AOV+ with free gifts, free shipping & progressive cart
- Contact me via WhatsApp

tim
Shopify Partner
4710 575 1702

This is an accepted solution.

This is done intentionally.

Because in your blog post editor you can't really create responsive content, it was decided to limit the width of this section.

 

Containers inside main "Blog post" section have class page-width--narrow which limits the width of the section to 726 pixels while the rest of the site is usually limited by page-width class which has max width of 1200px.

 

You can go "edit code", find sections/main-article.liquid, search and remove this class, for example https://github.com/Shopify/dawn/blob/main/sections/main-article.liquid#L46 -- change from

   class="page-width page-width--narrow{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"

 

to

   class="page-width {% if settings.animations_reveal_on_scroll %} scroll-trigger animate--fade-in{% endif %}"

There are 5 lines with this class.

 

If you do not want to modify theme code (will be helpful when updating theme to newer version), you can instead in Customizer add a "Custom liquid" section right below the "Blog post" one and paste this code:

 

<script>
  document.querySelectorAll('.page-width--narrow')
    .forEach(e=> e.classList.remove('page-width--narrow'));
</script>

 

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
Szaghal
Visitor
2 0 1

Hey Tim,

 

Thanks for your reply. Can you explain what you mean by "you can instead in Customizer add a "Custom liquid" section right below the "Blog post" one and paste this code" - when I click to customize the website, I can only add CSS code. 

tim
Shopify Partner
4710 575 1702

This:

Screenshot 2025-05-16 at 11.41.30 AM.png 

 

And paste here:

Screenshot 2025-05-16 at 11.43.04 AM.png

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

Moeed
Shopify Partner
7703 2070 2550

Hey @Szaghal 

 

Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


Dotsquares
Shopify Partner
441 28 59

Hi @Szaghal Thanks for posting the issue. Some steps to follow to resolve-- 

 

In the customize option ofn the online store press edit code and use this CSS and adjust-

 

.article-template__content {
max-width: var(--page-width); /* aligns with your site's standard width */
margin-left: auto;
margin-right: auto;
padding-left: 1.5rem;
padding-right: 1.5rem;
}

 

Let me know if this works for you.

Dotsquares Ltd


Problem Solved? ✔ Accept and Like solution to help future merchants.


Shopify Partner Directory | Trustpilot | Portfolio