0.4.58 • Published 4 years ago

rosebox v0.4.58

Weekly downloads
125
License
MIT
Repository
github
Last release
4 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

4 years ago

0.4.58

4 years ago

0.4.56

4 years ago

0.4.55

4 years ago

0.4.54

4 years ago

0.4.53

4 years ago

0.4.52

4 years ago

0.4.5

4 years ago

0.4.51

4 years ago

0.4.41

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.19

4 years ago

0.4.18

4 years ago

0.4.17

4 years ago

0.4.16

5 years ago

0.4.14

5 years ago

0.4.13

5 years ago

0.4.12

5 years ago

0.4.11

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.99

5 years ago

0.3.98

5 years ago

0.3.97

5 years ago

0.3.96

5 years ago

0.3.95

5 years ago

0.3.94

5 years ago

0.3.93

5 years ago

0.3.92

5 years ago

0.3.9

5 years ago

0.3.91

5 years ago

0.3.89

5 years ago

0.3.86

5 years ago

0.3.88

5 years ago

0.3.87

5 years ago

0.3.85

5 years ago

0.3.84

5 years ago

0.3.83

5 years ago

0.3.82

5 years ago

0.3.81

5 years ago

0.3.8

5 years ago

0.3.61

5 years ago

0.3.6

5 years ago

0.3.57

5 years ago

0.3.55

5 years ago

0.3.54

5 years ago

0.3.53

5 years ago

0.3.52

5 years ago

0.3.51

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.99

5 years ago

0.2.98

5 years ago

0.2.97

5 years ago

0.2.96

5 years ago

0.2.95

5 years ago

0.2.94

5 years ago

0.2.93

5 years ago

0.2.92

5 years ago

0.2.91

5 years ago

0.2.89

5 years ago

0.2.9

5 years ago

0.2.88

5 years ago

0.2.85

5 years ago

0.2.84

5 years ago

0.2.87

5 years ago

0.2.86

5 years ago

0.2.83

5 years ago

0.2.82

5 years ago

0.2.81

5 years ago

0.2.72

5 years ago

0.2.71

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.69

5 years ago

0.2.68

5 years ago

0.2.67

5 years ago

0.2.66

5 years ago

0.2.65

5 years ago

0.2.63

5 years ago

0.2.64

5 years ago

0.2.62

5 years ago

0.2.61

5 years ago

0.2.6

5 years ago

0.2.52

5 years ago

0.2.51

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.98

5 years ago

0.1.97

5 years ago

0.1.96

5 years ago

0.1.94

5 years ago

0.1.95

5 years ago

0.1.92

5 years ago

0.1.93

5 years ago

0.1.91

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago