mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-26 00:35:02 +03:00
Test out themes
This commit is contained in:
parent
a20e2b378e
commit
2af123ecab
@ -1,4 +1,4 @@
|
|||||||
export { big as theme } from '@mdx-deck/themes'
|
export { future as theme } from '@mdx-deck/themes'
|
||||||
import { Head, Image, Notes, Appear } from '@mdx-deck/components'
|
import { Head, Image, Notes, Appear } from '@mdx-deck/components'
|
||||||
import { Invert, Split, SplitRight, FullScreenCode, Horizontal} from '@mdx-deck/layouts'
|
import { Invert, Split, SplitRight, FullScreenCode, Horizontal} from '@mdx-deck/layouts'
|
||||||
import Counter from './Counter'
|
import Counter from './Counter'
|
||||||
|
@ -10,7 +10,6 @@ import Overview from './Overview'
|
|||||||
import Print from './Print'
|
import Print from './Print'
|
||||||
import GoogleFonts from './GoogleFonts'
|
import GoogleFonts from './GoogleFonts'
|
||||||
import Catch from './Catch'
|
import Catch from './Catch'
|
||||||
import { default as defaultTheme } from '@mdx-deck/themes'
|
|
||||||
|
|
||||||
const NORMAL = 'normal'
|
const NORMAL = 'normal'
|
||||||
const PRESENTER = 'presenter'
|
const PRESENTER = 'presenter'
|
||||||
@ -249,13 +248,11 @@ export class MDXDeck extends React.Component {
|
|||||||
|
|
||||||
MDXDeck.propTypes = {
|
MDXDeck.propTypes = {
|
||||||
slides: PropTypes.array.isRequired,
|
slides: PropTypes.array.isRequired,
|
||||||
theme: PropTypes.object.isRequired,
|
|
||||||
headTags: PropTypes.array.isRequired,
|
headTags: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
MDXDeck.defaultProps = {
|
MDXDeck.defaultProps = {
|
||||||
slides: [],
|
slides: [],
|
||||||
theme: defaultTheme,
|
|
||||||
headTags: [],
|
headTags: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import { ThemeProvider } from 'emotion-theming'
|
|||||||
import merge from 'lodash.merge'
|
import merge from 'lodash.merge'
|
||||||
import { HeadProvider } from './Head'
|
import { HeadProvider } from './Head'
|
||||||
import { MDXProvider } from '@mdx-js/tag'
|
import { MDXProvider } from '@mdx-js/tag'
|
||||||
|
import defaultTheme from '@mdx-deck/themes'
|
||||||
import mdxComponents from './mdx-components'
|
import mdxComponents from './mdx-components'
|
||||||
|
|
||||||
const DefaultProvider = props => <>{props.children}</>
|
const DefaultProvider = props => <>{props.children}</>
|
||||||
@ -18,7 +19,7 @@ const mergeThemes = themes =>
|
|||||||
|
|
||||||
export const Provider = props => {
|
export const Provider = props => {
|
||||||
const { headTags, theme: baseTheme, themes = [] } = props
|
const { headTags, theme: baseTheme, themes = [] } = props
|
||||||
const theme = mergeThemes([baseTheme, ...themes])
|
const theme = mergeThemes([defaultTheme, baseTheme, ...themes])
|
||||||
const {
|
const {
|
||||||
Provider: UserProvider = DefaultProvider,
|
Provider: UserProvider = DefaultProvider,
|
||||||
components: themeComponents = {},
|
components: themeComponents = {},
|
||||||
|
@ -22,6 +22,7 @@ const themedCode = props => ({
|
|||||||
'& code, & pre': {
|
'& code, & pre': {
|
||||||
fontFamily: props.theme.monospace,
|
fontFamily: props.theme.monospace,
|
||||||
color: props.theme.colors.code,
|
color: props.theme.colors.code,
|
||||||
|
background: props.theme.colors.codeBackground,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ export { default as future } from './future'
|
|||||||
export { default as condensed } from './condensed'
|
export { default as condensed } from './condensed'
|
||||||
export { default as yellow } from './yellow'
|
export { default as yellow } from './yellow'
|
||||||
export { default as swiss } from './swiss'
|
export { default as swiss } from './swiss'
|
||||||
|
export { default as poppins } from './poppins'
|
||||||
|
|
||||||
// serif
|
// serif
|
||||||
export { default as book } from './book'
|
export { default as book } from './book'
|
||||||
|
14
packages/themes/src/poppins.js
Normal file
14
packages/themes/src/poppins.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
font: '"Poppins", sans-serif',
|
||||||
|
googleFont: 'https://fonts.googleapis.com/css?family=Poppins:400,900',
|
||||||
|
heading: {
|
||||||
|
fontWeight: 900,
|
||||||
|
letterSpacing: '-0.05em',
|
||||||
|
},
|
||||||
|
blockquote: {
|
||||||
|
fontSize: '1.75em',
|
||||||
|
textAlign: 'left',
|
||||||
|
fontWeight: 900,
|
||||||
|
letterSpacing: '-0.05em',
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user