# shadow-css-loader

> Inject css within ShadowDom

Latest version **0.4.1** (published 2019-04-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install shadow-css-loader
pnpm add shadow-css-loader
yarn add shadow-css-loader
bun add shadow-css-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.4.1 |
| Published | 2019-04-26 |
| First published | 2019-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 99.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bombadillo |
| Maintainers | arcadegandalf |
| Keywords | shadow-dom, react, styled-components |

## Links

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

## Dependencies (1)

- [clean-css](https://npm.io/package/clean-css.md) ^4.2.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.4.1 (latest) — 2019-04-26
- 0.4.0 — 2019-03-16
- 0.3.0 — 2019-03-16
- 0.2.0 — 2019-03-16
- 0.1.0 — 2019-03-16

## README

[![Build Status](https://travis-ci.org/bombadillo/shadow-css-loader.svg?branch=master)](https://travis-ci.org/bombadillo/shadow-css-loader)
[![npm version](https://badge.fury.io/js/shadow-css-loader.svg)](https://badge.fury.io/js/shadow-css-loader)
[![install size](https://packagephobia.now.sh/badge?p=shadow-css-loader)](https://packagephobia.now.sh/result?p=shadow-css-loader)

# shadow-css-loader

Load css using webpack within a shadow DOM.

# Getting Started

Install the package

`npm install --save-dev shadow-css-loader`

Then add the plugin to your `webpack` config. For example:

**webpack.config.js**

```js
module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader'],
      },
    ],
  },
};
```

Now you can import css files within your app in a shadow DOM:

**app.js**

```js
import css from 'app.css';
```

## Options

|                        Name                         |         Type          |     Default     |                          Description                         |
| :-------------------------------------------------: | :-------------------: | :-------------: | :------------------------------------------------------------|
| **[`customElementTagName`](#customElementTagName)** |      `{string}`       |   `undefined`   | The tag name of the custom element containing the shadow DOM |

### `customElementTagName`

Type: `string`
Default: `undefined`

The tag name of the custom element containing the shadow DOM. The css styles will be injected into the shadow DOM of this element.

**webpack.config.js**
```
{
  test: /\.css$/,
  use: [
    {
      loader: 'shadow-css-loader',
      options: {
        customElementTagName: 'my-element'
      }
    }
  ]
}
```

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