@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.
Files changed (2) hide show
  1. package/README.md +26 -24
  2. 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' // Framework styles (required)
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 exports SCSS variable files. Import and override them in your own stylesheets:
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
- ```scss
354
- // In your app.scss
355
- @use '~@x-wave/blog/styles/_variables' as vars;
356
-
357
- // Override the color palette
358
- $color-primary: #007bff;
359
- $color-background: #fafafa;
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 import directly from the framework package:
363
+ Or in JavaScript:
365
364
 
366
- ```scss
367
- @import 'node_modules/@x-wave/blog/dist/styles/_variables.scss';
368
-
369
- $color-primary: #007bff;
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
- - `$color-primary`, `$color-secondary`
375
- - `$color-background`, `$color-text`
376
- - `$spacing-xs`, `$spacing-sm`, `$spacing-md`, `$spacing-lg`, `$spacing-xl`
377
- - `$font-family-sans`, `$font-family-mono`
378
- - And more—see [styles/_variables.scss](packages/styles/_variables.scss)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-wave/blog",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {