Skip to content

Commit 181c069

Browse files
committed
docs: convert homepage to standard docs layout
Replace splash template with standard doc layout: - Remove hero section and custom components - Convert feature cards to markdown list - Change from index.mdx to index.md - Increase content width to 55rem - Remove unused hero CSS styles
1 parent c4c4454 commit 181c069

File tree

3 files changed

+75
-152
lines changed

3 files changed

+75
-152
lines changed

docs/src/content/docs/index.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Introduction
3+
description: Compile-time Tailwind CSS for React Native with zero runtime overhead
4+
---
5+
6+
Compile-time Tailwind CSS for React Native with zero runtime overhead. Transform `className` props to optimized `StyleSheet.create()` calls at build time.
7+
8+
## Features
9+
10+
- **⚡ Zero Runtime Overhead** - All transformations happen at compile time
11+
- **🔧 No Dependencies** - Direct-to-React-Native style generation without tailwindcss package
12+
- **🎯 Babel-only Setup** - No Metro configuration required
13+
- **📝 TypeScript-first** - Full type safety and autocomplete support
14+
- **🚀 Optimized Performance** - Compiles down to StyleSheet.create for optimal performance
15+
- **📦 Small Bundle Size** - Only includes actual styles used in your app
16+
- **🎨 Custom Colors** - Extend the default palette via tailwind.config.*
17+
- **📐 Arbitrary Values** - Use custom sizes and borders: `w-[123px]`, `rounded-[20px]`
18+
- **🔀 Dynamic className** - Conditional styles with hybrid compile-time optimization
19+
- **🏃 Runtime Option** - Optional tw template tag for fully dynamic styling (~25KB)
20+
- **🎯 State Modifiers** - `active:`, `hover:`, `focus:`, and `disabled:` modifiers for interactive components
21+
- **📱 Platform Modifiers** - `ios:`, `android:`, and `web:` modifiers for platform-specific styling
22+
- **🌓 Color Scheme Modifiers** - `dark:` and `light:` modifiers for automatic theme adaptation
23+
- **🎨 Scheme Modifier** - `scheme:` convenience modifier that expands to both dark: and light: variants
24+
- **📜 Special Style Props** - Support for `contentContainerClassName`, `columnWrapperClassName`, and more
25+
- **🎛️ Custom Attributes** - Configure which props to transform with exact matching or glob patterns
26+
27+
## Quick Example
28+
29+
```tsx
30+
import { View, Text } from "react-native";
31+
32+
export function MyComponent() {
33+
return (
34+
<View className="flex-1 bg-gray-100 p-4">
35+
<Text className="text-xl font-bold text-blue-500">Hello, Tailwind!</Text>
36+
</View>
37+
);
38+
}
39+
```
40+
41+
**Transforms to:**
42+
43+
```tsx
44+
import { StyleSheet } from "react-native";
45+
46+
export function MyComponent() {
47+
return (
48+
<View style={_twStyles._bg_gray_100_flex_1_p_4}>
49+
<Text style={_twStyles._font_bold_text_blue_500_text_xl}>Hello, Tailwind!</Text>
50+
</View>
51+
);
52+
}
53+
54+
const _twStyles = StyleSheet.create({
55+
_bg_gray_100_flex_1_p_4: {
56+
flex: 1,
57+
backgroundColor: "#F3F4F6",
58+
padding: 16,
59+
},
60+
_font_bold_text_blue_500_text_xl: {
61+
fontWeight: "700",
62+
color: "#3B82F6",
63+
fontSize: 20,
64+
},
65+
});
66+
```
67+
68+
## Getting Started
69+
70+
Follow the [installation guide](/react-native-tailwind/getting-started/installation/) to set up React Native Tailwind in your project, then check out the [quick start](/react-native-tailwind/getting-started/quick-start/) to learn the basics.

docs/src/content/docs/index.mdx

Lines changed: 0 additions & 121 deletions
This file was deleted.

docs/src/styles/custom.css

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/* Custom theme colors - Blue accent */
22

3+
/* Layout - Adjust content width */
4+
:root {
5+
--sl-content-width: 55rem; /* Default is 45rem */
6+
}
7+
38
/* Code Block Styling */
49

510
/* Code block container */
@@ -41,34 +46,3 @@ code:not(pre code) {
4146
background-color: var(--sl-color-gray-5);
4247
border-color: var(--sl-color-gray-4);
4348
}
44-
45-
/* Hero Section Styling */
46-
47-
/* Reduce hero height */
48-
.hero {
49-
padding-top: 3rem !important;
50-
padding-bottom: 3rem !important;
51-
}
52-
53-
/* Make hero title more compact */
54-
.hero h1 {
55-
font-size: 2.5rem !important;
56-
margin-bottom: 1rem !important;
57-
}
58-
59-
/* Reduce tagline spacing */
60-
.hero .tagline {
61-
font-size: 1.125rem !important;
62-
margin-bottom: 1.5rem !important;
63-
}
64-
65-
/* Reduce hero image size */
66-
.hero .hero-image {
67-
max-width: 300px !important;
68-
}
69-
70-
/* Make action buttons more compact */
71-
.hero .actions {
72-
margin-top: 1.5rem !important;
73-
gap: 0.75rem !important;
74-
}

0 commit comments

Comments
 (0)