Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rebuild theme-default #134

Open
wants to merge 118 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
31f6b62
feat: initial new default theme
pengzhanbo May 13, 2024
b0fd64f
feat(plugin-shiki): support multi themes and transformers
pengzhanbo May 13, 2024
575d8fe
feat: sidebar&outline scroll to active element view
pengzhanbo May 13, 2024
def90fc
perf: optimize styles
pengzhanbo May 13, 2024
9bb6fb5
chore: tweak
pengzhanbo May 14, 2024
6d73e0e
docs: move to new theme default
pengzhanbo May 14, 2024
6468eb8
perf: dynamic parsing of navbar & sidebar
pengzhanbo May 15, 2024
347c4ec
docs: update docs
pengzhanbo May 16, 2024
64f92e1
test: update e2e test
pengzhanbo May 16, 2024
c4fe355
test: update e2e test
pengzhanbo May 16, 2024
928fdb0
chore: tweak
pengzhanbo May 16, 2024
73d1b73
Merge branch 'main' into theme-default
pengzhanbo May 17, 2024
5c05d5a
chore: tweak
pengzhanbo May 17, 2024
d1402ac
Merge branch 'main' into theme-default
Mister-Hope May 20, 2024
aa773b2
chore: tweaks
pengzhanbo May 20, 2024
1e1fe32
chore: tweak
pengzhanbo May 20, 2024
b8efe3a
Merge branch 'main' into theme-default
pengzhanbo May 24, 2024
75291b0
chore: tweak
pengzhanbo May 24, 2024
fbeefab
Merge branch 'main' into theme-default
Mister-Hope May 29, 2024
9a16e7d
Merge branch 'main' into theme-default
Mister-Hope May 29, 2024
fb57fb4
docs: sync docs
Mister-Hope May 29, 2024
a220482
chore: tweaks
Mister-Hope May 29, 2024
1dec895
docs: fix docs
Mister-Hope May 29, 2024
afe371d
Merge branch 'main' into theme-default
pengzhanbo May 29, 2024
25f058f
chore: tweak
pengzhanbo May 29, 2024
51c4125
chore: tweak
pengzhanbo May 29, 2024
98f9dad
chore: lint fix
pengzhanbo May 29, 2024
d095471
Merge branch 'main' into theme-default
pengzhanbo May 29, 2024
99c30a1
test: fix e2e tests
pengzhanbo May 29, 2024
1f5efc5
refactor: container & github alerts
pengzhanbo May 30, 2024
33c1d1c
perf: update plugin-shiki default options
pengzhanbo May 30, 2024
9dbab44
chore: tweak
pengzhanbo May 30, 2024
964301d
Merge branch 'main' into theme-default
pengzhanbo May 30, 2024
f240aa7
chore: tweak
pengzhanbo May 30, 2024
2acfaa1
chore: tweak
pengzhanbo May 31, 2024
d6203c6
chore: tweak
pengzhanbo May 31, 2024
58335c8
test: fix e2e tests
pengzhanbo May 31, 2024
d5afb0f
perf: replace all with arrow functions
pengzhanbo May 31, 2024
ecb75b3
Merge branch 'main' into theme-default
pengzhanbo Jun 1, 2024
34b0095
chore: tweak
pengzhanbo Jun 9, 2024
d9370b3
Merge branch 'main' into theme-default
pengzhanbo Jun 9, 2024
b09e8df
chore: tweak
pengzhanbo Jun 9, 2024
328220d
chore: stylelint
pengzhanbo Jun 9, 2024
b76f850
chore: lint fix
pengzhanbo Jun 9, 2024
75cb8fc
chore: tweak
pengzhanbo Jun 9, 2024
526cb7f
chore: tweak
pengzhanbo Jun 16, 2024
f7d3730
Merge branch 'main' into theme-default
pengzhanbo Jun 16, 2024
7f6cbb3
chore: tweak
pengzhanbo Jun 16, 2024
0141799
chore: tweak
pengzhanbo Jun 16, 2024
0518da0
Merge branch 'main' into theme-default
pengzhanbo Jun 21, 2024
e3c9a84
Merge branch 'main' into theme-default
Mister-Hope Jul 10, 2024
f13e95f
chore: tweak
pengzhanbo Jul 15, 2024
da8eab2
Merge branch 'main' into theme-default
pengzhanbo Sep 4, 2024
37e82dd
chore: tweak
pengzhanbo Sep 4, 2024
e32b67e
chore: tweak
pengzhanbo Sep 4, 2024
7c86e06
chore: lint fix
pengzhanbo Sep 4, 2024
ad8fc99
chore: lint fix
pengzhanbo Sep 4, 2024
fe74925
chore: tweak
pengzhanbo Sep 4, 2024
0b63fd3
chore: lint fix
pengzhanbo Sep 4, 2024
7fbaeb7
chore: lint fix
pengzhanbo Sep 4, 2024
51dd60e
chore: tweak
pengzhanbo Sep 5, 2024
528d7f4
chore: guidelines `data-theme=dark`
pengzhanbo Sep 5, 2024
1957d4e
chore: adapt `plugin-markdown-hint`
pengzhanbo Sep 5, 2024
34de92a
chore: guidelines `vp-*`
pengzhanbo Sep 5, 2024
2495fe9
chore: e2e-webpack sass warning
pengzhanbo Sep 5, 2024
79115f7
chore: guidelines css-vars `vp-*`
pengzhanbo Sep 5, 2024
a7bf49b
chore: tweak
pengzhanbo Sep 5, 2024
63f8dd5
chore: synchronize docs
pengzhanbo Sep 5, 2024
078956e
Merge branch 'main' into theme-default
pengzhanbo Nov 20, 2024
707e16c
chore: update deps
pengzhanbo Nov 20, 2024
71ce89f
chore: lint fix
pengzhanbo Nov 20, 2024
9afd1fb
chore: tweak
pengzhanbo Nov 20, 2024
e3d47ae
chore: tweak
pengzhanbo Nov 21, 2024
0aee9de
chore: fix e2e
pengzhanbo Nov 21, 2024
7837f64
Merge branch 'main' into theme-default
pengzhanbo Nov 21, 2024
6c65ca0
chore: tweak
pengzhanbo Nov 21, 2024
ab84201
chore: tweak
pengzhanbo Nov 21, 2024
2008020
Merge branch 'main' into theme-default
pengzhanbo Nov 24, 2024
d1e3e6d
chore: tweak
pengzhanbo Nov 24, 2024
583161b
chore: tweak
pengzhanbo Nov 24, 2024
d05dbdf
chore: tweak
pengzhanbo Nov 24, 2024
82bee92
chore: tweak
pengzhanbo Nov 24, 2024
ee616cd
chore: sync docs
pengzhanbo Nov 25, 2024
9c70abc
chore: tweak
pengzhanbo Nov 25, 2024
00ccf3d
chore: update docs
pengzhanbo Nov 26, 2024
a057285
Merge branch 'main' into theme-default
pengzhanbo Nov 26, 2024
f92095c
chore: tweak
pengzhanbo Nov 27, 2024
c28972e
Merge branch 'main' into theme-default
Mister-Hope Nov 28, 2024
7ef550d
chore: update comments
Mister-Hope Nov 28, 2024
4ce00fe
chore: tweaks
Mister-Hope Nov 28, 2024
4a14ed5
chore: tweaks
Mister-Hope Nov 28, 2024
020a60d
chore: tweak
pengzhanbo Nov 29, 2024
864d185
feat: add theme-helper
Mister-Hope Nov 30, 2024
409c50a
chore: fix build script
Mister-Hope Dec 6, 2024
845c0c2
feat: extract useContributor
Mister-Hope Dec 7, 2024
7cfaa45
feat: extract editLink
Mister-Hope Dec 7, 2024
5a27ce3
Merge branch 'main' into theme-default
Mister-Hope Dec 7, 2024
858dfd6
chore: fix lockfile
Mister-Hope Dec 7, 2024
246368c
chore: fix broken types
Mister-Hope Dec 7, 2024
b0eef91
fix(plugin-slimsearch): fix hotkey without suggestions, close #298
Mister-Hope Dec 7, 2024
24e6aee
Merge branch 'main' into theme-default
Mister-Hope Feb 17, 2025
dae7ea2
build: bump deps
Mister-Hope Feb 17, 2025
dc22c50
build: fix import
Mister-Hope Feb 17, 2025
fd663a0
fix: fix classic docs
Mister-Hope Feb 17, 2025
17c3596
fix: fix theme-next
Mister-Hope Feb 17, 2025
2df44de
chore: fix docs
Mister-Hope Feb 17, 2025
7446c1f
fix: fix docs next
Mister-Hope Feb 17, 2025
b2ba5e8
fix: fix e2e
Mister-Hope Feb 17, 2025
c0befec
Merge branch 'main' into theme-default
Mister-Hope Feb 17, 2025
5a7902b
Merge branch 'main' into theme-default
Mister-Hope Feb 18, 2025
3098a9b
chore: revert wrong change
Mister-Hope Feb 18, 2025
af3ad46
Merge branch 'main' into theme-default
Mister-Hope Feb 24, 2025
f9b317f
chore: tweaks
Mister-Hope Feb 24, 2025
2176dda
Merge branch 'main' into theme-default
Mister-Hope Feb 24, 2025
6584df3
docs: update docs config
Mister-Hope Feb 24, 2025
39baa66
feat: use core onContentUpdate
Mister-Hope Feb 24, 2025
0337728
chore: tweaks
Mister-Hope Feb 24, 2025
2ddfbf7
chore: fix deps
Mister-Hope Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ rules:
declaration-block-no-redundant-longhand-properties: true
media-feature-range-notation: prefix
no-descending-specificity: null
custom-property-empty-line-before: null
selector-max-class: null
selector-max-attribute: null
selector-pseudo-class-no-unknown:
- true
- ignorePseudoClasses:
- input-placeholder

selector-pseudo-element-no-unknown:
- true
- ignorePseudoElements:
- input-placeholder
# workaround for mixed-declarations
no-duplicate-selectors: null

Expand Down Expand Up @@ -48,3 +60,18 @@ overrides:
- v-deep
- v-global
- v-slotted

declaration-block-no-redundant-longhand-properties: null
scss/operator-no-newline-after: null

- files:
- 'themes/theme-next/src/client/styles/vars.css'

rules:
no-duplicate-selectors: null

- files:
- 'themes/theme-next/src/client/styles/compat.css'

rules:
selector-class-pattern: null
9 changes: 9 additions & 0 deletions docs-next/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineClientConfig } from 'vuepress/client'
import CommentPage from './layouts/CommentPage.vue'

export default defineClientConfig({
layouts: {
// We override the default layout to provide comment service
CommentPage,
},
})
53 changes: 53 additions & 0 deletions docs-next/.vuepress/components/NpmBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script setup lang="ts">
import { computed } from 'vue'

const props = withDefaults(
defineProps<{
/** package name */
package: string
/** dist tag */
distTag?: string
}>(),
{
distTag: 'next',
},
)

const badgeLink = computed(
() => `https://www.npmjs.com/package/${props.package}/v/next`,
)
const badgeLabel = computed(() => {
if (props.distTag) {
return `${props.package}@${props.distTag}`
}
return props.package
})
const badgeImg = computed(
() =>
`https://badgen.net/npm/v/${props.package}/${
props.distTag
}?label=${encodeURIComponent(badgeLabel.value)}`,
)
</script>

<template>
<a
class="npm-badge"
:href="badgeLink"
:title="package"
target="_blank"
rel="noopener noreferrer"
>
<img :src="badgeImg" :alt="package" />
</a>
</template>

<style lang="scss" scoped>
.npm-badge {
margin-right: 0.5rem;

&::after {
display: none !important;
}
}
</style>
203 changes: 203 additions & 0 deletions docs-next/.vuepress/components/PaletteDemo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<script setup lang="ts">
import { useLocaleConfig } from '@vuepress/helper/client'

const locale = useLocaleConfig({
'/': {
text: 'Text Colors',
accent: 'Accent Colors',
border: 'Border Colors',
shadow: 'Shadow Colors',
control: 'Control Colors',
},
'/zh/': {
text: '文字颜色',
accent: '强调色',
border: '边框颜色',
shadow: '阴影色',
control: '控件颜色',
},
})
</script>

<template>
<div class="header">{{ locale.text }}</div>
<div class="demo">
<div class="text">text</div>
<div class="text-mute">text mute</div>
<div class="text-subtle">text subtle</div>
</div>
<div class="header">{{ locale.border }}</div>
<div class="demo">
<div class="border-display border">border</div>
<div class="border-display border-hard">border hard</div>
<div class="border-display gutter">gutter</div>
</div>
<div class="header">{{ locale.accent }}</div>
<div class="demo">
<button type="button" class="button-reset accent">accent</button>
<button type="button" class="button-reset accent-bg">accent bg</button>
<button type="button" class="button-reset accent-hover">
accent hover
</button>
<button type="button" class="button-reset accent-soft">accent soft</button>
</div>
<div class="header">{{ locale.shadow }}</div>
<div class="demo">
<button type="button" class="button-reset bg shadow">shadow with bg</button>
<button type="button" class="button-reset bg-alt shadow">
shadow with bg alt
</button>
<button type="button" class="button-reset accent-bg shadow">
shadow with accent
</button>
<button type="button" class="button-reset accent-hover shadow">
shadow with accent hover
</button>
</div>
<div class="header">{{ locale.control }}</div>
<div class="demo">
<div class="item">
<label class="label">
control
<input class="input-reset border control" />
</label>
</div>
<div class="item">
<label class="label">
control hover
<input class="input-reset control-hover" />
</label>
</div>
<div class="item">
<label class="label">
control disabled
<input class="input-reset control-disabled" disabled />
</label>
</div>
<div class="item">
<button type="button" class="button-reset control">control</button>
<button type="button" class="button-reset control-hover">
control hover
</button>
<button type="button" class="button-reset control-disabled">
control disabled
</button>
</div>
</div>
</template>

<style lang="scss">
.header {
margin: 0.75rem 0 0.25rem;
font-size: 1.25rem;
}

.button-reset {
margin: 4px;
padding: 4px 8px;
border: none;
border-radius: 8px;

background: transparent;
outline: none;
}

.border-display {
position: relative;
text-align: center;

&::before {
content: ' ';

position: absolute;
top: 100%;
right: 0%;
left: 0%;

border-width: 1px;
border-style: solid;
border-color: inherit;
}
}

.input-reset {
margin: 4px;
padding: 2px 8px;
border-radius: 8px;

background: transparent;
outline: none;

line-height: 1.5;
}

.bg {
background: var(--vp-c-bg);
}

.bg-alt {
background: var(--vp-c-bg-alt);
}

.border {
border-color: var(--vp-c-border);
}

.border-hard {
border-color: var(--vp-c-border-hard);
}

.gutter {
border-color: var(--vp-c-gutter);
}

.shadow {
box-shadow: 1px 2px 4px 2px var(--vp-c-shadow);
}

.text {
color: var(--vp-c-text);
}

.text-mute {
color: var(--vp-c-text-mute);
}

.text-subtle {
color: var(--vp-c-text-subtle);
}

.accent {
color: var(--vp-c-accent);
}

.accent-bg {
background: var(--vp-c-accent-bg);
color: var(--vp-c-accent-text);
}

.accent-hover {
background: var(--vp-c-accent-hover);
color: var(--vp-c-accent-text);
}

.accent-soft {
background: var(--vp-c-accent-soft);
color: var(--vp-c-accent);
}

.control {
border: 1px solid var(--vp-c-border);
background: var(--vp-c-control);
}

.control-hover {
border: 1px solid var(--vp-c-border);
background: var(--vp-c-control-hover);
}

.control-disabled {
border: 1px solid var(--vp-c-border);
background: var(--vp-c-control-disabled);
}
</style>
27 changes: 27 additions & 0 deletions docs-next/.vuepress/components/PaletteDisplay.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup lang="ts">
import PaletteDemo from './PaletteDemo.vue'
</script>

<template>
<div class="bg border bg-wrapper">
<div class="bg-hint">bg</div>
<PaletteDemo />
</div>
<div class="bg-alt border bg-wrapper">
<div class="bg-hint">bg alt</div>
<PaletteDemo />
</div>
</template>

<style>
.bg-wrapper {
margin: 0.5rem 0;
padding: 0.5rem;
border-radius: 8px;
}

.bg-hint {
float: right;
font-size: 0.75rem;
}
</style>
44 changes: 44 additions & 0 deletions docs-next/.vuepress/components/VPAutoLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script setup lang="ts">
import type { VNode } from 'vue'
import type { AutoLinkConfig } from 'vuepress/client'
import { AutoLink } from 'vuepress/client'

export interface AutoLinkConfigWithIcon extends AutoLinkConfig {
icon?: string
}

defineProps<{
/**
* The auto link config
*/
config: AutoLinkConfigWithIcon
}>()

defineSlots<{
default?: (config: AutoLinkConfigWithIcon) => VNode | VNode[]
before?: (config: AutoLinkConfigWithIcon) => VNode | VNode[] | null
after?: (config: AutoLinkConfigWithIcon) => VNode | VNode[] | null
}>()
</script>

<template>
<AutoLink :config="config">
<template v-if="$slots.default" #default>
<slot v-bind="config" />
</template>
<template #before>
<slot name="before" v-bind="config">
<VPIcon v-if="config.icon" class="auto-link-icon" :icon="config.icon" />
</slot>
</template>
<template #after>
<slot name="after" v-bind="config" />
</template>
</AutoLink>
</template>

<style>
.auto-link-icon {
margin-inline-end: 0.25em;
}
</style>
Loading
Loading