I’ve created a element in the following way:
{% schema %}
{
"name": "Push Bundles Storefront",
"target": "body",
"enabled_on": {"templates": ["product"]}
}
{% endschema %}
But these styles aren’t being applied and what I’m struggling with is how can I apply these styles and can I add CSS files ? Cause styles are gonna be a lot vast in the future so it wouldn’t be practical to store them in the same file.
Thanks!
Well I found the solution. You can add styles to your elements by adding the stylesheet attribute to the schema of your liquid file and referencing the CSS file from the assets folder.
So this also solves the problem of having large styles cause when you get a dedicated CSS file maintaining a large amount of CSS won’t be a problem.
{% schema %}
{
"name": "Storefront Designs",
"target": "body",
"enabled_on": {
"templates": ["product"]
},
"stylesheet": "storefrontDesign.css"
}
{% endschema %}