【问题标题】:How to add global styles in sapper如何在 sapper 中添加全局样式
【发布时间】:2021-11-07 21:03:03
【问题描述】:

目前我正在使用this 模板,我想将我的全局字体系列更改为“Poppins”。我该怎么做?

这是我的尝试,但它仍然不起作用。

static/tailwind.css
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
    font-family: "Poppins";
}

@tailwind base;
@tailwind components;
@tailwind utilities;

【问题讨论】:

    标签: svelte svelte-3 sapper


    【解决方案1】:
    <style>
      :global(a) {
        font-size: 1em;
      }
    </style>
    

    <style lang="scss">
      :global {
        @import 'stylesheets/main.scss';
      }
    </style>
    

    【讨论】:

      【解决方案2】:

      啊解决了,把这个添加到我的src/index.svelte,但我仍然想知道其他替代解决方案。

      <style global>
        * {
          font-family: 'Poppins';
        }
      </style>
      

      【讨论】:

        猜你喜欢
        • 2020-06-28
        • 1970-01-01
        • 2021-08-03
        • 2022-01-07
        • 2021-03-06
        • 2021-10-03
        • 1970-01-01
        • 2019-04-21
        • 1970-01-01
        相关资源
        最近更新 更多