Skip to content

Commit d29bea2

Browse files
committed
docs: create specification
0 parents  commit d29bea2

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# 🛫 styled-platform
2+
3+
## 📦 Installation
4+
5+
```bash
6+
npm install styled-platform
7+
# Or with yarn
8+
yarn add styled-platform
9+
```
10+
11+
## 🚀 Usage
12+
You can use this module in 3 different ways.
13+
14+
```tsx
15+
import platform, { css } from 'styled-platform';
16+
17+
const exampleText = styled.Text`
18+
${platform({
19+
ios: css`
20+
font-size: 14px;
21+
`,
22+
android: css`
23+
font-size: 12px;
24+
`,
25+
})}
26+
`;
27+
```
28+
29+
```tsx
30+
import platform, { css } from 'styled-platform';
31+
32+
const exampleText = styled.Text`
33+
font-size: 14px;
34+
35+
${platform('android', css`
36+
font-size: 14px;
37+
`)}
38+
`;
39+
```
40+
41+
```tsx
42+
import platform, { css } from 'styled-platform';
43+
44+
const exampleText = styled.Text`
45+
font-size: 14px;
46+
47+
${platform.android(css`
48+
font-size: 14px;
49+
`)}
50+
`;
51+
```
52+
53+
- The platform keys can be one of `'ios' | 'android' | 'macos' | 'windows' | 'web'`, which is from `PlatformOSType` of `react-native`([here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-native/index.d.ts#L5755)).

0 commit comments

Comments
 (0)