# mixedstyle-loader

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

Latest version **0.0.3** (published 2017-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install mixedstyle-loader
pnpm add mixedstyle-loader
yarn add mixedstyle-loader
bun add mixedstyle-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-04-10 |
| First published | 2015-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Tim Sebastian @timse, Paul Moelders @p0wl |
| Maintainers | meandmax, p0wl, timse |

## Links

- npm: https://www.npmjs.com/package/mixedstyle-loader
- Repository: https://github.com/Jimdo/mixedstyle-loader
- Homepage: https://github.com/Jimdo/mixedstyle-loader#readme
- Issues: https://github.com/Jimdo/mixedstyle-loader/issues
- npm.io page: https://npm.io/package/mixedstyle-loader

## Dependencies (2)

- [loader-utils](https://npm.io/package/loader-utils.md) 0.2.x
- [parse-import](https://npm.io/package/parse-import.md) ^2.0.0

## Recent versions

- 0.0.3 (latest) — 2017-04-10
- 0.0.2 — 2015-09-01
- 0.0.1 — 2015-08-27

## README

# 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:

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

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

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

or simply go for inline

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

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

---
_Source: https://npm.io/package/mixedstyle-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
