0.1.0 • Published 3 years ago
react-native-turbo-styles v0.1.0
React Native Turbo Styles is a TailwindCSS-inspired styling library for React Native with a goal of:
- Design by constraints (using theme-constraints to guide design).
- Styling ergonomics (short, nemonic "names" for styles, similar to utility classes in CSS).
- Strongly-typed.
Installation
Install the library with:
# With Yarn
yarn add react-native-turbo-styles
# With NPM
npm install react-native-turbo-styles
There are no hard requirements/dependencies for TurboStyles, but the library makes heavy use of TypeScript template literal types. These were release in TS 4.1, and therefore for type-safety/inference to work as intended, you must be using at least TS 4.1.0.
Usage
To use the library, you create a style builder (by providing constraints) and then use the style builder to style things!
import * as React from "react";
import { View } from "react-native";
import {
createStyleBuilder,
defaultConstraints,
} from "react-native-turbo-styles";
const { builder: ts } = createStyleBuilder(defaultConstraints);
const MyComponent: React.FC = () => {
return (
<View style={ts("flex:1", "justify:center", "items:center", "bg:blue-300")}>
<View style={ts("w:32", "h:32", "bg:white", "shadow:lg")} />
</View>
);
};
TODO:
- letterSpacing (tracking)
- lineHeight (leading)
- Text shadows?
0.1.0
3 years ago
0.0.23
3 years ago
0.0.22
3 years ago
0.0.21
3 years ago
0.0.20
3 years ago
0.0.19
3 years ago
0.0.18
3 years ago
0.0.17
3 years ago
0.0.16
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.13
3 years ago
0.0.11
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.1
3 years ago