How to use @emotion/primitives-core - 4 common examples

To help you get started, we’ve selected a few @emotion/primitives-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emotion-js / emotion / packages / primitives / src / index.js View on Github external
// @flow
import { StyleSheet, Text, View, Image } from 'react-primitives'
import { createCss } from '@emotion/primitives-core'

import { styled as createStyled } from './styled'

const css = createCss(StyleSheet)

const assignPrimitives = styled => {
  createStyled.Text = createStyled(Text)
  createStyled.View = createStyled(View)
  createStyled.Image = createStyled(Image)

  return styled
}

export { css }

export default /* #__PURE__ */ assignPrimitives(createStyled)
github emotion-js / emotion / packages / native / src / index.js View on Github external
import * as reactNative from 'react-native'
import { createCss } from '@emotion/primitives-core'

import { styled } from './styled'

const css = createCss(reactNative.StyleSheet)

const components = [
  'ActivityIndicator',
  'ActivityIndicatorIOS',
  'ART',
  'Button',
  'DatePickerIOS',
  'DrawerLayoutAndroid',
  'Image',
  'ImageBackground',
  'ImageEditor',
  'ImageStore',
  'KeyboardAvoidingView',
  'ListView',
  'MapView',
  'Modal',
github emotion-js / emotion / packages / native / src / styled.js View on Github external
import { StyleSheet } from 'react-native'
import { createStyled } from '@emotion/primitives-core'

/**
 * a function that returns a styled component which render styles in React Native
 */
let styled = createStyled(StyleSheet)

export { styled }
github emotion-js / emotion / packages / primitives / src / styled.js View on Github external
/**
 * a function that returns a styled component which render styles on multiple targets with same code
 */

type CreateStyledComponent = (...styles: any) => React.ElementType

type BaseStyled = (tag: React.ElementType) => CreateStyledComponent

export type Styled = BaseStyled & {
  View: CreateStyledComponent,
  Text: CreateStyledComponent,
  Image: CreateStyledComponent
}

let styled: Styled = createStyled(StyleSheet, { getShouldForwardProp })

export { styled }

@emotion/primitives-core

Shared utilities for emotion primitives and native

MIT
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis