Gathering detailed insights and metrics for @evolvere/nuxtjs-style-resources
Gathering detailed insights and metrics for @evolvere/nuxtjs-style-resources
Gathering detailed insights and metrics for @evolvere/nuxtjs-style-resources
Gathering detailed insights and metrics for @evolvere/nuxtjs-style-resources
npm install @evolvere/nuxtjs-style-resources
Typescript
Module System
Min. Node Version
Node Version
NPM Version
61.8
Supply Chain
98.1
Quality
74.1
Maintenance
100
Vulnerability
98.6
License
TypeScript (78.28%)
Vue (11.85%)
JavaScript (5.34%)
Shell (1.45%)
Sass (1.1%)
SCSS (0.91%)
Less (0.63%)
Stylus (0.44%)
Built with Next.js • Fully responsive • SEO optimized • Open source ready
Total Downloads
275
Last Day
3
Last Week
6
Last Month
41
Last Year
275
MIT License
602 Stars
101 Commits
22 Forks
10 Watchers
17 Branches
16 Contributors
Updated on Jul 31, 2025
Latest Version
1.0.0
Package Id
@evolvere/nuxtjs-style-resources@1.0.0
Unpacked Size
10.53 kB
Size
4.21 kB
File Count
4
NPM Version
10.2.3
Node Version
20.10.0
Published on
Mar 02, 2025
Cumulative downloads
Total Downloads
Last Day
-25%
3
Compared to previous day
Last Week
-66.7%
6
Compared to previous week
Last Month
32.3%
41
Compared to previous month
Last Year
0%
275
Compared to previous year
3
28
@import
needed)~/assets/variables.css
) and globbing as supportedbuild.styleResources
(and will take them over directly if included!)yarn add sass-loader node-sass
yarn add less-loader less
yarn add stylus-loader stylus
@nuxtjs/style-resources
dependency using yarn or npm to your project (yarn add @nuxtjs/style-resources
)@nuxtjs/style-resources
to modules
section of nuxt.config.js
:1export default { 2 modules: [ 3 '@nuxtjs/style-resources', 4 ], 5 6 styleResources: { 7 // your settings here 8 sass: [], 9 scss: [], 10 less: [], 11 stylus: [] 12 } 13}
Important notice: Do not import actual styles. Use this module only to import variables, mixins, functions (et cetera) as they won't exist in the actual build. Importing actual styles will include them in every component and will also make your build/HMR magnitudes slower. Do not do this!
nuxt.config.js
:
1export default { 2 css: ['~assets/global.less'], 3 modules: ['@nuxtjs/style-resources'], 4 styleResources: { 5 less: './assets/vars/*.less' 6 } 7}
assets/global.less
1h1 { 2 color: @green; 3}
assets/vars/variables.less
1@gray: #333;
assets/vars/more_variables.less
1@green: #00ff00;
pages/index.vue
1<template> 2 <div> 3 <!-- This h1 will be green --> 4 <h1>Test</h1> 5 <test/> 6 </div> 7</template> 8 9<script> 10import Test from '~/components/Test' 11 12export default { 13 components: { Test } 14} 15</script> 16
components/Test.vue
1<template> 2 <div class="ymca"> 3 Test 4 </div> 5</template> 6 7<style lang="less"> 8 .ymca { 9 color: @gray; // will be resolved to #333 10 } 11</style>
nuxt.config.js
:
1export default { 2 modules: ['@nuxtjs/style-resources'], 3 styleResources: { 4 scss: [ 5 './assets/vars/*.scss', 6 './assets/abstracts/_mixins.scss' // use underscore "_" & also file extension ".scss" 7 ] 8 } 9}
Instead of
'./assets/abstracts/_mixins.scss'
you can use also'~assets/abstracts/_mixins.scss'
assets/vars/_colors.scss
1$gray: #333;
assets/abstracts/_mixins.scss
1@mixin center() { 2 position: absolute; 3 top: 50%; 4 left: 50%; 5 transform: translate3d(-50%, -50%, 0); 6}
components/Test.vue
1<template> 2 <div class="ymca"> 3 Test 4 </div> 5</template> 6 7<style lang="scss"> 8 .ymca { 9 @include center; // will be resolved as position:absolute.... 10 color: $gray; // will be resolved to #333 11 } 12</style>
Inspired by nuxt-sass-resources-loader.
Copyright (c) Alexander Lichter
No vulnerabilities found.