11.13.2 • Published 11 months ago

@emotion/primitives-core v11.13.2

Weekly downloads
86,364
License
MIT
Repository
github
Last release
11 months ago

@emotion/primitives-core

Shared utilities for emotion primitives and native

Introduction

Note: In most of the cases, you won't need this package and should use @emotion/native or @emotion/primitives.

This package contains some shared utilities which are consumed by @emotion/primitives and @emotion/native for styling and rendering components.

This package provides two functions, createCss and createStyled.

createCss(StyleSheet)

createCss accepts a platform specific StyleSheet method for creating styles, and returns a function which accepts styles via string template literal and object literal notation.

import { StyleSheet, View, Text } from 'react-native'
import { createCss } from '@emotion/primitives-core'

const css = createCss(StyleSheet)

<View style={css`background-color: red;`}><Text style={css`font-size: 40px;`}>Hello World</Text></View>

createStyled(StyleSheet)

createStyled also accepts a platform specific StyleSheet method for creating styles. It returns a function to which primitives can be assigned for example - View, Text, and it returns a styled component.

import { StyleSheet, View, Text } from 'react-native'
import { createStyled } from '@emotion/primitives-core'

const styled = createStyled(StyleSheet)

styled.Text = styled(Text)

const StyledText = styled.Text`font-size: 40px;`

<View><StyledText>Hello World</StyledText></View>
11.12.0

12 months ago

11.13.0

12 months ago

11.13.2

11 months ago

11.11.0

2 years ago

11.10.0

3 years ago

11.0.0

5 years ago

11.0.0-rc.0

5 years ago

11.0.0-next.19

5 years ago

11.0.0-next.18

5 years ago

11.0.0-next.17

5 years ago

11.0.0-next.16

5 years ago

11.0.0-next.15

5 years ago

11.0.0-next.14

5 years ago

11.0.0-next.13

5 years ago

11.0.0-next.12

5 years ago

11.0.0-next.10

5 years ago

10.0.27

6 years ago

11.0.0-next.9

6 years ago

11.0.0-next.8

6 years ago

11.0.0-next.7

6 years ago

11.0.0-next.6

6 years ago

11.0.0-next.5

6 years ago

11.0.0-next.4

6 years ago

11.0.0-next.3

6 years ago

11.0.0-next.2

6 years ago

11.0.0-next.1

6 years ago

11.0.0-next.0

6 years ago

10.0.22

6 years ago

10.0.14

6 years ago

10.0.1

7 years ago

10.0.0

7 years ago

10.0.0-beta.13

7 years ago

10.0.0-beta.12

7 years ago

10.0.0-beta.11

7 years ago

10.0.0-beta.10

7 years ago

10.0.0-beta.9

7 years ago

10.0.0-beta.8

7 years ago

10.0.0-beta.7

7 years ago

10.0.0-beta.6

7 years ago

10.0.0-beta.5

7 years ago

10.0.0-beta.4

7 years ago

10.0.0-beta.3

7 years ago

10.0.0-beta.2

7 years ago

10.0.0-beta.1

7 years ago

10.0.0-beta.0

7 years ago

9.2.9

7 years ago

9.2.7

7 years ago