Open pengzhanbo opened 6 months ago
the new theme should support https://theme-hope.vuejs.press/guide/layout/sidebar.html#generate-sidebar-from-file-structure
the new theme should support theme-hope.vuejs.press/guide/layout/sidebar.html#generate-sidebar-from-file-structure
Implemented in the new theme.
Why is some contents being removed in templateBuild, when darkmode is meant to be enabled, won't the screen flash?
Q1
Why is some contents being removed in templateBuild, when darkmode is meant to be enabled, won't the screen flash?
It does not flicker, when the appearance
is set to force-dark
, an inline script ;document.documentElement.classList.add('dark')
will be inserted into the HTML;
for other values, it will be inserted differently:
;(() => {
const preference = localStorage.getItem('vuepress-color-scheme') || fallbackPreference
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
if (!preference || preference === 'auto' ? prefersDark : preference === 'dark')
document.documentElement.classList.add('dark')
})()
see node/config/resolvePageHead.ts
If the default theme is based on CSS, then we can try if we can use lightning CSS.
If the default theme is based on CSS, then we can try if we can use lightning CSS.
While I would like to use lightning CSS
, it may cause issues if the theme's users are using other plugins that contain scss
.
This issue is marked as stale
because it has not had recent activity. Issues marked with stale
will be closed if they have no activity within 7 days.
Clear and concise description of the problem
We are in the process of creating a new default theme for the VuePress 2, which will replace the old default theme, with the old theme being renamed to
@vuepress/theme-legacy
.We will list the updated content in this issue, discussing the differences between old and new themes, compatibility solutions, and other updates related to vuepress upstream and downstream.
Features
The new theme will follow the same style as the default theme of VitePress.
Differences
Configuration
SiteTtitle and logo: delete
home / logo / logoDark / logoAlt
, usesiteTitle / logo / logoLink
instead.Nav:
NavItem[]
,children
was deprecated, useitems
insteadrepo
, usesocialLinks
insteadcolorMode / colorModeSwitch
, useappearance
insteadSidebar:
auto
tostructure
children
was deprecated, useitems
insteadDocFooter:
latestUpdated
support lastUpdatedFormatOptionsCode Block: Use
shiki
as the default highlighting. supportline highlighting
,colors diff
errors and warning
focus
containers: support
tip / info / warning / danger / important
, and github alerts.Frontmatter
layout
withpageLayout
in VitePress, aslayout
is already used for other purposes in VuePress.outline
to control the display levels of theTOC
within the page. etc.[2, 3]
Suggested solution
Currently working on vuepress/ecosystem branch:theme-default .
Alternative
No response
Additional context
No response