0.4.58 • Published 3 years ago

rosebox v0.4.58

Weekly downloads
125
License
MIT
Repository
github
Last release
3 years ago

Rosebox

The Rosebox project is an effort to improve the CSS-in-JS experience by providing features like strong types (e.g., Length), typed functions (e.g., linGrad), extra shorthand properties(e.g., marginX, paddingX), an object-based syntax for the values of complex properties (e.g., animation), and support for high-quality IntelliSense.

Installation

npm i rosebox

Example

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

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

Demos and more examples (using inline-styling)

Roadmap and future releases

Refer to milestones for information about releases and the roadmap project 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 👌.

0.4.57

3 years ago

0.4.58

3 years ago

0.4.56

3 years ago

0.4.55

3 years ago

0.4.54

3 years ago

0.4.53

3 years ago

0.4.52

3 years ago

0.4.5

3 years ago

0.4.51

3 years ago

0.4.41

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.19

3 years ago

0.4.18

3 years ago

0.4.17

3 years ago

0.4.16

3 years ago

0.4.14

3 years ago

0.4.13

3 years ago

0.4.12

3 years ago

0.4.11

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.99

3 years ago

0.3.98

3 years ago

0.3.97

3 years ago

0.3.96

3 years ago

0.3.95

3 years ago

0.3.94

3 years ago

0.3.93

3 years ago

0.3.92

3 years ago

0.3.9

3 years ago

0.3.91

3 years ago

0.3.89

3 years ago

0.3.86

3 years ago

0.3.88

3 years ago

0.3.87

3 years ago

0.3.85

3 years ago

0.3.84

3 years ago

0.3.83

3 years ago

0.3.82

4 years ago

0.3.81

4 years ago

0.3.8

4 years ago

0.3.61

4 years ago

0.3.6

4 years ago

0.3.57

4 years ago

0.3.55

4 years ago

0.3.54

4 years ago

0.3.53

4 years ago

0.3.52

4 years ago

0.3.51

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.99

4 years ago

0.2.98

4 years ago

0.2.97

4 years ago

0.2.96

4 years ago

0.2.95

4 years ago

0.2.94

4 years ago

0.2.93

4 years ago

0.2.92

4 years ago

0.2.91

4 years ago

0.2.89

4 years ago

0.2.9

4 years ago

0.2.88

4 years ago

0.2.85

4 years ago

0.2.84

4 years ago

0.2.87

4 years ago

0.2.86

4 years ago

0.2.83

4 years ago

0.2.82

4 years ago

0.2.81

4 years ago

0.2.72

4 years ago

0.2.71

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.69

4 years ago

0.2.68

4 years ago

0.2.67

4 years ago

0.2.66

4 years ago

0.2.65

4 years ago

0.2.63

4 years ago

0.2.64

4 years ago

0.2.62

4 years ago

0.2.61

4 years ago

0.2.6

4 years ago

0.2.52

4 years ago

0.2.51

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.98

4 years ago

0.1.97

4 years ago

0.1.96

4 years ago

0.1.94

4 years ago

0.1.95

4 years ago

0.1.92

4 years ago

0.1.93

4 years ago

0.1.91

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago