Replaced custom callback stacks for executing handlers on page visibility change with native event listener interface and custom event types.
Added:
- Class `PageVisibility` with methods to disable/enable custom event types and check if feature is enabled.
- Custom event types "visibilityhidden" and "visibilityvisible".
- Rename _page.scss to _document.scss
- Rename $fontfaces to $font-faces for consistency
- Document _fonts.scss mixins and functions
- Create mixins @font-face for one face
Changed:
- Features, Installation, and Development sections in README.
- Introduction, Configuration, and Tasks in Development.
- Heading levels in Technologies.
Fixed:
- Anchors to option sections in Development.
And split sections from README into dedicated documentation files.
Added:
- "Features" section to summarize the boilerplate's architecture.
- "Getting Started" section to describe how to create a project from the boilerplate.
- "Development" documentation to describe how NPM dependencies, configuring assets and tasks.
- "Technologies" documentation to describe CSS, JS, Locomotive Scroll, ModularLoad, ModularJS.
Changed:
- Moved section "Configuration" to 'docs/development.md'.
- Moved sections "Styles", "Scripts", "Page transitions", and "Scroll detection" to 'docs/technologies.md'.
TODO:
- Move "Environment configuration" section from "Development" to 'feature/local-config' branch.
If a 'loconfig.local.json' file is present (ignored by git), its settings will be merged with those in 'loconfig.json'. Useful for customizing localhost development (see example below).
Added:
- Utility 'config.js' to prepare build settings.
- Function 'merge()' for recursively merging objects and concatenating arrays.
Example:
```json
{
"paths": {
"url": "yourlocal.dev"
},
"server": {
"open": true,
"https": {
"key": "~/.config/valet/Certificates/{% paths.url %}.key",
"cert": "~/.config/valet/Certificates/{% paths.url %}.crt"
}
}
}
```
Added:
- Function `resolve()` to process any template tags (in a string) in objects and arrays.
Changed:
- Renamed function `template()` to `resolveValue()`.
- Replaced default export `resolveValue()` with new function `resolve()`.
Added:
- Condition to process includes with glob if it's available.
Changed:
- Utility 'glob.js' to not throw an error if a glob function is unavailable.
Added:
- Argument `concatOptions` to `concatFiles()` function to customize concatenation.
- Option 'removeDuplicates' to `concatOptions` to remove duplicate paths from the array of globbed paths. Defaults to `true`.
The 'removeDuplicates' is useful for customizing the order of files to concatenate, in which globbing will usually sort paths alphabetically.
This option is convenient when the installed glob library does not support removing duplicates on their own (feature supported in 'fast-glob' and 'glob').
Example:
```
/assets/scripts/vendors/a.js
/assets/scripts/vendors/b.js
/assets/scripts/vendors/c.js
/assets/scripts/vendors/d.js
```
```json
"concats": [
{
"includes": [
"{% paths.scripts.src %}/vendors/c.js",
"{% paths.scripts.src %}/vendors/*.js"
],
"outfile": "{% paths.scripts.dest %}/vendors.js"
}
]
```
If ever the basename from the outfile or outdir is an insufficient description.
Example:
```json
"concats": [
{
"label": "third-parties",
"includes": [
"{% paths.scripts.src %}/vendors/*.js"
],
"outfile": "{% paths.scripts.dest %}/vendors.js"
}
]
```