-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: themeConfig frontmatter options
- Loading branch information
Showing
7 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import { SlidevConfig } from '@slidev/types' | ||
import { computed } from '@vue/runtime-core' | ||
import { objectMap } from '@antfu/utils' | ||
// @ts-ignore | ||
import _configs from '/@slidev/configs' | ||
|
||
export const configs = _configs as SlidevConfig | ||
|
||
export const slideAspect = configs.aspectRatio ?? (16 / 9) | ||
export const slideWidth = configs.canvasWidth ?? 980 | ||
export const slideHeight = Math.round(slideWidth / slideAspect) | ||
|
||
export const themeVars = computed(() => { | ||
return objectMap(configs.themeConfig || {}, (k, v) => [`--slidev-theme-${k}`, v]) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters