Answer the question
In order to leave comments, you need to log in
How can styles be used globally in a module?
How can classes from global styles be used in a module?
<template>
<a href="/" :class="$style.appLogo"> <AppLogo /> </a>
<span :class="$style.btnText">Войти</span>
</template>
<script lang="ts">
import { defineComponent } from '@nuxtjs/composition-api'
import AppLogo from '@/static/icons/app/logo.svg?inline'
export default defineComponent({
components: {
AppLogo,
},
})
</script>
<style module lang="scss">
.app {
&Logo {
color: $fontColor;
font-weight: 900;
font-size: 26px;
line-height: 44px;
display: flex;
align-items: center;
svg {
width: 40px;
height: 47px;
margin-right: 9px;
}
}
}
</style>
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'@/assets/styles/desktop/button.scss',
],
Answer the question
In order to leave comments, you need to log in
Alternatively, you can import the desired file with styles
<template>
<a href="/" :class="$style.appLogo"> <AppLogo /> </a>
<span :class="$global.btnText">Войти</span>
</template>
<style module lang="scss">
.app {
&Logo {
color: $fontColor;
}
}
</style>
<style lang="scss" module="$global" src="@/assets/styles/desktop/button.scss" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question