Skip to content

Commit e0e5f6f

Browse files
authored
fix: 🐛 fix inaccurate wording in README (#2268)
1 parent c704359 commit e0e5f6f

1 file changed

Lines changed: 32 additions & 33 deletions

File tree

README.md

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ styled-breakpoints <br>
4545

4646
## 🌼 Preview
4747

48-
**Inside** components.
48+
**Inline** in styles.
4949

5050
```tsx
5151
const Box = styled.div`
@@ -63,13 +63,13 @@ const Box = styled.div`
6363

6464
<br>
6565

66-
**Outside** of components.
66+
Via the **hook**.
6767

6868
```tsx
6969
import { useTheme } from 'styled-components'; // or '@emotion/react'
7070

7171
const Layout = () => {
72-
const theme = useTheme()
72+
const theme = useTheme();
7373
const isMd = useMediaQuery(theme.breakpoints.up('md'));
7474

7575
return <>{isMd && <Box />}</>;
@@ -133,11 +133,11 @@ From largest to smallest
133133

134134
## 🧐 Core concepts
135135

136-
- **Breakpoints act as the fundamental elements of responsive design**. They enable you to control when your layout can adapt to a specific viewport or device size.
136+
- **Breakpoints are the foundation of responsive design**. They let you control when your layout adapts to a specific viewport or device size.
137137

138-
- **Utilize media queries to structure your CSS based on breakpoints**. Media queries are CSS features that allow you to selectively apply styles depending on a defined set of browser and operating system parameters. The most commonly used media query property is <code>min-width</code>.
138+
- **Use media queries to structure your CSS around breakpoints**. Media queries are a CSS feature that lets you apply styles conditionally based on browser and device parameters most commonly `min-width`.
139139

140-
- **The primary goal is mobile-first responsive design.**. Styled Breakpoints aims to apply the essential styles required for a layout to function at the smallest breakpoint. Additional styles are progressively added for larger screens. This approach optimizes your CSS, enhances rendering speed, and delivers an excellent user experience.
140+
- **The goal is mobile-first responsive design**. Styled Breakpoints applies the essential styles needed at the smallest breakpoint first, then progressively adds styles for larger screens. This keeps your CSS lean, improves rendering speed, and delivers a better user experience.
141141

142142
<br>
143143

@@ -181,13 +181,11 @@ const breakpoints = {
181181
lg: '992px',
182182
xl: '1200px',
183183
xxl: '1400px',
184-
}
184+
},
185185
};
186186
```
187187

188-
Each breakpoint is based on common responsive design conventions and aligns with container widths that are multiples of 12. These breakpoints also correspond to widely used viewport ranges, but they are not tied to specific devices.
189-
190-
Instead, they provide a consistent foundation for building responsive layouts that work across most screen sizes.
188+
Each breakpoint follows common responsive design conventions, with widths that are multiples of 12. They align with widely used viewport ranges but aren't tied to specific devices — just a consistent foundation for layouts that work across most screen sizes.
191189

192190
<br>
193191

@@ -216,11 +214,12 @@ import { createStyledBreakpointsTheme } from 'styled-breakpoints';
216214
export const theme = createStyledBreakpointsTheme({
217215
breakpoints: {
218216
values: {
219-
phone: '0px',
217+
watch: '0px',
220218
mobile: '200px',
221-
laptop: '300px',
222-
desktop: '400px',
223-
}
219+
tablet: '600px',
220+
laptop: '900px',
221+
desktop: '1400px',
222+
},
224223
},
225224
});
226225
```
@@ -235,11 +234,11 @@ export const theme = createStyledBreakpointsTheme({
235234
import { createStyledBreakpointsTheme } from 'styled-breakpoints';
236235

237236
const mainTheme = {
238-
fonts: ["sans-serif", "Lato"],
237+
fonts: ['sans-serif', 'Lato'],
239238
fontSizes: {
240-
small: "1em",
241-
medium: "2em",
242-
large: "3em",
239+
small: '1em',
240+
medium: '2em',
241+
large: '3em',
243242
},
244243
} as const;
245244

@@ -271,10 +270,10 @@ yarn add styled-components
271270
`theme/styled.d.ts`
272271

273272
```ts
274-
import "styled-components";
275-
import { AppThemeType } from "./index";
273+
import 'styled-components';
274+
import { AppThemeType } from './index';
276275

277-
declare module "styled-components" {
276+
declare module 'styled-components' {
278277
export interface DefaultTheme extends AppThemeType {}
279278
}
280279
```
@@ -303,10 +302,10 @@ yarn add @emotion/{styled,react}
303302
`theme/emotion.d.ts`
304303

305304
```ts
306-
import "@emotion/react";
307-
import { AppThemeType } from "./index";
305+
import '@emotion/react';
306+
import { AppThemeType } from './index';
308307

309-
declare module "@emotion/react" {
308+
declare module '@emotion/react' {
310309
export interface Theme extends AppThemeType {}
311310
}
312311
```
@@ -322,7 +321,7 @@ declare module "@emotion/react" {
322321

323322
```tsx
324323
import { ThemeProvider } from 'styled-components'; // or '@emotion/react'
325-
import styled from "styled-components"; // or '@emotion/styled'
324+
import styled from 'styled-components'; // or '@emotion/styled'
326325

327326
import { theme } from './theme';
328327

@@ -375,7 +374,7 @@ const Box = styled.div`
375374

376375
### Max-width - `down`
377376

378-
We occasionally use media queries that go in the other direction (the given screen size or smaller):
377+
Sometimes you need a media query that goes the other direction (the given screen size or smaller):
379378

380379
<br>
381380

@@ -407,7 +406,7 @@ const Box = styled.div`
407406

408407
### Single breakpoint - `only`
409408

410-
There are also media queries and mixins for targeting a single segment of screen sizes using the minimum and maximum breakpoint widths.
409+
There's also a way to target a single segment of screen sizes using the minimum and maximum breakpoint widths.
411410

412411
<br>
413412

@@ -465,9 +464,9 @@ const Box = styled.div`
465464

466465
features:
467466

468-
- 🧐 Reactive media query tracking with optimal performance
469-
- 💪🏻 SSR-safe via `getServerSnapshot`
470-
- 📦 Lightweight and minimal overhead
467+
- 🧐 Reactive media query tracking, optimized for performance
468+
- 💪🏻 Safe for SSR via `getServerSnapshot`
469+
- 📦 Lightweight, minimal overhead
471470

472471
<br>
473472

@@ -477,7 +476,7 @@ import { useMediaQuery } from 'styled-breakpoints/use-media-query';
477476
import { Box } from 'third-party-library';
478477

479478
const SomeComponent = () => {
480-
const theme = useTheme()
479+
const theme = useTheme();
481480
const isMd = useMediaQuery(theme.breakpoints.only('md'));
482481

483482
return <Box>{isMd && <Box />}</Box>;
@@ -492,7 +491,7 @@ const SomeComponent = () => {
492491
declare function useMediaQuery(
493492
query: string,
494493
options?: {
495-
getServerSnapshot: () => boolean
494+
getServerSnapshot: () => boolean;
496495
}
497496
): boolean;
498497
```
@@ -503,7 +502,7 @@ declare function useMediaQuery(
503502
CSS media query to evaluate.
504503
Accepts values with or without the `@media` prefix.
505504

506-
- `options` _(optional)_
505+
- `options` _(optional)_
507506
- `getServerSnapshot`
508507
Function used during SSR to provide a stable boolean value for the initial render.
509508

0 commit comments

Comments
 (0)