css-in-js-platform
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

🛫 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).

/css-in-js-platform/

    Package Sidebar

    Install

    npm i css-in-js-platform

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    5.83 kB

    Total Files

    10

    Last publish

    Collaborators

    • junhoyeo