From 51ee3d655374282050138901becdb31134f3d017 Mon Sep 17 00:00:00 2001 From: Maxim Alyoshin Date: Tue, 23 May 2023 16:14:04 +0400 Subject: [PATCH] fix: fix broken link to `useMediaQuery` hook --- README.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e07d8228..142b9757 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,16 @@ styled-breakpoints
coverage status - -npm bundle size + +npm bundle size - npm downloads +npm downloads npm version +

Simple and powerful tool for creating media queries with SSR support.

@@ -87,7 +88,7 @@ From largest to smallest Edit desktop first example -### useMediaQuery hook +### hooks API Hooks api (styled-components) @@ -104,7 +105,7 @@ From largest to smallest - [max-width](#max-width) - [single breakpoint](#single-breakpoint) - [between breakpoints](#between-breakpoints) - - [useMediaQuery](#useMediaQuery-hook) + - [use media query hook](#usemediaquery-hook) - [customization](#customization) - [breakpoints](#breakpoints) - [merge with another theme](#merge-with-another-theme) @@ -517,7 +518,7 @@ const App = () => ( import { ThemeProvider } from 'styled-components'; import { createStyledBreakpointsTheme } from 'styled-breakpoints'; -export const someTheme = { +export const primaryTheme = { fonts: ['sans-serif', 'Roboto'], fontSizes: { small: '1em', @@ -527,7 +528,7 @@ export const someTheme = { } as const; const const theme = { - ...someTheme, + ...primaryTheme, ...createStyledBreakpointsTheme(), } @@ -543,10 +544,12 @@ Create file `styled.d.ts` ```ts import 'styled-components'; import { StyledBreakpointsTheme } from 'styled-breakpoints'; -import { someTheme } from './app'; +import { primaryTheme } from './app'; + +type PrimaryTheme = typeof primaryTheme; declare module 'styled-components' { - export interface DefaultTheme extends someTheme, StyledBreakpointsTheme {} + export interface DefaultTheme extends PrimaryTheme, StyledBreakpointsTheme {} } ``` @@ -560,7 +563,7 @@ declare module 'styled-components' { import { ThemeProvider } from '@emotion/react'; import { createStyledBreakpointsTheme } from 'styled-breakpoints'; -export const someTheme = { +export const primaryTheme = { fonts: ['sans-serif', 'Roboto'], fontSizes: { small: '1em', @@ -570,7 +573,7 @@ export const someTheme = { } as const; const const theme = { - ...someTheme, + ...primaryTheme, ...styledBreakpointsTheme(), } @@ -586,10 +589,12 @@ const App = () => ( ```ts import '@emotion/react'; import { StyledBreakpointsTheme } from 'styled-breakpoints'; -import { someTheme } from './app'; +import { primaryTheme } from './app'; + +type PrimaryTheme = typeof primaryTheme; declare module '@emotion/react' { - export interface Theme extends someTheme, StyledBreakpointsTheme {} + export interface Theme extends PrimaryTheme, StyledBreakpointsTheme {} } ```