Skip to content

Commit

Permalink
improve screen styling
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisugi committed Sep 20, 2024
1 parent f3fbb97 commit b1ddce6
Show file tree
Hide file tree
Showing 5 changed files with 317 additions and 16 deletions.
12 changes: 12 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,17 @@ export default defineConfig({
},
link: '/fr/'
},
},
vite: {
optimizeDeps: {
exclude: [
"@nolebase/vitepress-plugin-enhanced-readabilities/client",
],
},
ssr: {
noExternal: [
"@nolebase/vitepress-plugin-enhanced-readabilities",
],
},
}
})
4 changes: 4 additions & 0 deletions .vitepress/theme/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

.medium-zoom-image {
z-index: 21;
}

.VPSocialLinks.VPNavBarSocialLinks.social-links {
margin-right: 0;
}
32 changes: 26 additions & 6 deletions .vitepress/theme/index.mts
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
import DefaultTheme from 'vitepress/theme';
import { onMounted } from 'vue';
import mediumZoom from 'medium-zoom';
import { h } from 'vue';

import './index.css';
import {
NolebaseEnhancedReadabilitiesMenu,
NolebaseEnhancedReadabilitiesScreenMenu,
} from "@nolebase/vitepress-plugin-enhanced-readabilities/client";
import "@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css";
import type { Options as NolebaseReadOptions } from '@nolebase/vitepress-plugin-enhanced-readabilities/client'
import { InjectionKey as NolebaseReadInjectionKey } from '@nolebase/vitepress-plugin-enhanced-readabilities/client'

export default {
...DefaultTheme,
setup() {
onMounted(() => {
mediumZoom('.main img', { background: 'var(--vp-c-bg)' });
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
"nav-screen-content-after": () => h(NolebaseEnhancedReadabilitiesScreenMenu),
"nav-bar-content-after": () => h(NolebaseEnhancedReadabilitiesMenu),
});
},
enhanceApp({ app }) {
app.provide(NolebaseReadInjectionKey, {
layoutSwitch: {
defaultMode: 5,
contentLayoutMaxWidth: {
defaultMaxWidth: 85
},
pageLayoutMaxWidth: {
defaultMaxWidth: 85
}
}
} as NolebaseReadOptions);
}
};
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"author": "Kaito Sugimoto <[email protected]>",
"license": "Apache-2.0",
"devDependencies": {
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.5.0",
"markdown-it-footnote": "^4.0.0",
"vitepress": "^1.3.4"
},
Expand All @@ -15,7 +16,5 @@
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"dependencies": {
"medium-zoom": "^1.1.0"
}
"dependencies": {}
}
Loading

0 comments on commit b1ddce6

Please sign in to comment.