10.10.34 • Published 3 years ago

@zedvision/emotion-primitives-core v10.10.34

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@zedvision/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 '@zedvision/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 '@zedvision/emotion-primitives-core'

const styled = createStyled(StyleSheet)

styled.Text = styled(Text)

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

<View><StyledText>Hello World</StyledText></View>
10.10.32

3 years ago

10.10.34

3 years ago

10.10.33

3 years ago

10.10.31

3 years ago

10.10.30

3 years ago

10.10.29

3 years ago

10.10.28

3 years ago

10.10.27

3 years ago

10.10.25

3 years ago

10.10.24

3 years ago

10.10.22

3 years ago

10.10.21

3 years ago

10.10.20

3 years ago

10.10.19

3 years ago

10.10.18

3 years ago

10.10.17

3 years ago

10.10.16

3 years ago

10.10.15

3 years ago