Options
All
  • Public
  • Public/Protected
  • All
Menu

styled-components-media-query

Index

Interfaces

Variables

Functions

Object literals

Variables

Const mqExec

mqExec: (Anonymous function) = MqInit()

Functions

Const MqInit

  • MqInit(__namedParameters?: object): (Anonymous function)
  • Initialize media query

    Usage

    import { styled, css } from 'styled-components'
    import MqInit from 'styled-components-media-query'
    
    // initialize
    const bp = {s: 400, sl: 500, m: 768, ml: 992, l: 1100}
    const mq = MqInit({ bp })
    
    // use like this
    const ComponentStyled = styled.div`
     position: relative;
     ${mq('m')(css`
       position: absolute;
     `)}
     ${mq('l')(css`
       position: fixed;
     `)}
    `

    Parameters

    • Default value __namedParameters: object = {}
      • bp: object
        • l: number
        • m: number
        • ml: number
        • s: number
        • sl: number
        • xl: number
        • xs: number
        • xxl: number
        • xxs: number
        • xxxl: number
        • xxxs: number
        • xxxxl: number
        • xxxxxl: number
        • xxxxxxl: number
      • type: string

    Returns (Anonymous function)

    A styled-component css string.

Const getBpValue

  • getBpValue(val: number | string | null | undefined, bp: Ibp): number
  • Parameters

    • val: number | string | null | undefined
    • bp: Ibp

    Returns number

Object literals

Const bpDefaults

bpDefaults: object

l

l: number = 1100

m

m: number = 768

ml

ml: number = 992

s

s: number = 400

sl

sl: number = 500

xl

xl: number = 1200

xs

xs: number = 320

xxl

xxl: number = 1300

xxs

xxs: number = 200

xxxl

xxxl: number = 1400

xxxs

xxxs: number = 0

xxxxl

xxxxl: number = 1500

xxxxxl

xxxxxl: number = 1600

xxxxxxl

xxxxxxl: number = 1700

Generated using TypeDoc