# jigcss

> A css-in-js module for jigjs

Latest version **0.0.0-pre-alpha.31** (published 2020-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install jigcss
pnpm add jigcss
yarn add jigcss
bun add jigcss
```

## 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.0-pre-alpha.31 |
| Published | 2020-07-21 |
| First published | 2020-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Carlos Maniero |
| Maintainers | carlosmaniero |

## Links

- npm: https://www.npmjs.com/package/jigcss
- Repository: https://github.com/carlosmaniero/jigjs
- Homepage: https://github.com/carlosmaniero/jigjs#readme
- Issues: https://github.com/carlosmaniero/jigjs/issues
- npm.io page: https://npm.io/package/jigcss

## Dependencies (1)

- [jigjs](https://npm.io/package/jigjs.md) ^0.0.0-pre-alpha.25

## Recent versions

- 0.0.0-pre-alpha.31 (latest) — 2020-07-21
- 0.0.0-pre-alpha.30 — 2020-07-19
- 0.0.0-pre-alpha.29 — 2020-07-19
- 0.0.0-pre-alpha.28 — 2020-07-19
- 0.0.0-pre-alpha.27 — 2020-07-19
- 0.0.0-pre-alpha.26 — 2020-07-19
- 0.0.0-pre-alpha.25 — 2020-07-19
- 0.0.0-pre-alpha.24 — 2020-07-18
- 0.0.0-pre-alpha.23 — 2020-07-18
- 0.0.0-pre-alpha.22 — 2020-07-17
- 0.0.0-pre-alpha.21 — 2020-07-17
- 0.0.0-pre-alpha.20 — 2020-07-16
- 0.0.0-pre-alpha.19 — 2020-07-14
- 0.0.0-pre-alpha.18 — 2020-07-12
- 0.0.0-pre-alpha.17 — 2020-07-12
- … 5 more at https://npm.io/package/jigcss/versions

## README

<p align="center" style="color: #343a40">
  <p align="center" >
    <img src="ghassets/logo.svg" alt="jigcss" align="center">
  </p>
  <h1 align="center">css in js for jigjs</h1>
</p>

![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
![Jig](https://github.com/carlosmaniero/jigjs/workflows/JigCss/badge.svg) 
![npm version](https://badge.fury.io/js/jigcss.svg)
[![Coverage Status](https://codecov.io/gh/carlosmaniero/jigjs/branch/main/graph/badge.svg?flag=jigcss)](https://codecov.io/gh/carlosmaniero/jigjs)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)

This package enables runtime CSS-in-JS. No babel required.

## Installation

```shell script
npm install jigcss
```

# Usage

```typescript
import {css} from 'jigcss';


@component()
class MyComponent {
  // Simple class
  private static readonly helloClassName = css`
    & {
      background-color: black;
      color: red;
    }
  `;

  // class with extra selectors
  private static readonly byeClassName = css`
      & {
        backgroundColor: black;
        color: red;
      }

      &:hover {
        color: blue;
      }

      & a {
        color: green;
      }

      @media: {
        screen and (min-width: 700px): {
          &: {
            color: 'blue',
          }
        }
      }
    `;

  constructor(window) {

    
  }

  render() {
    return html`      
      <div class="${this.helloClassName}">Hello, World!</div>
      <div class="${this.byeClassName}">Bye! <a href="#">Go Home</a></div>
      <div class="${css`
        & { 
          background: red;
        }`}"></div>
    `
  }
}
```

## The `&` wildcard

The `&` wildcard will be replaced with the class name.

There is no option yet to have a class without providing the '&' character such as
(styled-components)[https://github.com/styled-components/styled-components] or (emotion)[https://github.com/emotion-js/emotion]

## TODO:

- Keyframes

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