File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 44 v-model:fullscreen =" ctl.fullscreen"
55 v-model:layout =" containerLayout"
66 :drag-el =" headerEl"
7- :visible =" visible "
8- :width-range =" [ '20vw ', '100vw' ]"
7+ :visible =" true "
8+ :width-range =" [ '22vw ', '100vw' ]"
99 :height-range =" [ '60vh', '100vh' ]"
1010 class =" nano-theme"
1111 >
4242 const header = ref <InstanceType <typeof NanoHeader > | null >();
4343 const resizeObserver = ref <ResizeObserver | null >(null );
4444 const loading = ref (true );
45- const visible = computed (() => ! ctl .onlyFullscreen );
4645
4746 const headerEl = computed (() => header .value ?.$el );
4847 const containerLayout = computed ({
8584 }
8685 });
8786 resizeObserver .value .observe (containerEl );
88-
89-
9087 });
9188
9289 onBeforeUnmount (() => {
Original file line number Diff line number Diff line change 1616 >
1717 <article
1818 ref =" article"
19- class =" vp-doc VPDoc p-[calc(var(--base-size)*1)] md:p-[var(--main-padding)] text-[var(--base-size)]"
19+ class =" vp-doc VPDoc text-[var(--base-size)]"
2020 :class =" [ 'w-full' ]"
2121 style =" white-space : wrap ;"
22+ :style =" { padding: articlePadding }"
2223 >
2324 <Content ref =" content" />
2425 </article >
6364 }, 240 );
6465 });
6566
67+ const resizeObserver = ref <ResizeObserver | null >(null );
68+ const articlePadding = ref <string >(' calc(var(--base-size))' );
69+
6670 onMounted (() => {
6771 setTimeout (() => {
6872 hashChange ();
8791 // Scroll to target element
8892 scrollbars .value ?.osInstance ()?.elements ()?.viewport ?.scrollTo ({ top: targetTop , behavior: ' smooth' });
8993 });
94+
95+ resizeObserver .value = new ResizeObserver ((entries : ResizeObserverEntry []) => {
96+ for (const entry of entries ) {
97+ const { target } = entry ;
98+ const { clientWidth } = target as HTMLElement ;
99+ if (clientWidth < 1280 ) {
100+ articlePadding .value = ' calc(var(--base-size))' ;
101+ } else {
102+ articlePadding .value = ' calc(var(--base-size)) calc(var(--base-size) * 2)' ;
103+ }
104+ }
105+ });
90106 });
91107
92108 onUnmounted (() => {
Original file line number Diff line number Diff line change 33 <div
44 v-if =" visible"
55 ref =" modal"
6- class =" absolute"
6+ class =" absolute rounded-6px shadow-[0_0_16px_4px_rgb(0,0,0,.24)] "
77 :style =" { ...layoutStyle, transition }"
88 >
99 <slot />
You can’t perform that action at this time.
0 commit comments