All Projects → anteriovieira → Nuxt Sass Resources Loader

anteriovieira / Nuxt Sass Resources Loader

SASS resources (e.g. variables, mixins etc.) module for NuxtJs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nuxt Sass Resources Loader

Html Sass Babel Webpack Boilerplate
Webpack 4 + Babel + ES6 + SASS + HTML Modules + Livereload
Stars: ✭ 35 (-81.68%)
Mutual labels:  module, scss, sass
Sassessentials
Repository for my tutorial course: Sass Essential Training on LinkedIn Learning and Lynda.com.
Stars: ✭ 167 (-12.57%)
Mutual labels:  scss, sass
Iota
A responsive micro-framework for the grid spec powered by CSS custom properties.
Stars: ✭ 189 (-1.05%)
Mutual labels:  scss, sass
Frontplate
フロントエンド開発の効率をあげるフルスタックテンプレート
Stars: ✭ 175 (-8.38%)
Mutual labels:  scss, sass
React Timelines
React Timelines Library
Stars: ✭ 161 (-15.71%)
Mutual labels:  scss, sass
Css Vars
Sass mixin to use CSS Custom Properties with Sass
Stars: ✭ 164 (-14.14%)
Mutual labels:  scss, sass
Browser Hack Sass Mixins
Browser hack sass mixin - Apply your SCSS to a specific browser - CSS hacks for: IE, Chrome, Firefox, Edge, Opera
Stars: ✭ 170 (-10.99%)
Mutual labels:  scss, sass
Skeleton Sass
Skeleton Sass is a highly modular version of Skeleton CSS
Stars: ✭ 151 (-20.94%)
Mutual labels:  scss, sass
Buttons
A collection of CSS buttons.
Stars: ✭ 177 (-7.33%)
Mutual labels:  scss, sass
Sass Extras
Useful utilities for working with Sass
Stars: ✭ 179 (-6.28%)
Mutual labels:  scss, sass
Include Media
📐 Simple, elegant and maintainable media queries in Sass
Stars: ✭ 2,362 (+1136.65%)
Mutual labels:  scss, sass
Kindling
A pocket-sized grid system built on the flex display property.
Stars: ✭ 155 (-18.85%)
Mutual labels:  scss, sass
Flexible Grid
Flexible grid layouts to get you familiar with building within the flexible grid system.(HTML, CSS, SASS, SCSS)
Stars: ✭ 154 (-19.37%)
Mutual labels:  scss, sass
Moment Module
Efficient Moment.js integration for Nuxt
Stars: ✭ 164 (-14.14%)
Mutual labels:  nuxt, module
React Native Sass Transformer
Use Sass to style your React Native apps.
Stars: ✭ 151 (-20.94%)
Mutual labels:  scss, sass
Compile Hero
🔰Visual Studio Code Extension For Compiling Language
Stars: ✭ 169 (-11.52%)
Mutual labels:  scss, sass
Sass Extract
Extract structured variables from sass files
Stars: ✭ 183 (-4.19%)
Mutual labels:  scss, sass
Grass
A near-feature-complete Sass compiler written purely in Rust
Stars: ✭ 143 (-25.13%)
Mutual labels:  scss, sass
Sass Spec
Official Sass Spec Suite
Stars: ✭ 151 (-20.94%)
Mutual labels:  scss, sass
Nuxt Client Init Module
Provide client version of nuxtServerInit
Stars: ✭ 176 (-7.85%)
Mutual labels:  nuxt, module

⚠️ We are closing the support for this package and transferred to the official community package. So we strongly suggest that you use the official community package @nuxtjs/style-resources.

Specially thanks our contributors submitting bug reports, feature requests and commenting on issues

Migration guide

// nuxt-sass-resorces-loader
export default {
  modules: [
    'nuxt-sass-resources-loader'
  ],
  // your settings here
  sassResources: [
    '@/path/to/first-resources.sass'
  ]
}
// @nuxtjs/style-resources
export default {
  modules: [
    '@nuxtjs/style-resources',
  ],

  styleResources: {
   // your settings here
   scss: ['@/path/to/first-resources.sass'],
   less: [],
   stylus: []
  }
}

nuxt-sass-resources-loader

npm CircleCI npm donate

This module does all the hard work of configuring sass-resources-loader for your nuxt application.

sass-resources-loader @import your SASS resources into every required SASS module. So you can use your shared variables & mixins across all SASS styles without manually importing them in each file. Made to work with CSS Modules!

Install

npm i nuxt-sass-resources-loader
# or
yarn add nuxt-sass-resources-loader

Note that installing as a dev dependency --save-dev or -D will not work correctly.

Usage

You can use the nuxtjs aliases to resolve the file path.

module.exports = {
  modules: [
    // provide path to the file with resources
    ['nuxt-sass-resources-loader', '@/path/to/resources.scss'],

    // or array of paths
    ['nuxt-sass-resources-loader', [
        '@/path/to/first-resources.sass',
        '@/path/to/second-resources.scss',
    ]],

    // or the native options
    ['nuxt-sass-resources-loader', {
        resources: '@/path/to/resources.sass'
    }],
    
    // or from the npm package
    ['nuxt-sass-resources-loader', 'my-package/sass/resources.scss']
  ],
}

with sass resources option. require v1.1+

// nuxt.config.js
module.exports = {
  modules: [
    'nuxt-sass-resources-loader'
  ],
  sassResources: [
    '@/path/to/first-resources.sass'
  ]
}

You can also use resolve from node to indicate the relative path of the file:

const resolve = require('path').resolve
...
['nuxt-sass-resources-loader', resolve(__dirname, './path/to/resources.scss')]
...

Glob pattern matching

You can specify glob patterns to match your all of your files in the same directory.

// Specify a single path
resources: './path/to/resources/**/*.scss', // will match all files in folder and subdirectories
// or an array of paths
resources: [ './path/to/resources/**/*.scss', './path/to/another/**/*.scss' ]

Note that sass-resources-loader will resolve your files in order. If you want your variables to be accessed across all of your mixins you should specify them in first place.

resources: [ './path/to/variables/vars.scss', './path/to/mixins/**/*.scss' ]

For more details see the official documentation

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].