styleshape

0.1.1 • Public • Published

styleshape

Create components with default styles passed to style.

  • 180 bytes
  • 0 dependencies

Example

import shape from "styleshape";
 
const SliderWrapper = shape("div")({
  position: "relative",
  whiteSpace: "nowrap",
  overflowX: "hidden",
  textAlign: "center",
  userSelect: "none"
});
 
const SliderTracker = shape("div")(props => ({
  width: "100%",
  display: "flex",
  alignItems: "stretch",
  transtion: "all 0.3s ease",
  margin: `${-props.gutter / 2}px`
}));
 
const Slide = shape("div")(props => ({
  position: "static",
  whiteSpace: "normal",
  overflowX: "visible",
  textAlign: "left",
  flexShrink: 0,
  margin: `${props.gutter / 2}px`
}));
<SliderWrapper>
  <SliderTracker gutter={10}>
    <Slide>First slide</Slide>
    <Slide>Second slide</Slide>
  </SliderTracker>
</SliderWrapper>

Readme

Keywords

none

Package Sidebar

Install

npm i styleshape

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

2.51 kB

Total Files

5

Last publish

Collaborators

  • renatorib