0.5.5 • Published 5 years ago
candy-moon-native v0.5.5
candy-moon-native
Use candy-moon in React Native
Install
npm install candy-moon-nativeOr:
yarn add candy-moon-nativeUsage
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
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
5 years ago
0.5.4
5 years ago
0.5.3
5 years ago
0.5.2
5 years ago
0.5.0
5 years ago
0.5.1
5 years ago
0.4.0
5 years ago
0.3.0
5 years ago
0.2.9
5 years ago
0.2.7
5 years ago
0.2.6
5 years ago
0.2.8
5 years ago
0.2.5
5 years ago
0.2.4
5 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.1.17
5 years ago
0.1.18
5 years ago
0.1.16
5 years ago
0.1.15
5 years ago
0.1.14
5 years ago
0.1.13
5 years ago
0.1.12
5 years ago