@usecross/docs 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usecross/docs",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "Documentation framework built on Cross-Inertia",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,8 +17,7 @@
17
17
  "development": "./src/ssr.tsx",
18
18
  "default": "./dist/ssr.js"
19
19
  },
20
- "./styles.css": "./src/styles.css",
21
- "./tailwind.preset": "./src/tailwind.preset.cjs"
20
+ "./styles.css": "./src/styles.css"
22
21
  },
23
22
  "files": [
24
23
  "dist",
package/src/styles.css CHANGED
@@ -1,22 +1,49 @@
1
1
  /**
2
- * Cross-Docs default styles
2
+ * Cross-Docs default styles (Tailwind CSS v4)
3
3
  *
4
- * Import this file in your app's CSS entry point:
4
+ * Import this file in your app's CSS entry point after importing Tailwind:
5
+ *
6
+ * @import "tailwindcss";
7
+ * @plugin "@tailwindcss/typography";
8
+ * @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');
5
9
  * @import '@usecross/docs/styles.css';
10
+ * @source "../node_modules/@usecross/docs";
11
+ *
12
+ * Note: The @source directive ensures Tailwind scans the package for utility classes.
13
+ * Note: The Google Fonts import must come before other imports to avoid CSS ordering warnings.
6
14
  */
7
15
 
8
- @reference "tailwindcss";
9
-
10
- @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');
16
+ /* Theme customizations for Tailwind v4 */
17
+ @theme {
18
+ /* Max width */
19
+ --max-width-8xl: 88rem;
20
+
21
+ /* Font families */
22
+ --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial,
23
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
24
+ --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
25
+ --font-mono: 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
26
+
27
+ /* Default primary colors - sky blue (can be overridden via CSS variables) */
28
+ --color-primary-50: #f0f9ff;
29
+ --color-primary-100: #e0f2fe;
30
+ --color-primary-200: #bae6fd;
31
+ --color-primary-300: #7dd3fc;
32
+ --color-primary-400: #38bdf8;
33
+ --color-primary-500: #0ea5e9;
34
+ --color-primary-600: #0284c7;
35
+ --color-primary-700: #0369a1;
36
+ --color-primary-800: #075985;
37
+ --color-primary-900: #0c4a6e;
38
+ --color-primary-950: #082f49;
39
+
40
+ /* Dark colors for code blocks */
41
+ --color-dark-800: #1e293b;
42
+ --color-dark-900: #0f172a;
43
+ }
11
44
 
12
45
  @layer base {
13
46
  :root {
14
- /* Font stacks */
15
- --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial,
16
- sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
17
- --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
18
- --font-mono: 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
19
-
20
47
  /* Code highlighting - matches Starlight/Expressive Code dark theme */
21
48
  --shiki-color-text: #e2e8f0;
22
49
  --shiki-color-background: #24292f;
@@ -41,11 +68,9 @@
41
68
  }
42
69
 
43
70
  body {
44
- @apply antialiased;
71
+ @apply antialiased bg-white text-gray-800;
45
72
  font-family: var(--font-sans);
46
73
  font-weight: 400;
47
- background: #ffffff;
48
- color: #1f2937;
49
74
  }
50
75
 
51
76
  /* Headings use heading font */
@@ -63,10 +88,21 @@
63
88
  @layer components {
64
89
  /* Prose content styles */
65
90
  .prose {
91
+ max-width: none;
66
92
  font-size: 1rem;
67
93
  line-height: 1.75;
68
94
  }
69
95
 
96
+ /* Prose link styling */
97
+ .prose a {
98
+ @apply text-primary-600 hover:text-primary-700;
99
+ }
100
+
101
+ /* Dark mode prose link styling */
102
+ .prose-invert a {
103
+ @apply text-primary-400 hover:text-primary-300;
104
+ }
105
+
70
106
  /* Scroll margin for headings (so they don't hide under fixed header) */
71
107
  .prose h1,
72
108
  .prose h2,
@@ -99,6 +135,11 @@
99
135
  .prose :not(pre) > code::after {
100
136
  content: none;
101
137
  }
138
+
139
+ /* Dark mode inline code */
140
+ .prose-invert :not(pre) > code {
141
+ @apply bg-gray-800;
142
+ }
102
143
  }
103
144
 
104
145
  /* Syntax highlighting - rounded corners like Starlight */
@@ -1,118 +0,0 @@
1
- /**
2
- * Cross-Docs Tailwind CSS preset
3
- *
4
- * @example
5
- * ```js
6
- * // tailwind.config.js
7
- * const docsPreset = require('@usecross/docs/tailwind.preset')
8
- *
9
- * module.exports = {
10
- * presets: [docsPreset],
11
- * content: [
12
- * './frontend/**\/*.{ts,tsx}',
13
- * './node_modules/@usecross/docs/**\/*.{js,tsx}',
14
- * ],
15
- * theme: {
16
- * extend: {
17
- * colors: {
18
- * primary: { // Override with your brand colors },
19
- * },
20
- * },
21
- * },
22
- * }
23
- * ```
24
- */
25
- module.exports = {
26
- darkMode: 'class',
27
- theme: {
28
- extend: {
29
- maxWidth: {
30
- '8xl': '88rem',
31
- },
32
- fontFamily: {
33
- sans: [
34
- 'system-ui',
35
- '-apple-system',
36
- 'Segoe UI',
37
- 'Roboto',
38
- 'Helvetica',
39
- 'Arial',
40
- 'sans-serif',
41
- 'Apple Color Emoji',
42
- 'Segoe UI Emoji',
43
- 'Segoe UI Symbol',
44
- ],
45
- heading: [
46
- 'system-ui',
47
- '-apple-system',
48
- 'Segoe UI',
49
- 'Roboto',
50
- 'sans-serif',
51
- ],
52
- mono: ['Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'monospace'],
53
- },
54
- colors: {
55
- // Default primary colors - sky blue (can be overridden)
56
- primary: {
57
- 50: '#f0f9ff',
58
- 100: '#e0f2fe',
59
- 200: '#bae6fd',
60
- 300: '#7dd3fc',
61
- 400: '#38bdf8',
62
- 500: '#0ea5e9',
63
- 600: '#0284c7',
64
- 700: '#0369a1',
65
- 800: '#075985',
66
- 900: '#0c4a6e',
67
- 950: '#082f49',
68
- },
69
- // Dark colors for code blocks
70
- dark: {
71
- 800: '#1e293b',
72
- 900: '#0f172a',
73
- },
74
- },
75
- typography: (theme) => ({
76
- DEFAULT: {
77
- css: {
78
- maxWidth: 'none',
79
- color: theme('colors.gray.700'),
80
- a: {
81
- color: theme('colors.primary.600'),
82
- '&:hover': {
83
- color: theme('colors.primary.700'),
84
- },
85
- },
86
- 'code::before': {
87
- content: '""',
88
- },
89
- 'code::after': {
90
- content: '""',
91
- },
92
- code: {
93
- backgroundColor: theme('colors.gray.100'),
94
- padding: '0.25rem 0.375rem',
95
- borderRadius: '0.25rem',
96
- fontWeight: '500',
97
- },
98
- },
99
- },
100
- invert: {
101
- css: {
102
- color: theme('colors.gray.300'),
103
- a: {
104
- color: theme('colors.primary.400'),
105
- '&:hover': {
106
- color: theme('colors.primary.300'),
107
- },
108
- },
109
- code: {
110
- backgroundColor: theme('colors.gray.800'),
111
- },
112
- },
113
- },
114
- }),
115
- },
116
- },
117
- plugins: [require('@tailwindcss/typography')],
118
- }