Options
All
  • Public
  • Public/Protected
  • All
Menu

This class utilizes the css to javascript breakpoint service provided by the "@neunerlei/sassy" package to create a breakpoint api in javascript which is configured in css.

If you don't want to use the sassy library, but still want access to this api you have to create a css class that defines a "font-family" with a value like the following: font-family: "xxs: 0|449px, xs: 0|549px, sm: 550px|767px, md: 768px|991px, lg: 992px|1199px, xl: 1200px|999999px";

The key is the name of the breakpoint, the first number is the "min" value of the breakpoint, the second (after the pipe) the "max" value of the breakpoint

Hierarchy

  • BreakpointService

Index

Constructors

constructor

Methods

Static bpIs

  • bpIs(comparator: "<=" | "==" | ">=" | ">" | "<" | "!=", breakpointKey: string): boolean
  • Checks if the current breakpoint which was configured using its css counterpart of bootstrap-addons is (bigger, smaller, the same, not) as a given other breakpoint key ("sm", "lg"...)

    To add your own breakpoints take a look at the "$js-breakpoints" variable in config.sass

    Parameters

    • comparator: "<=" | "==" | ">=" | ">" | "<" | "!="

      The operator to use for the comparison

    • breakpointKey: string

      The other breakpoint to compare with the current one

    Returns boolean

Static configure

  • Can be used to customize the settings for the breakpoint service

    Parameters

    • opts: BreakpointsConfigureOptions
             - container: The container selector to create the breakpoint marker in (DEFAULT: 'body')
             - template: The html template to append to the breakpointContainer (DEFAULT: '<div class="sassy-breakpoint-service"></div>')
             - inTemplateSelector: Can be used if multi-layered templates are required to get the correct element to read the css definition from.
      

    Returns void

Static getAll

Static getCurrent

Static getForWidth

Static getSingle

  • Returns the definition for a single breakpoint with the given key It may return null if it is called on the server side. It throws an error if a non existent breakpoint key was requested

    Parameters

    • key: string

    Returns null | Breakpoint

Generated using TypeDoc