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
/* 1. Use a more-intuitive box-sizing model */ | |
*, *::before, *::after { | |
box-sizing: border-box; | |
} | |
/* 2. Remove default margin */ | |
* { | |
margin: 0; | |
} |
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
function createCollection(arr, list, options = {}) { | |
const { | |
template, | |
emptyMessage = 'No items to display.', | |
emptyImage = '', | |
} = options; | |
if (!Array.isArray(arr)) { | |
throw new Error('Invalid argument: "arr" should be an array.'); | |
} |
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
function createMarkup(arr, list, options = {}) { | |
// Default options | |
const { imgWidth = 300 } = options; | |
if (!Array.isArray(arr)) { | |
throw new Error('Invalid argument: "arr" should be an array.'); | |
} | |
if (!(list instanceof HTMLElement)) { | |
throw new Error('Invalid argument: "list" should be a valid DOM element.'); |
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
const save = (key, value) => { | |
try { | |
const serializedState = JSON.stringify(value); | |
localStorage.setItem(key, serializedState); | |
} catch (error) { | |
console.error('Set state error: ', error.message); | |
} | |
}; | |
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
{ | |
"liveSassCompile.settings.formats": [ | |
{ | |
"format": "expanded", | |
"extensionName": ".css", | |
"savePath": "/css" | |
}, | |
{ | |
"format": "compressed", | |
"extensionName": ".min.css", |
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
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/1.1.0/modern-normalize.min.css" integrity="sha512-wpPYUAdjBVSE4KJnH1VR1HeZfpl1ub8YT/NKx4PuQ5NmX2tKuGu6U/JRp5y+Y8XG2tV+wKQpNHVUX03MfMFn9Q==" crossorigin="anonymous" referrerpolicy="no-referrer" /> |
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
{ | |
"printWidth": 100, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"trailingComma": "es5", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": false, | |
"arrowParens": "avoid", |