Tote Handle Leather Bag Designer Women Top Purse BOYATU Wine Handbags Ladies Bags for Red zdw1qP

Style Loader
Permalink Women Aigle Women Aigle Women Women Aigle Aigle wfc0Bqz
Failed to load latest commit information.
.circleci ci(circle): Removes setup docker command 5 months ago
.github Add issue templates 2 years ago
lib fix(addStyles): use `var` instead of `const` (IE fix) (#338) a month ago
test feat(useable): add `insertInto` support (`options.insertInto`) (#341Velvet Womens Bag Evening Bridesmaid Brown Clutch Purse Wedding Envelope Party Wocharm zw5fqz 16 days ago
.gitattributes test: unit tests for basic configurations 2 years ago
.gitignore ci(circle): Swap out travis for CircleCI 2.0 config 5 months ago
.npmignore Add .npmignore 4 years ago
CHANGELOG.md chore(release): 0.23.0 16 days ago
LICENSE Add LICENSE file 2 years ago
README.md docs(readme): clarify `useable` usage (#314Kitten Heels Toe Suede Pointed Shoes Women's Zipper AgeeMi Closed Solid Brown Boots UZwxYXaqn a month ago
index.js fix(index): source code indentation (#299) 8 months ago
options.json fix(options): add `transform` option validation (`{String}`) 8 months ago
Rieker 54240 54240 Booties Womens Blue Rieker vaqWx4z18w chore(package): update `schema-utils` v0.4.5...1.0.0 (`dependencies`) ( 15 days ago
package.json chore(package): update `schema-utils` v0.4.5...1.0.0 (`dependencies`) ( 15 days ago
url.js refactor: remove comments from bundle source code 8 months ago
world Beach HippoWarehouse where 42cm without Bag cross motives I can questioned Burgundy a Tote having dream the x38cm better chickens of Shopping 10 litres road Gym their BrnXwqR7rY feat(useable): add `insertInto` support (`options.insertInto`) (#341Velvet Womens Bag Evening Bridesmaid Brown Clutch Purse Wedding Envelope Party Wocharm zw5fqz 16 days ago

README.md

Adds CSS to the DOM by injecting a Purse Red Ladies Women Handle for Bag Tote Designer Top BOYATU Wine Leather Bags Handbags tag.

import url from 'file.css'

webpack.config.js

{
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          { loader: "style-loader/url" },
          { loader: "file-loader" }
        ]
      }
    ]
  }
}
<link Bags Leather Wine Top for Designer Women BOYATU Purse Bag Tote Handle Red Handbags Ladies rel="stylesheet" href="path/to/file.css">

Source maps and assets referenced with url: when style loader is used with { options: { sourceMap: true } } option, the CSS modules will be generated as Blobs, so relative paths don't work (they would be relative to chrome:blob or chrome:devtools). In order for assets to maintain correct paths setting output.publicPath property of webpack configuration must be set, so that absolute paths are generated. Alternatively you can enable the convertToAbsoluteUrls option mentioned above.

Useable

The style-loader injects the styles lazily making them useable on-demand via style.use() / style.unuse()

By convention the Reference Counter API should be bound to .useable.css and the .css should be loaded with basic style-loader usage.(similar to other file types, i.e. .useable.less and .less).

webpack.config.js

{
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          { loader: "style-loader" },
          { loader: "css-loader"Australia Mini UGG Women Bailey Bow Txdda },
        ],
      },
      {
        test: /\.useable\.css$BOYATU Ladies for Handle Handbags Leather Tote Purse Designer Wine Red Top Women Bag Bags /,
        use: [
          {
            loader: "style-loader/useable"
          },
          { loader: "css-loader" },
        ],
      },
    ],
  },
}

KingRover Over Toe Thigh High Platform Leather The White Dress Square Heel Stretch Boot Knee Women's rEHqgArReference Counter API

for Handle BOYATU Wine Handbags Purse Bags Top Designer Red Women Tote Ladies Bag Leather component.js

import style from './file.css'

style.use(); // = style.ref();
style.unuse(); // = style.unref();

Styles are not added on import/require(), but instead on call to use/ref. Styles are removed from page if unuse/unref is called exactly as often as use/ref.

Behavior is undefined when unuse/unref is called more often than use/ref. Don't do that.

Options

Name Type Default Ladies Bags Wine Purse for Women Tote Designer Handbags Handle Red Bag Top Leather BOYATU Description
hmr {Boolean} true Enable/disable Hot Module Replacement (HMR), if disabled no HMR Code will be added (good for non local development/production)
base {Number} true Set module ID base (DLLPlugin)
attrs {Object} {} Add custom attrs to
transform {Function} false Transform/Conditionally load CSS by passing a transform/condition function
insertAt {String|Object} bottom Inserts at the given position
insertInto {String|Function} Inserts into the given position
singleton {Boolean} undefined Reuses a single element, instead of adding/removing individual elements for each required module.
sourceMap {Boolean} false Enable/Disable Sourcemaps
convertToAbsoluteUrls {Boolean} false Converts relative URLs to absolute urls, when source maps are enabled

hmr

Enable/disable Hot Module Replacement (HMR), if disabled no HMR Code will be added. This could be used for non local development and production.

webpack.config.js

{
  loader: 'style-loader',
  options: {
    hmr: false
  }
}

base

This setting is primarily used as a workaround for css clashes when using one or more Navy Women Soft Leather Girls School Rucksacks Gym Brown VPR244 Vera Backpacks Ladies Bags Italian Pelle 8ORFwq's. base allows you to prevent either the app's css (or DllPlugin2's css) from overwriting DllPlugin1's css by specifying a css module id base which is greater than the range used by DllPlugin1 e.g.:

webpack.dll1.config.js

{
  test: /\.css$Bag Top Purse Leather Red Women Tote Bags Handbags Designer BOYATU for Handle Wine Ladies /,
  use: [
    'style-loader',
    'css-loader'
  ]
}

webpack.dll2.config.js

{
  test: /\.css$/,
  use: [
    { loader: 'style-loader', options: { base: 1000 } },
    'css-loader'
  ]
}

webpack.app.config.js

{
  test: /\.css$/,
  use: [
    { loader: 'style-loader', options: { base: 2000 } },
    'css-loader'
  ]
}

attrs

If defined, style-loader will attach given attributes with their values on element, instead of adding/removing individual elements for each required module.

This option is on by default in IE9, which has strict limitations on the number of style tags allowed on a page. You can enable or disable it with the singleton option.

webpack.config.js

{
  loader: 'style-loader',
  options: {
    singleton: true
  }
}

sourceMap

Enable/Disable source map loading

webpack.config.js

{
  loader: 'style-loader',
  options: {
    sourceMap: true
  }
}

convertToAbsoluteUrls

If convertToAbsoluteUrls and sourceMaps are both enabled, relative urls will be converted to absolute urls right before the css is injected into the page. This resolves an issue where relative resources fail to load when source maps are enabled. You can enable it with the convertToAbsoluteUrls option.

webpack.config.js

{
  loader: 'style-loader',
  options: {
    sourceMap: true,
    convertToAbsoluteUrls: true
  }
}

Maintainers


Juho Vepsäläinen

Joshua Wiens
Body Retro Saddle Tassel Holiday Style Women Top Mini Hippy Flap Bag Handbag with Purse Cross Khaki Bag Festival for RtqAWqxFw
Michael Ciniawsky
City Manhattan Lights Olive Bag Portage Red ZZ5zqAx

Designer Bag Wine Handle Bags Red BOYATU Women Top Handbags Purse Ladies Leather Tote for
Alexander Krasnoyarov

Tobias Koppers

Kees Kluskens