All Projects → tomasAlabes → Stylefmt Loader

tomasAlabes / Stylefmt Loader

Webpack-loader. Fixes stylelint issues automatically while bundling with Webpack.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Stylefmt Loader

Sass Loader
Compiles Sass to CSS
Stars: ✭ 3,718 (+15391.67%)
Mutual labels:  webpack, webpack-loader, loader
Thread Loader
Runs the following loaders in a worker pool
Stars: ✭ 945 (+3837.5%)
Mutual labels:  webpack, webpack-loader, loader
Markdown Loader
markdown loader for webpack
Stars: ✭ 335 (+1295.83%)
Mutual labels:  webpack, webpack-loader, loader
Svgr
Transform SVGs into React components 🦁
Stars: ✭ 8,263 (+34329.17%)
Mutual labels:  webpack, webpack-loader, loader
Style Loader
Style Loader
Stars: ✭ 1,572 (+6450%)
Mutual labels:  webpack, webpack-loader, loader
Wasm Loader
✨ WASM webpack loader
Stars: ✭ 604 (+2416.67%)
Mutual labels:  webpack, webpack-loader, loader
Css Loader
CSS Loader
Stars: ✭ 4,067 (+16845.83%)
Mutual labels:  webpack, webpack-loader, loader
Vue Svg Inline Loader
Webpack loader used for inline replacement of SVG images with actual content of SVG files in Vue projects.
Stars: ✭ 105 (+337.5%)
Mutual labels:  webpack, webpack-loader, loader
Sass Vars Loader
Use Sass variables defined in Webpack config or in external Javascript or JSON files
Stars: ✭ 112 (+366.67%)
Mutual labels:  webpack, webpack-loader, loader
Workflow
一个工作流平台
Stars: ✭ 1,888 (+7766.67%)
Mutual labels:  webpack, stylelint, loader
Pug As Jsx Loader
Stars: ✭ 168 (+600%)
Mutual labels:  webpack, webpack-loader, loader
nunjucks-loader
Webpack loader for Nunjucks templates
Stars: ✭ 20 (-16.67%)
Mutual labels:  loader, webpack-loader
typed-css-modules-loader
💠 Webpack loader for typed-css-modules auto-creation
Stars: ✭ 62 (+158.33%)
Mutual labels:  loader, webpack-loader
Extract Loader
webpack loader to extract HTML and CSS from the bundle
Stars: ✭ 297 (+1137.5%)
Mutual labels:  webpack, webpack-loader
webpack-modernizr-loader
Get your modernizr build bundled with webpack, use modernizr with webpack easily
Stars: ✭ 35 (+45.83%)
Mutual labels:  loader, webpack-loader
Nunjucks Isomorphic Loader
Nunjucks loader for webpack, supporting both javascript templating and generating static HTML files through the HtmlWebpackPlugin.
Stars: ✭ 17 (-29.17%)
Mutual labels:  webpack, webpack-loader
Node Addon Loader
A loader for node native addons
Stars: ✭ 17 (-29.17%)
Mutual labels:  webpack, webpack-loader
markup-inline-loader
a webpack loader to embed svg/MathML to html
Stars: ✭ 24 (+0%)
Mutual labels:  loader, webpack-loader
Stylelint Webpack Plugin
A Stylelint plugin for webpack
Stars: ✭ 411 (+1612.5%)
Mutual labels:  webpack, stylelint
Phaser Ce Npm Webpack Typescript Starter Project
Project to get you started with your Phaser-CE (using the npm module) game using Typescript and Webpack for building! No hassle asset management, Google Web Font loader, live server, development vs distribution build pipeline, Electron packaging for desktop builds, and more...
Stars: ✭ 414 (+1625%)
Mutual labels:  webpack, loader

stylefmt-loader

Installation

npm install --save-dev stylefmt stylefmt-loader

or

yarn add --dev stylefmt stylefmt-loader

Short Description

This loader is meant to be used before pre-processing your css. It fixes stylelint issues automatically while bundling with Webpack.

During bundling, this loader will rewrite your css files with the corrections.

Usage

Inline

require("css!postcss!stylefmt!./file.css");
//or
require("css!sass!stylefmt!./file.scss");
//or any other preproccesor

In webpack.config.js

module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          "css-loader",
          "sass-loader",
          "stylefmt-loader"
        ]
      }
    ]
  }

You can also specify your stylelint for stylefmt to use:

module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          "css-loader",
          "sass-loader",
          {
            loader: "stylefmt-loader",
            options: {
              config: ".stylelintrc"
            }
          }
        ]
      }
    ]
  }

Your css before running webpack

// mixin for clearfix


@mixin      clearfix    ()      { &:before,
&:after {
     content:" ";
     display              : table;  }

&:after        {clear: both;}
}.class
 {
     padding:10px;@include        clearfix();}
.base {  color: red;  }

// placeholder
%base
 {


     padding: 12px
 }

.foo{
@extend      .base;}

.bar
{     @extend            %base;

}

Your css after running webpack

// mixin for clearfix


@mixin clearfix() {
	&:before,
	&:after {
		content: " ";
		display: table;
	}

	&:after {
		clear: both;
	}
}

.class {
	padding: 10px;
	@include clearfix();
}

.base {
	color: red;
}

// placeholder
%base {
	padding: 12px;
}

.foo {
	@extend .base;
}

.bar {
	@extend %base;
}

Want to help?

Please be specific in your issue. The code is not complex, why not proposing a PR?

Running tests

Right now there's only one test and is kind of automated, a cleaner solution would be nice.

$> npm run test

License

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

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].