Skip to content

๐Ÿ“ Intuitive responsive props system for styled components.

Notifications You must be signed in to change notification settings

markoradak/styled-responsive-props

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ styled-responsive-props

Intuitive responsive props system for styled components.

NPM JavaScript Style Guide

Install

npm install --save @markoradak/styled-responsive-props

Usage

Register within styled component:

${responsiveProp([cssProp, reactProp, ?defaultValue])}

Use within render:

<Box direction={[?default, [minWidth, value, maxWidth]}>

Example:

import React from 'react'
import styled from 'styled-components';
import { responsiveProp } from "styled-responsive-props";

const Box = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  ${responsiveProp(["flex-direction", "direction"])}
`;

const Example = ({ children }) => (
  <Box direction={["column", [1024, "row"]}>
    {children}
  </Box>
)

License

MIT ยฉ markoradak

About

๐Ÿ“ Intuitive responsive props system for styled components.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •