【问题标题】:Nativescript-vue: how to apply a new theme using default app.scss?Nativescript-vue:如何使用默认 app.scss 应用新主题?
【发布时间】:2019-04-02 10:16:18
【问题描述】:

我使用

初始化了一个新项目
tns create <project_name> --vue

所以我有文件~/App/app.scss

// Import app variables
@import 'app-variables';

// Import the theme’s main ruleset - both index and platform specific.
@import '~nativescript-theme-core/scss/index';
@import '~nativescript-theme-core/scss/platforms/index.android';

// Import common styles
@import 'app-common';

我想尝试其中一个主题,例如“浅绿色”或“棕色”。

我必须添加和/或更改什么?

【问题讨论】:

    标签: nativescript-vue


    【解决方案1】:

    打开_app-variables.scss我在开始时发现了这个

    @import '~nativescript-theme-core/scss/light';
    

    我改成

    @import '~nativescript-theme-core/scss/brown';
    

    然后注释所有变量的覆盖。

    然后在我的Home.vue,在style部分,我评论了$dark_accent的使用。

    这样我就可以使用_app-variables.scss的第一行简单地切换主题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-07
      • 2013-10-11
      • 2020-05-13
      • 2012-11-22
      相关资源
      最近更新 更多