Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Aug 6, 2019. It is now read-only.
/extrasPublic archive

Reference components for using styled-system to build custom styled components

NotificationsYou must be signed in to change notification settings

rebassjs/extras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Reference components for using styled-system to build custom styled components. Copy and paste these components and customize them however you see fit.

Hide

importReactfrom'react'importstyledfrom'styled-components'import{display}from'styled-system'importhoistStaticsfrom'hoist-non-react-statics'import{Box}from'rebass'constmapProps=map=>Component=>hoistStatics(props=><Component{...map(props)}/>,Component)exportconstBase=styled(Box)(display)exportconstHide=mapProps(({  xsmall,  small,  medium,  large,  xlarge,  display,  ...props,})=>({display:display||[xsmall,small,medium,large,xlarge].map(n=>n ?'none' :'block'),  ...props,}))(Base)exportdefaultHide
<Hidexsmallsmall/>

Position

importstyledfrom'styled-components'import{position,zIndex,top,right,bottom,left,}from'styled-system'import{Box}from'rebass'exportconstPosition=styled(Box)(position,zIndex,top,right,bottom,left)exportconstRelative=styled(Position)([])Relative.defaultProps={position:'relative'}exportconstAbsolute=styled(Position)([])Absolute.defaultProps={position:'absolute'}exportconstFixed=styled(Position)([])Fixed.defaultProps={position:'fixed'}exportconstSticky=styled(Position)([])Sticky.defaultProps={position:'sticky'}

About

Reference components for using styled-system to build custom styled components

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp