Sorry for asking such a basic question - being rather new to Shopify I think it’s just due to my limited understanding of all the CSS in Shopify ![]()
Anyway, I am working on making some adjustments to the new Dawn Theme. One of them is, that I want to be able to select if I want the headline on collection lists to be left (as it is by default), center or right.
So far I managed to define the new section for that, so it shows up as an option, the value I select is store and I can print it. So far so good. I added this code:
{
"type": "select",
"id": "headline_align",
"options": [
{
"value": "Left",
"label": "Left"
},
{
"value": "Center",
"label": "Center"
},
{
"value": "Right",
"label": "Right"
}
],
"default": "Left",
"label": "Align headline"
},
To print it I am using
{{ section.settings.headline_align }}
All that works fine and I am happy to see how easy it is with SO2.0 to do that (will do much more like this).
However, the stupid little thing I just can’t work out is how to then center the actual headline. The headline is coded like this (standard Dawn):
## {{ section.settings.title | escape }}
{%- if section.settings.show_view_all and section.settings.swipe_on_mobile -%}
{{ 'sections.collection_list.view_all' | t }}
{%- endif -%}
First I was thinking just to add text-align: VALUE in a Style element in the Div. However, that doe not seem to work and I am also thinking it may not be the best way. But I can’t seem to find out where the used CSS is for the section headline - and if its possible to dynamically use the new sectional value I have created?
If anyone can help I would really appreciate it ![]()
And yes, I am pretty sure when you tell me I realize how easy it is and how stupid I was hehe