Releases: mg901/styled-breakpoints
Releases · mg901/styled-breakpoints
v12.1.2
v12.1.1
v12.1.0
12.1.0 (2023-06-09)
Features
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
v12.0.3
v12.0.2
v12.0.1
v12.0.0
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
.
Removereact-styled
andreact-emotion
directoies.