• This repository has been archived on 18/Dec/2018
  • Stars
    star
    97
  • Rank 348,505 (Top 7 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sass variable loader for webpack

Sass variable loader for webpack

Parses your Sass variables and returns an object containing each variable camelCased and the end value as it would be in CSS.

That means full support for Sass' lighten, darken, mix etc.

Input:

$gray-base: #000 !default;
$gray-darker: lighten($gray-base, 13.5%) !default; // #222
$gray-dark: lighten($gray-base, 20%) !default; // #333
$gray: lighten($gray-base, 33.5%) !default; // #555
$gray-light: lighten($gray-base, 46.7%) !default; // #777
$gray-lighter: lighten($gray-base, 93.5%) !default; // #eee

Result:

{
  grayBase: '#000',
  grayDarker: '#222222',
  grayDark: '#333333',
  gray: '#555555',
  grayLight: '#777777',
  grayLighter: '#eeeeee'
}

Installation

npm install --save-dev sass-variable-loader

Usage

import variables from 'sass-variable-loader!./_variables.scss';
// => returns all the variables in _variables.scss as an object with each variable name camelCased

Note: If you've already defined loaders for Sass files in the configuration, you can override the loader order by writing !!sass-variable-loader!./_variables.scss to disable all loaders specified in the configuration for that module request.

Options

You can pass options to the loader via query parameters.

preserveVariableNames

import variables from 'sass-variable-loader?preserveVariableNames!./_variables.scss';
// => returns all the variables in _variables.scss as an object with each variable name left intact

License

MIT (http://www.opensource.org/licenses/mit-license.php)

More Repositories

1

cordova-hot-code-push

[DEPRECATED] - This plugin provides functionality to perform automatic updates of the web based content in your application.
Java
980
star
2

cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
JavaScript
349
star
3

cordova-hot-code-push-cli

[DEPRECATED] - This is a command line utility for Cordova Hot Code Push Plugin.
JavaScript
143
star
4

nordnet-ui-kit

Nordnet UI Kit
JavaScript
106
star
5

next-api-v2-examples

Code examples for using the Nordnet External API v2
Python
57
star
6

python-freeipa-json

Tiny/basic module for communicating with the FreeIPA API without having to install the entire FreeIPA toolchain
Python
54
star
7

nordnet-next-api

Nordnet nExt API Javascript client
JavaScript
28
star
8

react-bem-grid

A BEM-ified port of Flexbox Grid to a simple, reusable React component
JavaScript
27
star
9

cordova-hot-code-push-local-dev-addon

[DEPRECATED] - Cordova plugin that adds local development feature to the Hot Code Push plugin.
Swift
24
star
10

nordnet-component-kit

Nordnet Component Kit - https://nordnet.github.io/nordnet-component-kit
JavaScript
13
star
11

react-svg-sprite-icon

A React icon component that generates an SVG sprite on the fly
JavaScript
7
star
12

grid

Grid System as a React component based on Flexbox Grid
JavaScript
6
star
13

frontend-mentorship

JavaScript
6
star
14

generator-nordnet-es-module

Scaffold out an ES6 node module
JavaScript
3
star
15

cz-conventional-changelog

conventional-changelog config for commitizen
JavaScript
2
star
16

eslint-config-nordnet

ESLint config for Nordnet Javascript applications
JavaScript
2
star
17

nordnet-release-plugin

Webpack plugin for building releases of Javascript applications
JavaScript
2
star
18

design-tokens

TypeScript
1
star
19

jscs-config-nordnet

JSCS config for Nordnet Javascript applications
JavaScript
1
star