does anyone know of a strategy on how to implement text colour changes per snippet?
the homepage is made out of multiple sections, each section has a different background colour, therefore one text colour option isnt fit for purpose.
my ideal Scenario is have a text colour changer on the UI part of shopify so the Graphic Designers can change the text colour in each section without affecting the colour across the site.
Hello Liam_cottrell,
You are working on which theme?
Please share your site url.
Hi Liam,
it might be helpfull to add a new Text Color Option to the live customizer for all your sections.
Therefore you would edit the Section Schema of every Section and add a color picker.
"settings": [ Settings from the Section... , { "type": "color", "id": "text_color", "label": "Text Color for this Section", "default": "#000000" } ]
Then you can apply the text color via CSS.
<div class="section_xy" style="color:{{section.settings.text_color}}"> . . . . <div>
Hope that helps and have a good day.
:-)
@Jan_F this is what I did, what I failed to change is the CSS to {{section.setting.text_color}}.
I will give this a try :)
thanks
@Jan_F do you have any idea, how to implement this if the styling isnt to be done inline?
I also want to manipulate Hover styles so will need to write a scss rule, do you know how I could reference liquid in the scss file?
Hi,
so far, I created a style tag within the Snippet. Gave the selectors some styling rules that look like the following
Hi Liam,
I´m not 100% sure if I correctly understood what you tried to explain in your last message.
I´m guessing now you have a Section with multiple Blocks in it.
If that's the case you can access the blocks like in the following snippet:
{% for block in section.blocks%}
{{block.settings.color}} ...do something with all the blocks {%endfor%}
You can also access single blocks specifically if you want:
{{ section.blocks[0].settings.color}} {{ section.blocks[1].settings.color}}
Happy testing :D
Subject | Author | Latest Post |
---|---|---|
Subject | Author | Posted |
---|---|---|
16m ago | ||
2 hours ago | ||
2 hours ago | ||
3 hours ago | ||
4 hours ago |
User | Count |
---|---|
95 | |
63 | |
61 | |
56 | |
41 |