-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement responsiveness with srcSet and sizes (#159)
* chore(readme): fix typo and update codesandbox examples (#158) * chore(readme): fix typo in readme * chore(readme): edit codesandbox iframes to be links instead * chore(jest): upgrade jest to support new expect functions * test: use srcset and sizes - generateSrcSet -> disableSrcSet - remove aggressiveLoad - remove precision - add sizes top-level prop * chore: update build:watch to build es instead of commonjs * feat: add constants file and targetWidths from imgix.js * test: mock window.screen for unit tests * feat: use srcset and sizes - generateSrcSet -> disableSrcSet - remove - remove precision - add sizes top-level prop - remove empty img - remove defaultWidth and defaultHeight - remove fluid prop - remove auto-sizing behaviour in favour of srcsets - add check to ensure sizes is passed when in image mode and no width and heights have been passed * test: refactor alt test * test: refactor ixlib tests to use expectSrcTo * chore: stop using ...other in props * chore: rename support.js -> constructUrl.js * feat: add fallback srcset when using sizes * feat: update targetWidths with up to date reses, and remove max restriction * chore: remove fixed TODO * docs: update README for new srcSet/sizes * test: add srcSet test for <source> * feat: use 2x and 3x srcSets for pictures * docs: update markdown link * docs: add sizes doc * chore: cleanup unused code * chore: update targetWidth * feat: remove type=bg and add reference to issue * chore: remove availWidth and availHeight constants as they're not used * chore: update fit logic * test: remove type=bg tests * docs: remove reference to unimplemented aspect ratio behaviour * docs: add upgrade guide * chore: refactor some code to be more readable
- Loading branch information
1 parent
8aec071
commit fa68df6
Showing
10 changed files
with
886 additions
and
1,134 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as CONSTANTS } from "./constants"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const CONSTANTS = {}; | ||
|
||
export default CONSTANTS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.