Skip to content

Commit

Permalink
fix: fix readme (#854)
Browse files Browse the repository at this point in the history
* fix: fix readme

* feat(default-breakpoints): add xs

* build: increase the limit
  • Loading branch information
mg901 authored Nov 30, 2020
1 parent 910295f commit f211a17
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ yarn styled-breakpoints

```js
{
xs: '0px',
sm: '576px',
md: '768px',
lg: '992px',
Expand Down
1 change: 1 addition & 0 deletions core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports.makeStyledBreakpoints = (options) => {
pathToMediaQueries: _options.pathToMediaQueries || ['breakpoints'],
errorPrefix: _options.errorPrefix || '[styled-breakpoints]: ',
defaultMediaQueries: _options.defaultMediaQueries || {
xs: '0px',
sm: '576px',
md: '768px',
lg: '992px',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
"import": {
"index.js": "{ up, dow, between, only }"
},
"limit": "1020 B"
"limit": "1080 B"
},
{
"name": "core + react-styled",
"import": {
"index.js": "{ up, dow, between, only }",
"react-styled/index.js": "{ useBreakpoint }"
},
"limit": "1.15 KB",
"limit": "1.18 KB",
"ignore": [
"react",
"styled-components"
Expand All @@ -72,7 +72,7 @@
"index.js": "{ up, dow, between, only }",
"react-emotion/index.js": "{ useBreakpoint }"
},
"limit": "1.15 KB",
"limit": "1.18 KB",
"ignore": [
"react",
"@emotion/react"
Expand Down
8 changes: 5 additions & 3 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('throwIsInvalidBreakName', () => {
expect(true).toEqual(false);
} catch (e) {
expect(e.message).toEqual(
"[styled-breakpoints]: 'blabla' is invalid breakpoint name. Use 'sm, md, lg, xl'."
"[styled-breakpoints]: 'blabla' is invalid breakpoint name. Use 'xs, sm, md, lg, xl'."
);
}
});
Expand All @@ -73,7 +73,7 @@ describe('custom error prefix', () => {
expect(true).toEqual(false);
} catch (e) {
expect(e.message).toEqual(
"[typographist]: 'blabla' is invalid breakpoint name. Use 'sm, md, lg, xl'."
"[typographist]: 'blabla' is invalid breakpoint name. Use 'xs, sm, md, lg, xl'."
);
}
});
Expand Down Expand Up @@ -132,6 +132,7 @@ describe('toEm', () => {
describe('getBreakpointsFromTheme', () => {
it('return breakpoints from custom theme', () => {
expect(getBreakpointsFromTheme(CUSTOM_THEME)).toEqual({
xs: '0px',
sm: '576px',
md: '768px',
lg: '992px',
Expand All @@ -140,7 +141,8 @@ describe('getBreakpointsFromTheme', () => {
});

it('return default breakpoints', () => {
expect(getBreakpointsFromTheme(EMPTY_THEME)).toMatchObject({
expect(getBreakpointsFromTheme(EMPTY_THEME)).toEqual({
xs: '0px',
sm: '576px',
md: '768px',
lg: '992px',
Expand Down
3 changes: 2 additions & 1 deletion test/library.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('type', () => {
describe('get', () => {
it('return value stored at the specified path', () => {
expect(get(['theme', 'breakpoints'], PROPS_WITH_CUSTOM_THEME)).toEqual({
xs: '0px',
sm: '576px',
md: '768px',
lg: '992px',
Expand All @@ -47,7 +48,7 @@ describe('withMinAndMaxMedia', () => {
describe('makeErrorMessage', () => {
it('build error message', () => {
expect(makeErrorMessage('blabla', BREAKPOINTS)).toEqual(
"'blabla' is invalid breakpoint name. Use 'sm, md, lg, xl'."
"'blabla' is invalid breakpoint name. Use 'xs, sm, md, lg, xl'."
);
});
});
1 change: 1 addition & 0 deletions test/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const INVALID_BREAKPOINTS = {
const PROPS_WITH_CUSTOM_THEME = {
theme: {
breakpoints: {
xs: '0px',
sm: '576px',
md: '768px',
lg: '992px',
Expand Down

0 comments on commit f211a17

Please sign in to comment.