style
Generate an HTML <style>
tag that contains your css rules. The generated tag will have a data-youcan
data attribute.
So far there is no real benefit to using this tag other than to keep your liquid consistent by using liquid like syntax.
liquid
{% style %}
CSS_rules
{% endstyle %}
1
2
3
2
3
CSS_rules
: Your set ofCSS
rules you wish to apply.
Example:
Data
json
{
"section": {
"settings": {
"banner_background_position": "center"
}
}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Note: Data is only refereed as a reference for this example and is in no means reflecting real world data.
liquid
{% style %}
.banner {
background-position: {{- sections.settings.banner_background_position -}};
}
{% endstyle %}
1
2
3
4
5
2
3
4
5
Output
html
<style data-youcan>
.banner {
background-position: center;
}
</style>
1
2
3
4
5
2
3
4
5