Skip to content

Releases: mg901/styled-breakpoints

v12.1.2

08 Jul 07:24
Compare
Choose a tag to compare

12.1.2 (2023-07-08)

Bug Fixes

  • docs: reorganize documentation structure (#1546) (b70a1e9)

v12.1.1

11 Jun 09:16
Compare
Choose a tag to compare

12.1.1 (2023-06-11)

Bug Fixes

  • docs: add import of MediaQueries type to Strict Typed Breakpoints section (1799035)

v12.1.0

09 Jun 08:37
Compare
Choose a tag to compare

12.1.0 (2023-06-09)

Features

  • add strict types for default and custom media queries (8794580), closes #1390

app.tsx

import styled from 'styled-components'; // or from '@emotion/react'
import { createStyledBreakpointsTheme, MediaQueries } from 'styled-breakpoints';

const breakpoints = {
  small: '0px',
  medium: '640px',
  large: '1024px',
  xLarge: '1200px',
  xxLarge: '1440px',
} as const;

type Min = keyof typeof breakpoints;

// For max values remove the first key.
type Max = Exclude<keyof typeof breakpoints, 'small'>;

export interface StyledBreakpointsTheme {
  breakpoints: MediaQueries<Min, Max>;
}

const theme = createStyledBreakpointsTheme({
  breakpoints,
}) as StyledBreakpointsTheme;

const App = () => (
  <ThemeProvider theme={theme}>
    <Block />
  </ThemeProvider>
);

styled.d.ts

import 'styled-components';
import { StyledBreakpointsTheme } from './app';

declare module 'styled-components' {
  export interface DefaultTheme extends StyledBreakpointsTheme {}
}

or

emotion.d.ts

import '@emotion/react';
import { StyledBreakpointsTheme } from './app';

declare module '@emotion/react' {
  export interface Theme extends StyledBreakpointsTheme {}
}

v12.0.4

29 May 11:22
Compare
Choose a tag to compare

12.0.4 (2023-05-29)

Bug Fixes

  • fix a bug that occurred when passing custom breakpoints (225ee5b)

v12.0.3

23 May 17:25
Compare
Choose a tag to compare

12.0.3 (2023-05-23)

Bug Fixes

  • add banner in support of Ukraine (c6bab5a)
  • fix typography in documentation (acb747c)
  • fix typography in documentation (#1504) (e2611b0)

v12.0.2

23 May 12:18
Compare
Choose a tag to compare

12.0.2 (2023-05-23)

Bug Fixes

  • fix broken link to useMediaQuery hook (51ee3d6)

v12.0.1

23 May 11:08
Compare
Choose a tag to compare

12.0.1 (2023-05-23)

Bug Fixes

  • add guide for migration from useBreakpoint to useMediaQuery (3beb3d3)

v12.0.0

23 May 10:45
Compare
Choose a tag to compare

12.0.0 (2023-05-23)

Features

  • add docs for v12 (1b8d610)
  • add useMediaQuery hook (dcceefb)
  • add correct types for createStyledBreakpointsTheme (86fe548)
  • add correct types for DefaultStyledBreakpointsTheme (#1494) (fcf7463)
  • add correct types for styled breakpoints (1d4bc62)
  • remove createTheme, up, down, between, only (6b9ac35), closes #1453 #1449 #1486
  • set options as optional argument (#1493) (f35715a)

BREAKING CHANGES

  • remove functions createTheme, up, down, between, only,useBreakpoint.
    Remove react-styled and react-emotion directoies.

v12.0.0-beta.7

23 May 10:38
Compare
Choose a tag to compare
v12.0.0-beta.7 Pre-release
Pre-release

12.0.0-beta.7 (2023-05-23)

Features

v12.0.0-beta.6

12 May 10:45
Compare
Choose a tag to compare
v12.0.0-beta.6 Pre-release
Pre-release

12.0.0-beta.6 (2023-05-12)

Features

  • add correct types for styled breakpoints (1d4bc62)