Skip to content

Latest commit

History

History
70 lines (57 loc) 路 1.73 KB

README.md

File metadata and controls

70 lines (57 loc) 路 1.73 KB

馃洬 css-in-js-platform

npm version weekly downloads npm bundle size
NPM

馃摝 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).