如何用 driftyco:ionic meteor 包覆盖 Ionic sass 变量

How to overwrite Ionic sass variables with driftyco:ionic meteor package

我在我的项目中使用 driftyco:ionic 流星包,我想更改 "royal" 颜色。这就是为什么,我想知道如何用 driftyco:ionic meteor 包正确覆盖 Ionic sass 变量。

感谢您的帮助

添加 driftyco:ionic meteor 包会生成一个可以导入的 CSS 样式表。

在你的 HTML 例如:

<head>
  <title>ionic</title>
</head>
<body>
  <h1>Welcome to Meteor!</h1>
    {{> hello}}
</body>
<template name="hello">
  <div class="bar bar-header bar-royal"><h1 class="title">Nice bar</h1></div>
  <button>Click Me</button>
  <p>You've pressed the button {{counter}} times.</p>
</template>

CSS,只需覆盖您要更改的类:

@import '.meteor/local/build/programs/web.browser/merged-stylesheets.css';

.bar.bar-royal {
    background-color: #aa0033;
}

不过,我还是建议使用 SCSS,它会让你的生活更轻松。只需复制 scss directory to your project and use this package 即可编译它。