Socket
Socket
Sign inDemoInstall

css-in-js-platform

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    css-in-js-platform

Platform.select for native CSS-IN-JS solutions(styled-components, emotion, etc.)


Version published
Maintainers
1
Install size
11.1 kB
Created

Readme

Source

🛫 css-in-js-platform

📦 Installation

npm install css-in-js-platform
# Or with yarn
yarn add css-in-js-platform

🚀 Usage

You can use this module in 3 different ways.

import platform from 'css-in-js-platform';

const exampleText = styled.Text`
  ${platform({
    ios: css`
      font-size: 14px;
    `,
    android: css`
      font-size: 12px;
    `,
  })}
`;
import platform from 'css-in-js-platform';

const exampleText = styled.Text`
  font-size: 14px;

  ${platform('android', css`
    font-size: 14px;
  `)}
`;
import platform from 'css-in-js-platform';

const exampleText = styled.Text`
  font-size: 14px;

  ${platform.android(css`
    font-size: 14px;
  `)}
`;
  • The platform keys can be one of 'ios' | 'android' | 'macos' | 'windows' | 'web', which is from PlatformOSType of react-native(here).

FAQs

Last updated on 23 May 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc