Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@exah/prop-styles-system

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exah/prop-styles-system

Prop styles system for styled components

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

💔 prop-styles-system (WIP)

Props based system for styled components (glamorous, emotion)

Install

$ yarn add @exah/prop-styles-system

Usage

  1. Create prop styles
import { propStylesSystem, sizeProp } from '@exah/prop-styles-system' 

const helperProps = propStylesSystem({
  ht: sizeProp('height'),
  wd: sizeProp('width'),
  hide: { display: 'none' }
})
  1. Add to styled component
import styled from 'react-emotion'
import { helperProps } from './props'

const Box = styled.div(helperProps)
  1. Add css with props (+ change on values on mobile and tablet)
import { ThemeProvider } from 'emotion-theming'
import { createTheme } from '@exah/prop-styles-system' 

const theme = createTheme({
  media: {
    T: '(min-width: 601px) and (max-width: 1024px)',
    M: '(max-width: 600px)'
  }
})

<ThemeProvider theme={theme}>
  <Box ht={(1 / 2)} htT={300} wdT='100%' hideM />
</ThemeProvider>
  1. Expected output
.css-hash {
  height: 50%;
  @media (min-width: 601px) and (max-width: 1024px) {
    height: 300px;
    width: 100%;
  }
  @media (max-width: 600px) {
    display: none;
  }
}

MIT © John Grishin

FAQs

Package last updated on 05 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc