How to add global styles in sapper

343 views Asked by At

Currenly I'm using this template, and I want to change my global font-family to "Poppins". How can I do that?

Heres my attempts but it still doesn't work.

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;
2

There are 2 answers

0
Roby Cigar On

Ah solved, just add this on my src/index.svelte, but I still wonder about other alternative solution.

<style global>
  * {
    font-family: 'Poppins';
  }
</style>
0
hazg On
<style>
  :global(a) {
    font-size: 1em;
  }
</style>

or

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