1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00
Commit Graph

719 Commits

Author SHA1 Message Date
Chauncey McAskill
0b667542f5 Refactor visibility.js
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".
2022-05-25 09:54:01 -04:00
Lucas Vallenet
d7de1b2566 Update scss maths comments 2022-05-25 13:57:30 +02:00
Lucas Vallenet
34bca7d68a Rename z-index layers var and update function 2022-05-25 13:54:03 +02:00
Lucas Vallenet
f44093ec19 Update scss semicolon spacings 2022-05-25 13:47:45 +02:00
Lucas Vallenet
6a4043408b Remove export comment 2022-05-25 13:28:15 +02:00
Lucas Vallenet
92500f908f Add roundNumber util 2022-05-25 13:27:40 +02:00
Lucas Vallenet
d97fa82c77 Remove array util 2022-05-25 13:27:30 +02:00
Lucas Vallenet
ccf813f6be Update functions / ES6 syntax / Add functions comments 2022-05-20 16:51:24 +02:00
Lucas Vallenet
141a8ffa97 Update scss vars namespace and add easings 2022-05-20 13:32:47 +02:00
Lucas Vallenet
e875495928 Add z-index function 2022-05-20 11:44:42 +02:00
Lucas Vallenet
c2db2e1922 Add SCSS Math functions 2022-05-20 11:42:06 +02:00
Lucas
32ba1c0eeb Merge pull request #114 from locomotivemtl/refactor/css-comments
Standardize scss comments
2022-05-18 13:58:18 +02:00
Lucas Vallenet
5199ee2025 Double comments / Paragraphs and lists line-breaks / Wrap block comments / File-level annotations syntax / Remove leading comments 2022-05-17 12:08:01 +02:00
Lucas Vallenet
d6c8fdac23 Standardize scss comments 2022-05-12 16:15:44 +02:00
Deven Caron
15a4f2e64f Merge pull request #111 from locomotivemtl/feature/font-face
Update fontface system with scss lists, function and mixin
2022-05-12 09:41:33 -04:00
Lucas Vallenet
9e35894ef1 Revert comments changes to apply to document.scss only 2022-05-12 11:01:51 +02:00
Lucas Vallenet
cabeba55c0 Fix font-face $dir error | Update description comments to SASS synthax 2022-05-02 16:56:25 +02:00
Lucas Vallenet
47974a77a9 - Merge _fonts.scss to _page.scss
- 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
2022-05-02 10:30:35 +02:00
Lucas Vallenet
e8b2a86798 Update fontface system with scss lists, function and mixin 2022-04-29 13:51:46 +02:00
Lucas Vallenet
da66f89d7f Add icon object styles and html example 2022-04-29 13:36:54 +02:00
Chauncey McAskill
53beae26b0 Fix missing link in Development documentation
Amends 9a01c0f17f
2022-03-24 13:59:02 -04:00
Chauncey McAskill
9a01c0f17f Update README and documentation
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.
2022-03-24 13:57:28 -04:00
Deven Caron
97d9f1ec00 Merge pull request #107 from locomotivemtl/feature/documentation
Rewrite README and add documentation
2022-03-24 10:03:58 -04:00
Chauncey McAskill
8b8b267e9d Rewrite README
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.
2022-03-24 09:58:40 -04:00
Deven Caron
822cf7daa8 Merge pull request #106 from locomotivemtl/feature/local-config
Add support for loconfig.local.json
2022-03-24 09:55:02 -04:00
Chauncey McAskill
7f452f1fcc Add example of loconfig.local.json 2022-03-23 14:06:11 -04:00
Chauncey McAskill
5010560ee3 Improve HTTPS/Proxy URL support in watch.js
Added logic to prepend "https://" to the proxy URL if missing.
2022-03-23 13:13:46 -04:00
Chauncey McAskill
0cfb3fbc7d Add support for loconfig.local.json
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"
        }
    }
}
```
2022-03-22 16:40:51 -04:00
Chauncey McAskill
86f88c3f14 Refactor watch.js
Switched to BrowserSync's recommended post-2.0.0 syntax.

Organized logic into functions for easier reading.

Add support for customizing the BrowserSync server from 'loconfig.json'.

Example:

```json
"server": {
    "open": true,
    "https": {
        "key": "~/.config/valet/Certificates/{% paths.url %}.key",
        "cert": "~/.config/valet/Certificates/{% paths.url %}.crt"
    }
}
```
2022-03-22 16:33:19 -04:00
Chauncey McAskill
48bd911804 Refactor template.js
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()`.
2022-03-22 16:33:19 -04:00
Chauncey McAskill
d49d3eabb2 Add file comment to notification.js 2022-03-22 16:32:24 -04:00
Chauncey McAskill
28aa6c7de6 Update NPM dependencies
Resolves #105

Updated:
- autoprefixer v10.4.2 → v10.4.4
- browser-sync v2.27.7 → v2.27.9
- esbuild v0.14.21 → v0.14.27
- postcss v8.4.6 → v8.4.12
2022-03-21 17:24:10 -04:00
Chauncey McAskill
38dd28832e Update NPM dependencies
Resolves #102

Updated:
- esbuild v0.14.14 → v0.14.21
- locomotive-scroll v4.1.3 → v4.1.4
- node-notifier v10.0.0 → v10.0.1
- postcss v8.4.5 → v8.4.6
2022-02-15 09:27:37 -05:00
Chauncey McAskill
757c26c772 Fix glob.js file comment 2022-02-15 09:16:03 -05:00
Chauncey McAskill
5e07473396 Make glob optional in concats.js
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.
2022-02-08 15:18:18 -05:00
Chauncey McAskill
c9056b27d8 Add support for removing duplicates in concats.js
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"
    }
]
```
2022-02-08 14:46:34 -05:00
Chauncey McAskill
38a6c73d2f Add support for customizing glob in concats.js
Added:
- Argument `globOptions` to `concatFiles()` function to customize glob library.
2022-02-08 14:40:00 -05:00
Chauncey McAskill
9d18205b0f Update NPM dependencies
Updated:
- autoprefixer v10.4.0 → v10.4.2
- esbuild v0.13.12 → v0.14.14
- node-sass v6.0.1 → v7.0.1
- postcss v8.3.11 → v8.4.5
2022-01-28 16:00:57 -05:00
Chauncey McAskill
1e7e90c8aa Add support for custom task labels
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"
    }
]
```
2021-12-17 10:39:35 -05:00
Chauncey McAskill
47007cddaf Fix glob.js
Amends 8dec2c69fe

Fixed:
- Forgot to rename all occurrences of 'modules' with 'candidates'.
2021-12-03 15:10:21 -05:00
Chauncey McAskill
5dd3fa843f Add support for watching multiple view paths
Added routine to convert `paths.views` into an array.

Supports a single path as a string, a map of paths, or a list of paths:

```json
"views": "./views/boilerplate/template"
```

```json
"views": {
    "src": "./views/boilerplate/template"
}
```

```json
"views": [
    "./views/boilerplate/template"
]
```
2021-12-03 11:55:35 -05:00
Chauncey McAskill
a5623d3122 Improve comments in watch.js 2021-12-03 11:52:27 -05:00
Chauncey McAskill
67e1fae8f4 Update block comment in styles.js 2021-11-03 17:08:38 -04:00
Chauncey McAskill
a95fe4523c Update postcss.js
Remove extraneous `null` assignment on optional exports.
2021-11-03 16:50:08 -04:00
Chauncey McAskill
eadc414329 Fix merging of default options for PostCSS
Amends 9e3d304654
2021-11-03 16:16:08 -04:00
Chauncey McAskill
b19c18b18c Update NPM dependencies
Updated:
- autoprefixer v10.3.7 → v10.4.0
- browser-sync v2.26.13 → v2.27.7
- esbuild v0.13.4 → v0.13.12
- postcss v8.3.9 → v8.3.11
2021-11-03 13:21:11 -04:00
Chauncey McAskill
db85740a18 Merge pull request #96 from locomotivemtl/mcaskill-refactor-build-options 2021-11-03 13:16:43 -04:00
Chauncey McAskill
5c24fabaa2 Compile assets 2021-11-03 10:50:33 -04:00
Chauncey McAskill
9e3d304654 Add support for task options
Added support for customizing processors in `scripts.js` (esbuild), `styles.js` (node-sass, postcss, autoprefixer), and `svgs.js` (svg-mixer), via arguments for the exported task functions.

Added:
- Constants to decouple shared default options, options for development, and options for production.
- Constants to export default options for development and production as an array of arguments to pass to task functions.

Changed:
- watch.js to apply development args to tasks
2021-11-03 10:49:35 -04:00
Chauncey McAskill
6ded72bc79 Refactor postcss.js
Moved creation of Processor from utility file to styles.js to allow for future customization of `postcss` and `autoprefixer`.
2021-11-03 10:49:35 -04:00