mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
Compare commits
8 Commits
mcaskill/n
...
6f04e21146
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f04e21146 | ||
|
|
97b0d57dbd | ||
|
|
c434d0843f | ||
|
|
5f8767f04d | ||
|
|
b4ee0955c3 | ||
|
|
1ec1229fe4 | ||
|
|
d593fe5409 | ||
|
|
f8a46043a6 |
12
.gitignore
vendored
12
.gitignore
vendored
@@ -5,13 +5,9 @@ loconfig.*.json
|
|||||||
!loconfig.example.json
|
!loconfig.example.json
|
||||||
.prettierrc
|
.prettierrc
|
||||||
|
|
||||||
www/assets/scripts/app.js
|
www/assets/scripts/*
|
||||||
www/assets/scripts/app.js.map
|
!www/assets/scripts/.gitkeep
|
||||||
www/assets/scripts/vendors.js
|
www/assets/styles/*
|
||||||
|
!www/assets/styles/.gitkeep
|
||||||
www/assets/styles/main.css
|
|
||||||
www/assets/styles/main.css.map
|
|
||||||
www/assets/styles/critical.css
|
|
||||||
www/assets/styles/critical.css.map
|
|
||||||
|
|
||||||
assets.json
|
assets.json
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
> [!WARNING]
|
||||||
|
> This repository is no longer maintained. We recommend checking out our [Astro](https://github.com/locomotivemtl/astro-boilerplate) or [Craft](https://github.com/locomotivemtl/craft-boilerplate) boilerplates instead.
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/locomotivemtl/locomotive-boilerplate">
|
<a href="https://github.com/locomotivemtl/locomotive-boilerplate">
|
||||||
<img src="https://user-images.githubusercontent.com/4596862/54868065-c2aea200-4d5e-11e9-9ce3-e0013c15f48c.png" height="140">
|
<img src="https://user-images.githubusercontent.com/4596862/54868065-c2aea200-4d5e-11e9-9ce3-e0013c15f48c.png" height="140">
|
||||||
@@ -23,8 +26,8 @@ Learn more about [languages and technologies](docs/technologies.md).
|
|||||||
|
|
||||||
Make sure you have the following installed:
|
Make sure you have the following installed:
|
||||||
|
|
||||||
* [Node] — at least 17.9, the latest LTS is recommended.
|
* [Node] — at least 20, the latest LTS is recommended.
|
||||||
* [NPM] — at least 8.0, the latest LTS is recommended.
|
* [NPM] — at least 10, the latest LTS is recommended.
|
||||||
|
|
||||||
> 💡 You can use [NVM] to install and use different versions of Node via the command-line.
|
> 💡 You can use [NVM] to install and use different versions of Node via the command-line.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import svg4everybody from 'svg4everybody';
|
|
||||||
import { ENV } from './config';
|
import { ENV } from './config';
|
||||||
|
|
||||||
// Dynamic imports for development mode only
|
// Dynamic imports for development mode only
|
||||||
@@ -11,11 +10,6 @@ let gridHelper;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
/**
|
|
||||||
* Use external SVG spritemaps
|
|
||||||
*/
|
|
||||||
svg4everybody();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add grid helper
|
* Add grid helper
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ $input-icon-color: 424242; // No #
|
|||||||
.c-form_input {
|
.c-form_input {
|
||||||
padding: rem(10px);
|
padding: rem(10px);
|
||||||
border: 1px solid lightgray;
|
border: 1px solid lightgray;
|
||||||
background-color: color(lightest);
|
background-color: colorCode(lightest);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: darkgray;
|
border-color: darkgray;
|
||||||
@@ -71,7 +71,7 @@ $checkbox-icon-color: $input-icon-color;
|
|||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
background-color: color(lightest);
|
background-color: colorCode(lightest);
|
||||||
border: 1px solid lightgray;
|
border: 1px solid lightgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background-color: color(darkest);
|
background-color: colorCode(darkest);
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
width: 7px;
|
width: 7px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
// Vendors
|
// Vendors
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@import "node_modules/locomotive-scroll/dist/locomotive-scroll";
|
@import "../../node_modules/locomotive-scroll/dist/locomotive-scroll";
|
||||||
|
|
||||||
// Elements
|
// Elements
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
@use 'sass:color';
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Settings / Config / Colors
|
// Settings / Config / Colors
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -18,7 +20,7 @@ $colors: (
|
|||||||
//
|
//
|
||||||
// ```scss
|
// ```scss
|
||||||
// .c-box {
|
// .c-box {
|
||||||
// color: color(primary);
|
// color: colorCode(primary);
|
||||||
// }
|
// }
|
||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
@@ -26,7 +28,7 @@ $colors: (
|
|||||||
// @param {number} $alpha - The alpha for the color value.
|
// @param {number} $alpha - The alpha for the color value.
|
||||||
// @return {color}
|
// @return {color}
|
||||||
|
|
||||||
@function color($key, $alpha: 1) {
|
@function colorCode($key, $alpha: 1) {
|
||||||
@if not map-has-key($colors, $key) {
|
@if not map-has-key($colors, $key) {
|
||||||
@error "Unknown '#{$key}' in $colors.";
|
@error "Unknown '#{$key}' in $colors.";
|
||||||
}
|
}
|
||||||
@@ -44,13 +46,13 @@ $colors: (
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Link
|
// Link
|
||||||
$color-link: color(primary);
|
$color-link: colorCode(primary);
|
||||||
$color-link-focus: color(primary);
|
$color-link-focus: colorCode(primary);
|
||||||
$color-link-hover: darken(color(primary), 10%);
|
$color-link-hover: color.adjust(colorCode(primary), $lightness: -10%);
|
||||||
|
|
||||||
// Selection
|
// Selection
|
||||||
$color-selection-text: color(darkest);
|
$color-selection-text: colorCode(darkest);
|
||||||
$color-selection-background: color(lightest);
|
$color-selection-background: colorCode(lightest);
|
||||||
|
|
||||||
// Socials
|
// Socials
|
||||||
$color-facebook: #3B5998;
|
$color-facebook: #3B5998;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ $assets-path: "../" !default;
|
|||||||
// Base
|
// Base
|
||||||
$font-size: 16px;
|
$font-size: 16px;
|
||||||
$line-height: math.div(24px, $font-size);
|
$line-height: math.div(24px, $font-size);
|
||||||
$font-color: color(darkest);
|
$font-color: colorCode(darkest);
|
||||||
|
|
||||||
// Weights
|
// Weights
|
||||||
$font-weight-light: 300;
|
$font-weight-light: 300;
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
* @file Provides simple user configuration options.
|
* @file Provides simple user configuration options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import loconfig from '../../loconfig.json' assert { type: 'json' };
|
import loconfig from '../../loconfig.json' with { type: 'json' };
|
||||||
import { merge } from '../utils/index.js';
|
import { merge } from '../utils/index.js';
|
||||||
|
|
||||||
let usrconfig;
|
let usrconfig;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
usrconfig = await import('../../loconfig.local.json', {
|
usrconfig = await import('../../loconfig.local.json', {
|
||||||
assert: { type: 'json' },
|
with: { type: 'json' },
|
||||||
});
|
});
|
||||||
usrconfig = usrconfig.default;
|
usrconfig = usrconfig.default;
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,9 @@ import resolve from '../helpers/template.js';
|
|||||||
import { merge } from '../utils/index.js';
|
import { merge } from '../utils/index.js';
|
||||||
import { writeFile } from 'node:fs/promises';
|
import { writeFile } from 'node:fs/promises';
|
||||||
import { basename } from 'node:path';
|
import { basename } from 'node:path';
|
||||||
import { promisify } from 'node:util';
|
|
||||||
import * as sass from 'sass';
|
import * as sass from 'sass';
|
||||||
import { PurgeCSS } from 'purgecss';
|
import { PurgeCSS } from 'purgecss';
|
||||||
|
|
||||||
const sassRender = promisify(sass.render);
|
|
||||||
|
|
||||||
let postcssProcessor;
|
let postcssProcessor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,16 +21,15 @@ let postcssProcessor;
|
|||||||
* @const {object} productionSassOptions - The predefined Sass options for production.
|
* @const {object} productionSassOptions - The predefined Sass options for production.
|
||||||
*/
|
*/
|
||||||
export const defaultSassOptions = {
|
export const defaultSassOptions = {
|
||||||
omitSourceMapUrl: true,
|
sourceMapIncludeSources: true,
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
sourceMapContents: true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const developmentSassOptions = Object.assign({}, defaultSassOptions, {
|
export const developmentSassOptions = Object.assign({}, defaultSassOptions, {
|
||||||
outputStyle: 'expanded',
|
style: 'expanded',
|
||||||
});
|
});
|
||||||
export const productionSassOptions = Object.assign({}, defaultSassOptions, {
|
export const productionSassOptions = Object.assign({}, defaultSassOptions, {
|
||||||
outputStyle: 'compressed',
|
style: 'compressed',
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,10 +123,7 @@ export default async function compileStyles(sassOptions = null, postcssOptions =
|
|||||||
infile = resolve(infile);
|
infile = resolve(infile);
|
||||||
outfile = resolve(outfile);
|
outfile = resolve(outfile);
|
||||||
|
|
||||||
let result = await sassRender(Object.assign({}, sassOptions, {
|
let result = sass.compile(infile, sassOptions);
|
||||||
file: infile,
|
|
||||||
outFile: outfile,
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (supportsPostCSS && postcssOptions) {
|
if (supportsPostCSS && postcssOptions) {
|
||||||
if (typeof postcssProcessor === 'undefined') {
|
if (typeof postcssProcessor === 'undefined') {
|
||||||
|
|||||||
8620
package-lock.json
generated
8620
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@@ -6,39 +6,42 @@
|
|||||||
"author": "Locomotive <info@locomotive.ca>",
|
"author": "Locomotive <info@locomotive.ca>",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "20.x",
|
"node": ">=20",
|
||||||
"npm": ">=8.0"
|
"npm": ">=10"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node --experimental-json-modules --no-warnings build/watch.js",
|
"start": "node --no-warnings build/watch.js",
|
||||||
"build": "node --experimental-json-modules --no-warnings build/build.js"
|
"build": "node --no-warnings build/build.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"locomotive-scroll": "^5.0.0-beta.11",
|
"locomotive-scroll": "^5.0.0-beta.21",
|
||||||
"modujs": "^1.4.2",
|
"modujs": "^1.4.2",
|
||||||
"modularload": "^1.2.6",
|
"modularload": "^1.2.6"
|
||||||
"svg4everybody": "^2.1.9"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^10.4.17",
|
"autoprefixer": "^10.4.21",
|
||||||
"browser-sync": "^3.0.2",
|
"browser-sync": "^3.0.4",
|
||||||
"common-path": "^1.0.1",
|
"common-path": "^1.0.1",
|
||||||
"concat": "^1.0.3",
|
"concat": "^1.0.3",
|
||||||
"esbuild": "^0.20.0",
|
"esbuild": "^0.25.8",
|
||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"node-notifier": "^10.0.1",
|
"node-notifier": "^10.0.1",
|
||||||
"postcss": "^8.4.21",
|
"postcss": "^8.5.6",
|
||||||
"purgecss": "^5.0.0",
|
"purgecss": "^7.0.2",
|
||||||
"sass": "^1.70.0",
|
"sass": "^1.89.2",
|
||||||
"svg-mixer": "~2.3.14",
|
"svg-mixer": "^2.3.14",
|
||||||
"tiny-glob": "^0.2.9"
|
"tiny-glob": "^0.2.9"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"browser-sync": {
|
"browser-sync": {
|
||||||
"ua-parser-js": "~1.0.33"
|
"ua-parser-js": "^1.0.33"
|
||||||
},
|
},
|
||||||
"svg-mixer": {
|
"svg-mixer": {
|
||||||
"postcss": "^8.4.20"
|
"micromatch": "^4.0.8",
|
||||||
|
"postcss": "^8.4.49"
|
||||||
|
},
|
||||||
|
"svg-mixer-utils": {
|
||||||
|
"anymatch": "^3.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,8 +96,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script nomodule src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.6.0/polyfill.min.js" crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<script src="assets/scripts/vendors.js" defer></script>
|
<script src="assets/scripts/vendors.js" defer></script>
|
||||||
<script src="assets/scripts/app.js" defer></script>
|
<script src="assets/scripts/app.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -83,9 +83,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script nomodule src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.6.0/polyfill.min.js"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<script src="assets/scripts/vendors.js" defer></script>
|
<script src="assets/scripts/vendors.js" defer></script>
|
||||||
<script src="assets/scripts/app.js" defer></script>
|
<script src="assets/scripts/app.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -122,8 +122,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script nomodule src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.6.0/polyfill.min.js" crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<script src="assets/scripts/vendors.js" defer></script>
|
<script src="assets/scripts/vendors.js" defer></script>
|
||||||
<script src="assets/scripts/app.js" defer></script>
|
<script src="assets/scripts/app.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script nomodule src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.6.0/polyfill.min.js"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<script src="assets/scripts/vendors.js" defer></script>
|
<script src="assets/scripts/vendors.js" defer></script>
|
||||||
<script src="assets/scripts/app.js" defer></script>
|
<script src="assets/scripts/app.js" defer></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user