Skip to content

Commit

Permalink
fix: twikoo bg-color conflict with tailwindcss reset, close #255
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Sep 3, 2023
1 parent 8fad1c9 commit 2e2ec5c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/valaxy/client/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import type { ViteSSGContext } from 'vite-ssg'
import { ViteSSG } from 'vite-ssg'
import generatedRoutes from 'virtual:generated-pages'
import { setupLayouts } from 'virtual:generated-layouts'
import AppLink from './components/AppLink.vue'

import App from './App.vue'
import AppLinkVue from './components/AppLink.vue'

import '@unocss/reset/tailwind.css'
// reset styles
// import '@unocss/reset/tailwind.css'
// https://unocss.dev/guide/style-reset#tailwind-compat
// minus the background color override for buttons to avoid conflicts with UI frameworks
import '@unocss/reset/tailwind-compat.css'

// generate user styles
import '/@valaxyjs/styles'
Expand All @@ -18,6 +24,14 @@ const routes = setupLayouts(import.meta.env.DEV
i.meta && i.meta.frontmatter && !i.meta.frontmatter.draft,
))

/**
* register global components
* @param ctx
*/
export function registerComponents(ctx: ViteSSGContext) {
ctx.app.component('AppLink', AppLink)
}

// not filter hide for ssg

// https://github.com/antfu/vite-ssg
Expand All @@ -32,7 +46,7 @@ export const createApp = ViteSSG(
},
},
(ctx) => {
ctx.app.component('AppLink', AppLinkVue)
registerComponents(ctx)
setupMain(ctx)
},
)

2 comments on commit 2e2ec5c

@vercel
Copy link

@vercel vercel bot commented on 2e2ec5c Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://64f4cd197a778c3da399055b--valaxy.netlify.app

Please sign in to comment.