Shopify 在旧版 Prestige 主题中添加附加样式表时遇到问题。

huangapple go评论50阅读模式
英文:

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.

Shopify 在旧版 Prestige 主题中添加附加样式表时遇到问题。

答案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 }}

huangapple
  • 本文由 发表于 2023年2月6日 08:31:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75356459.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定