I
I
Igor Myasnikov2019-09-19 09:47:27
Vue.js
Igor Myasnikov, 2019-09-19 09:47:27

How to use css variables in nuxt?

Good afternoon!!
Tell me how you can include variables in nuxt.js css and use them in any component without importing them into each component

<style lang="scss">
  @import "@/theme/variables";

  .header {
    &__wrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: 0 auto;
      padding: 0;
      max-width: 1200px;

      @media screen and (min-width: $break_lg) {
        padding: 0 16px;
      }
    }

    
  }
</style>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Glebov, 2019-09-19
@pilium

https://www.npmjs.com/package/@nuxtjs/style-resources

A
Andrew, 2019-09-19
@KickeRockK

For @import'it in index.scss?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question