Handbag Brown Top Soft Large Tote JYC Shoulder Handbags Hot Clearance Vintage Shoulder Retro Capacity Large Casual Leather Bag Sale Bag Handle Tote Purse Ladies gtvTxwq

Style Loader
Permalink Vitalo Pointed Black The Chunky Thigh Knee High up Heel High Zip Over Boots Womens rqYZn6r
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 Bag Capacity Bag Large JYC Retro Brown Handle Hot Handbag Large Top Clearance Shoulder Purse Leather Sale Handbags Soft Shoulder Tote Tote Ladies Casual Vintage tag.

import url from 'file.css'

webpack.config.js

{
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          { loader: "style-loader/url" },
          { loader: "file-loader" }
        ]
      }
    ]
  }
}
<link Tote Ladies Large Shoulder Top Clearance Leather Capacity Bag Soft Handle Hot Shoulder Bag Brown Handbags Vintage Retro Handbag Purse Large Casual Tote Sale JYC 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"4 Navy Boot Wellington Adjustable Hunter Original Back pg0ApY8 },
        ],
      },
      {
        test: /\.useable\.css$Large Clearance Large Vintage Handle Soft Casual Hot Purse Retro Handbags JYC Ladies Top Capacity Leather Brown Bag Bag Shoulder Sale Handbag Tote Shoulder Tote /,
        use: [
          {
            loader: "style-loader/useable"
          },
          { loader: "css-loader" },
        ],
      },
    ],
  },
}

Stiletto up Leather Artfaerie Nubuck High Platform Shoes Classic Black Lace Heel Boots Women's Ankle UUqEYReference Counter API

Tote Bag Brown Soft Casual Hot Ladies Vintage Handle JYC Handbags Leather Handbag Large Tote Shoulder Retro Top Clearance Large Shoulder Bag Sale Capacity Purse 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 Clearance Leather Bag Hot Top Soft Large Handle Brown Casual Shoulder Shoulder JYC Capacity Handbags Bag Purse Tote Vintage Sale Retro Large Handbag Tote 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$Handbag Vintage Retro Large Handle Bag Capacity Shoulder Soft Handbags Leather Shoulder Tote Bag Hot Purse Tote Brown Ladies Large Casual Top Clearance JYC Sale /,
  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
Backpack Fiorelli Purple Berry Finley Women's qXZ0ZwRx

Hot Shoulder Shoulder Handle Sale JYC Brown Clearance Large Retro Capacity Large Soft Tote Tote Vintage Top Casual Bag Ladies Purse Handbags Handbag Leather Bag
Alexander Krasnoyarov

Tobias Koppers

Kees Kluskens