英文:
Shopify having trouble adding an additional style sheet in older prestige theme
问题
Hi thanks for having a look. I am having trouble adding an additional stylesheet to older prestige theme for whatever reason it’s not getting recognized.
I am adding it in theme.liquid like this {{ 'application.css' | asset_url | stylesheet_tag }}
NOTE The file has the same name in the assets directory, and if I put it in the product section it works.
See screenshot I tried it above or below.
This works fine for me in the dawn theme.
英文:
Hi thanks for having a look. I am having trouble adding an additional stylesheet to older prestige theme for whatever reason it’s not getting recognized.
I am adding it in theme.liquid like this {{ 'application.css' | asset_url | stylesheet_tag }}
NOTE The file has same name in assets directory, and if I put in the product section it works.
See screenshot I tried it above or below.
This works fine for me in the dawn theme.
答案1
得分: 0
我认为你的语法(撇号)存在问题。同时,请确保application.css
实际存在于/assets
目录中。
{{ 'application.css' | asset_url | stylesheet_tag }}
而不是:
{{ ‘application.css’ | asset_url | stylesheet_tag }}
英文:
I think there is a problem with your syntax (apostrophes). Also, ensure that application.css actually exists in the /assets directory
{{ 'application.css' | asset_url | stylesheet_tag }}
not:
{{ ‘application.css’ | asset_url | stylesheet_tag }}
答案2
得分: 0
我弄清楚了一些原因,当我在本地开发环境中添加样式表标签时,它不会传递到主题代码中。
所以当我直接在主题代码编辑器中添加它时,它就正常工作了。
所以我是这样做的:
{{ 'application.css' | asset_url | stylesheet_tag }}
英文:
I figured out what was going on for some reason when I add the stylesheet tag in my local dev environment it does not carry over to theme code.
So when I added it directly in theme code editor it worked fine.
So I did it like this:
{{ 'application.css' | asset_url | stylesheet_tag }}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论