# rosebox

> CSS-in-TS

Latest version **0.4.58** (published 2020-12-16) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.4.58 |
| Published | 2020-12-16 |
| First published | 2020-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 800.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Hugo Nteifeh |
| Maintainers | hugo.nteifeh |
| Keywords | Functional css, declarative styling, Typed CSS |

## Links

- npm: https://www.npmjs.com/package/rosebox
- Repository: https://github.com/hugonteifeh/rosebox
- Homepage: https://github.com/hugonteifeh/rosebox#readme
- Issues: https://github.com/hugonteifeh/rosebox/issues
- npm.io page: https://npm.io/package/rosebox

## Dependencies (9)

- [jss](https://npm.io/package/jss.md) ^10.5.0
- [ramda](https://npm.io/package/ramda.md) ^0.27.1
- [react-jss](https://npm.io/package/react-jss.md) ^10.5.0
- [jss-plugin-global](https://npm.io/package/jss-plugin-global.md) ^10.5.0
- [jss-plugin-nested](https://npm.io/package/jss-plugin-nested.md) ^10.5.0
- [jss-plugin-camel-case](https://npm.io/package/jss-plugin-camel-case.md) ^10.5.0
- [jss-plugin-props-sort](https://npm.io/package/jss-plugin-props-sort.md) ^10.5.0
- [jss-plugin-vendor-prefixer](https://npm.io/package/jss-plugin-vendor-prefixer.md) ^10.5.0
- [jss-plugin-rule-value-function](https://npm.io/package/jss-plugin-rule-value-function.md) ^10.5.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.4.58 (latest) — 2020-12-16
- 0.4.57 — 2020-12-15
- 0.4.56 — 2020-12-15
- 0.4.55 — 2020-12-13
- 0.4.54 — 2020-12-13
- 0.4.53 — 2020-12-13
- 0.4.52 — 2020-12-12
- 0.4.51 — 2020-12-10
- 0.4.5 — 2020-12-10
- 0.4.41 — 2020-12-09
- 0.4.4 — 2020-12-08
- 0.4.3 — 2020-12-07
- 0.4.2 — 2020-12-07
- 0.4.19 — 2020-12-07
- 0.4.18 — 2020-12-07
- … 100 more at https://npm.io/package/rosebox/versions

## README

<p align="center">
<img width="400" style="margin-left: auto; margin-right:auto; display: block" alt="portfolio_view" src="./logo.svg">
</p>

# Rosebox

The Rosebox project is an effort to improve the CSS-in-JS experience by providing features like strong types (e.g., [`Length`](https://www.rosebox.dev/api/#rb-type-length)), typed functions (e.g., [`linGrad`](https://www.rosebox.dev/api/#rb-vc-lingrad)), extra shorthand properties(e.g., [`marginX`](https://www.rosebox.dev/api/#rb-prop-paddingx), [`paddingX`](https://www.rosebox.dev/api/#rb-prop-paddingx)), an object-based syntax for the values of complex properties (e.g., [`animation`](https://www.rosebox.dev/api/#rb-prop-animation)), and support for high-quality IntelliSense.

## Installation

```shell
npm i rosebox
```

## Example

Here is a simple example of how you can use rosebox in your react-app:

```tsx

import React from "react";
import { px, ms, rgb } from "rosebox";
import { StylesProvider, createUseStyles } from 'rosebox/styles-manager'
import useHover from "@react-hook/hover";

const useStyles = createUseStyles({
  titleStyle: {
    fontSize: px(48),
    transitionDuration: ms(300),
    transitionTimingFunction: 'ease-in-out',
    // props will be provided by the component using the created hook
    color: props => props.isHovering ? rgb(244, 244, 244) : 'blue',
    transitionProperty: props => props.isHovering ? 'color' : 'none'
  }
});

const MyHoverableComponent: React.FC = () => {
  const target = React.useRef(null);
  const isHovering = useHover(target);
  // Passing "props" to useStyles
  const classes = useStyles({
    isHovering: isHovering
  });
  return (
    <div>
      <h1 ref={target} className={classes.titleStyle}>
        Hover over me please
      </h1>
    </div>
  );
};

function App() {
  return (
    <StylesProvider>
      <MyHoverableComponent />
    </StylesProvider>
  );
}

export default App;

```

## IMPORTANT NOTE 📢

Already today, you can use all the CSS properties in Rosebox. Missing ones in the api only indicate that they are not **YET** strongly typed. The library exposes all untyped/loosely-typed properties by prefixing them with an underscore (e.g., `_borderImageStyle`, `_all`). These loosely-typed props have a type of `string`. When a property becomes strongly-typed, its underscore-prefixed version gets deprecated immediately. However, its removal may only be considered after a minimum of 2 major releases since the deprecation—for example, if `_borderImageStyle` gets deprecated in 0.6.4, it means that it will be removed in 2.0.0.

## Docs

[Docs](https://rosebox.dev)

## Demos and more examples (using inline-styling)

- [A Simple image carousel](https://codesandbox.io/s/image-carousel-rosebox-h1urb?file=/src/App.tsx)
- More examples of react-components using Rosebox can be found [here](https://github.com/hugonteifeh/react-components)

## Roadmap and future releases

Refer to [milestones](https://github.com/hugonteifeh/rosebox/milestones/) for information about releases and the [roadmap project](https://github.com/hugonteifeh/rosebox/projects/12) for roadmap.

## Contribute

There are many way in which you can contribute:

* Submit a feature request.
* Report a bug.
* Suggest a useful integration with another library.

## Help and questions 🙋

If you have a question or need help, feel free to create an issue here 👌.

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