Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mixedstyle-loader

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixedstyle-loader

loads mixed style imports e.g. sass/css/stylus from one file while maintaining their order

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Mixed Style loader

The loader that should not even exist. But who doesn't like to nurse a bunch of legacy code.

what it does

It consumes css files with css @import statements and other css code. The magic is that those @import statements can go to any kind of css or css-precompiler file, as long as there is a proper loader existing and configured for it.

example

imagine you have 3 files a.css, b.sass, and c.scss and you need to load them in the order:

* `c.scss`
* `b.sass`
* `a.css`

so you create a file d.css which looks as follows:

    @import 'c.scss';
    @import 'b.sass';
    @import 'a.css';

then you will probably run into a couple of issues:

  • css-loader will fail trying to interpret sass and scss
  • sass-loader will hoist all *.css imports assuming you are too stupid to know where they belong
  • …and so on

mixedstyle to the rescue!

assuming you still have your d.css file just add this to your loader:

    loaders: [
        {
            test: /\W?d\.css$/,
            loader: "mixedstyle"
        }
    ]

or probably you want to use it for the Extract-Text-Plugin, in that case do:

    loaders: [
        {
            test: /\W?d\.css$/,
            loader: ExtractTextPlugin.extract("style-loader", "mixedstyle")
        }
    ]

or simply go for inline

    var x = require('mixedstyle!./d.css');

    //or
    var x = require('style!mixedstyle!./d.css');

FAQs

Package last updated on 10 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc