Skip to content

Commit

Permalink
feat(docz-theme-default): include media queries facepaint
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloavf committed Jun 22, 2018
1 parent 1e98401 commit 5f78734
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/docz-theme-default/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { styles } from './styles'
import * as colors from './styles/colors'
import { prismTheme } from './styles/prism-theme'
import { mq } from './styles/responsive'

export const config = {
colors,
styles,
prismTheme,
mq,
}
7 changes: 7 additions & 0 deletions packages/docz-theme-default/src/styles/responsive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import facepaint from 'facepaint'

export const mq = facepaint([
'@media(min-width: 420px)',
'@media(min-width: 920px)',
'@media(min-width: 1120px)'
])
28 changes: 28 additions & 0 deletions packages/docz-theme-default/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,31 @@ declare module '*.svg' {
const content: any
export default content
}

declare module "facepaint" {

interface Styles {
[ruleOrSelector: string]: string | number | Styles;
}

interface MqStyles {
[ruleOrSelector: string]: string | string[] | number | number[] | Styles;
}

type Mq = (styles: object) => Styles;

interface FacepaintSettings {
literal?: boolean;
overlap?: boolean;
}

type Facepaint = (
/** media queries to be applied across */
mediaQueries: [string, string, string],
settings?: FacepaintSettings
) => Mq;

const facepaint: Facepaint;

export = facepaint;
}

0 comments on commit 5f78734

Please sign in to comment.