Skip to content

Is there a way to override the default breakpoint types?  #22

Description

@angusd3v

The npm page for this library lists these instructions for setting the types for themed breakpoints:

import {DefaultTheme} from 'styled-components';
 
declare module 'styled-components' {
  export interface DefaultTheme {
    breakpoints: {
      [name in 'xs' | 'sm' | 'md' | 'lg' | 'xl']: number;
    };
  }
}

However, even after doing this, the only valid types to pass to breakpoint() are desktop, tablet, and mobile. Is this functionality currently working? The types look hardcoded to those original values:

export declare const breakpoint: (breakpointA: import("./types").DefaultBreakpointName, breakpointB?: "mobile" | "tablet" | "desktop" | undefined) => CSSFunction;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions