Skip to content

Commit e3cfdec

Browse files
authored
feat(vitepress-twoslash): improve UX for option customization (#1066)
1 parent 22d0c78 commit e3cfdec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/vitepress-twoslash/src/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const TwoslashFloatingVue = {
2424
app.use(FloatingVue, {
2525
...options,
2626
themes: {
27+
...options.themes,
2728
'twoslash': {
2829
$extend: 'dropdown',
2930
triggers: isMobile ? ['touch'] : ['hover', 'touch'],
@@ -37,12 +38,14 @@ const TwoslashFloatingVue = {
3738
flip: false,
3839
arrowPadding: 8,
3940
autoBoundaryMaxSize: true,
41+
...options.themes?.twoslash ?? {},
4042
},
4143
'twoslash-query': {
4244
$extend: 'twoslash',
4345
triggers: ['click'],
4446
popperTriggers: ['click'],
4547
autoHide: false,
48+
...options.themes?.['twoslash-query'] ?? {},
4649
},
4750
'twoslash-completion': {
4851
$extend: 'twoslash-query',
@@ -51,7 +54,9 @@ const TwoslashFloatingVue = {
5154
autoHide: false,
5255
distance: 0,
5356
arrowOverflow: true,
57+
...options.themes?.['twoslash-completion'] ?? {},
5458
},
59+
/** @deprecated */
5560
...options.theme,
5661
},
5762
})

0 commit comments

Comments
 (0)