欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

SAP Commerce Cloud Spartacus UI 修改 primary color 的方法

发布时间:2023/12/19 编程问答 55 豆豆
生活随笔 收集整理的这篇文章主要介绍了 SAP Commerce Cloud Spartacus UI 修改 primary color 的方法 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

问题

解答

The easiest and recommended way to override basic primary colors, as of version 4.0, is by changing the compiled values of the CSS variables. But change them inside a CSS body selector, instead of a :root selector.

Example of storefrontapp/src/styles.scss file:

/* You can add global styles to this file, and also import other style files */$styleVersion: 4.0; @import '~@spartacus/styles/index';$useLatestStyles: true;@import '@spartacus/styles'; @import '@spartacus/styles/scss/theme/santorini';body {--cx-color-primary: green;--cx-color-seconday: #8aa39b;--cx-color-text: #5c6f68;--cx-color-background: #95d9c3;--cx-color-dark: #a4f9c8; }

生效了:

总结

以上是生活随笔为你收集整理的SAP Commerce Cloud Spartacus UI 修改 primary color 的方法的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。