Skip to content

Commit a057587

Browse files
committed
feat: update VitePress theme to include CSS imports and adjust UnoCSS output file
1 parent 3e915d3 commit a057587

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

docs/vitepress-theme/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const themeConfig = {
9999

100100
You can use the [config](https://github.com/onmax/nimiq-ui/tree/main/docs/.vitepress/config.ts) used for this documentation for reference.
101101

102-
### Import the layout
102+
### Import the layout and CSS
103103

104104
You need to import the layout from the theme
105105

@@ -109,6 +109,8 @@ You need to import the layout from the theme
109109
import { Layout } from 'nimiq-vitepress-theme' // [!code hl]
110110
import { Theme } from 'vitepress'
111111

112+
import 'nimiq-vitepress-theme/assets/index.css' // [!code hl]
113+
112114
export default {
113115
Layout, // [!code hl]
114116
enhanceApp() {
@@ -156,6 +158,8 @@ import NqCard from 'nimiq-vitepress-theme/components/NqCard.vue' // [!code hl]
156158
import NqGrid from 'nimiq-vitepress-theme/components/NqGrid.vue' // [!code hl]
157159
import NqLargeCard from 'nimiq-vitepress-theme/components/NqLargeCard.vue' // [!code hl]
158160
161+
import 'nimiq-vitepress-theme/assets/index.css'
162+
159163
export default {
160164
Layout,
161165
enhanceApp({ app }: EnhanceAppContext) {

packages/nimiq-vitepress-theme/build.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default defineBuildConfig({
5555
//
5656
// The use of CLI was suggested by how to use unocss with rollup? · unocss/unocss · Discussion #542
5757
// https:// github.com/unocss/unocss/discussions/542
58-
await execAsync('unocss "./src/**/*.vue" -o dist/assets/index.css')
58+
await execAsync('unocss "./src/**/*.vue" -o dist/assets/uno.css')
5959
},
6060
},
6161
})
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
/* An empty file to let vite know this file exists, but it will be replaced by UnoCSS */
1+
@import url('./uno.css') layer nq-vp;
2+
@import url('./typography.css') layer nq-vp;
3+
@import url('./github-callouts.css') layer nq-vp;
4+
@import url('./code-blocks.css') layer nq-vp;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* An empty file to let vite know this file exists, but it will be replaced by UnoCSS */

0 commit comments

Comments
 (0)