@x-wave/blog 1.0.4 → 1.0.5
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/README.md +26 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,14 +65,14 @@ Import the i18n setup and framework styles in your app entry point:
|
|
|
65
65
|
```ts
|
|
66
66
|
// src/main.tsx
|
|
67
67
|
import '@x-wave/blog/locales' // Initialises i18next with en, es, zh
|
|
68
|
-
import '@x-wave/blog/styles' //
|
|
68
|
+
import '@x-wave/blog/styles' // Compiled CSS with variables and component styles (required)
|
|
69
69
|
import { createRoot } from 'react-dom/client'
|
|
70
70
|
import App from './App'
|
|
71
71
|
|
|
72
72
|
createRoot(document.getElementById('root')!).render(<App />)
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
> **The styles import is required** for the UI components and layout to render correctly.
|
|
75
|
+
> **The styles import is required** for the UI components and layout to render correctly. This imports a single compiled CSS file (`index.css`) that contains all framework styles, CSS variables, and component styles.
|
|
76
76
|
|
|
77
77
|
**Add custom translations:**
|
|
78
78
|
|
|
@@ -348,34 +348,36 @@ import type { NavigationEntry, BlogConfig, HeaderLink } from '@x-wave/blog/types
|
|
|
348
348
|
|
|
349
349
|
### CSS variables
|
|
350
350
|
|
|
351
|
-
The framework
|
|
351
|
+
The framework uses CSS custom properties (`--xw-*` prefix) for theming. These are automatically injected when the framework initializes, but you can override them:
|
|
352
352
|
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
// Your custom styles here
|
|
353
|
+
```css
|
|
354
|
+
/* In your app.css */
|
|
355
|
+
.xw-blog-root {
|
|
356
|
+
--xw-primary: #007bff;
|
|
357
|
+
--xw-background: #fafafa;
|
|
358
|
+
--xw-foreground: #1a1a1a;
|
|
359
|
+
/* ... other variables */
|
|
360
|
+
}
|
|
362
361
|
```
|
|
363
362
|
|
|
364
|
-
Or
|
|
363
|
+
Or in JavaScript:
|
|
365
364
|
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
$color-background: #fafafa;
|
|
365
|
+
```javascript
|
|
366
|
+
const blogRoot = document.querySelector('.xw-blog-root')
|
|
367
|
+
blogRoot.style.setProperty('--xw-primary', '#007bff')
|
|
368
|
+
blogRoot.style.setProperty('--xw-background', '#fafafa')
|
|
371
369
|
```
|
|
372
370
|
|
|
373
|
-
Available variables include:
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
371
|
+
Available CSS variables include:
|
|
372
|
+
- `--xw-primary`, `--xw-secondary`
|
|
373
|
+
- `--xw-background`, `--xw-foreground`
|
|
374
|
+
- `--xw-card`, `--xw-card-foreground`
|
|
375
|
+
- `--xw-muted`, `--xw-muted-foreground`
|
|
376
|
+
- `--xw-accent`, `--xw-accent-foreground`
|
|
377
|
+
- `--xw-border`, `--xw-ring`
|
|
378
|
+
- And more—defined in `packages/styles/main.scss`
|
|
379
|
+
|
|
380
|
+
All CSS variables are scoped to `.xw-blog-root` for isolation and to prevent conflicts with your application styles.
|
|
379
381
|
|
|
380
382
|
### Config options
|
|
381
383
|
|