0.5.5 • Published 3 years ago

candy-moon-native v0.5.5

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

candy-moon-native

Use candy-moon in React Native

Install

npm install candy-moon-native

Or:

yarn add candy-moon-native

Usage

Style Object syntax

import { SafeAreaView, View, Text } from "react-native";
import { sx } from "candy-moon-native";

const App = () => (
  <SafeAreaView style={sx({ w: "full", h: "full" })}>
    <View style={sx({ bg: "blue.200", px: 3, py: 1, rounded: "full" })}>
      <Text style={sx({ color: "blue.800", fontWeight: "semibold" })}>
        Hello World
      </Text>
    </View>
  </SafeAreaView>
);

Tagged template syntax

import { SafeAreaView, View, Text } from "react-native";
import { cls } from "candy-moon-native";

const App = () => (
  <SafeAreaView style={cls`w-full h-full`}>
    <View style={cls`bg-blue-200 px-3 py-1 rounded-full`}>
      <Text style={cls`text-blue-800 font-semibold`}>Hello World</Text>
    </View>
  </SafeAreaView>
);

Note: Both sx or cls function return id created by StyleSheet. If you want to return simple object with style try: sx.raw or cls.raw

Supported Utilities

Layout

  • Display
  • Overflow
  • Position
  • Top / Right / Bottom / Left
  • Z-Index
  • Aspect Ratio
  • Direction

Flex box

  • Flex direction
  • Flex Wrap
  • Align Items
  • Align Content
  • Align Self
  • Justify Content
  • Flex
  • Flex Grow
  • Flex Shrink
  • Flex Basis

Spacing

  • Padding
  • Margin

Sizing

  • Width
  • Min-Width
  • Max-Width
  • Height
  • Min-Height
  • Max-Height

Typography

  • Font Family
  • Font Size
  • Font Style
  • Font Variant
  • Font Weight
  • Letter Spacing
  • Line Height
  • Text Align
  • Text Color
  • Text Opacity
  • Text Decoration
  • Text Decoration Color
  • Text Decoration Opacity
  • Text Shadow
  • Text Transform
  • Vertical Alignment
  • Include Font Padding

Backgrounds

  • Background Color
  • Background Opacity

Borders

  • Border Radius
  • Border Width
  • Border Color
  • Border Opacity
  • Border Style

Effects

  • Box Shadow
  • Oapcity

Image

  • Backface Visibility
  • Resize Mode
  • Tint Color
  • Tint Opacity
  • Overlay Color
  • Overlay Opacity

Theme

Read more →

What's missing?

Variants

Basically, candy-moon-native doesn't support variants. But, I have a few ideas about them:

For example about platform variants: web:, ios:, android:

Happy to see you open issue if you have any ideas.

0.5.5

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.8

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.17

3 years ago

0.1.18

3 years ago

0.1.16

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago