All Projects → locomotivemtl → Locomotive Boilerplate

locomotivemtl / Locomotive Boilerplate

Licence: mit
🚂 Front-end boilerplate for projects by Locomotive.

Labels

Projects that are alternatives of or similar to Locomotive Boilerplate

Hugo Theme Codex
A minimal blog theme for Hugo 🍜
Stars: ✭ 212 (-10.17%)
Mutual labels:  scss
Static Html Webpack Boilerplate
🔮 modern tooling for old-school static webpage development
Stars: ✭ 226 (-4.24%)
Mutual labels:  scss
Blueprint Css
📘 Blueprint CSS is a modern responsive CSS layout library & grid built on top of CSS Grid and Flexbox.
Stars: ✭ 233 (-1.27%)
Mutual labels:  scss
Vscode One Monokai
🎨 Vscode One Monokai theme.
Stars: ✭ 214 (-9.32%)
Mutual labels:  scss
Millennial
A minimalist Jekyll theme for running an online publication
Stars: ✭ 223 (-5.51%)
Mutual labels:  scss
Gulp Pug Starter
Frontend development with pleasure. Pug + SCSS version
Stars: ✭ 228 (-3.39%)
Mutual labels:  scss
Automatic App Landing Page
A Jekyll theme for automatically generating and deploying landing page sites for mobile apps.
Stars: ✭ 2,575 (+991.1%)
Mutual labels:  scss
Rfs
✩ Automates responsive resizing ✩
Stars: ✭ 2,789 (+1081.78%)
Mutual labels:  scss
Sass Boilerplate
A boilerplate for Sass projects using the 7-1 architecture pattern from Sass Guidelines.
Stars: ✭ 2,778 (+1077.12%)
Mutual labels:  scss
Aurora
An awesome blog theme
Stars: ✭ 231 (-2.12%)
Mutual labels:  scss
Awesome Learning
Awesome Learning - Learn JavaScript and Front-End Fundamentals at your own pace
Stars: ✭ 216 (-8.47%)
Mutual labels:  scss
Ui
Open source wireframing tool written in typescript, react and redux.
Stars: ✭ 218 (-7.63%)
Mutual labels:  scss
Rsass
Sass reimplemented in rust with nom.
Stars: ✭ 227 (-3.81%)
Mutual labels:  scss
Flutter.cn
Flutter CN docs translation plan, get started from the wiki: https://github.com/cfug/flutter.cn/wiki
Stars: ✭ 213 (-9.75%)
Mutual labels:  scss
Hugo Theme Novela
Novela, the simplest way to start publishing with Hugo and Forestry.
Stars: ✭ 230 (-2.54%)
Mutual labels:  scss
Style Resources Loader
CSS processor resources loader for webpack
Stars: ✭ 214 (-9.32%)
Mutual labels:  scss
Home
为推广RISC-V尽些薄力
Stars: ✭ 226 (-4.24%)
Mutual labels:  scss
Jekyll Serif Theme
Serif is a beautiful business theme for Jekyll.
Stars: ✭ 235 (-0.42%)
Mutual labels:  scss
Vue Material Kit
Vue Material Kit - Open Source Material Design UI Kit
Stars: ✭ 231 (-2.12%)
Mutual labels:  scss
Shorthand
Feature rich CSS framework for the new decade https://shorthandcss.com
Stars: ✭ 230 (-2.54%)
Mutual labels:  scss

Locomotive Boilerplate

Front-end boilerplate for projects by Locomotive.

Requirements

Name Version
Node > 14.15

You can use nvm to install the node version in .nvmrc.

Installation

npm i

Usage

# start it
npm start

Configuration

Change the mentions of locomotive-boilerplate for your project's name in mconfig.json. Legacy from modularBP.

Build

Tasks

# watch
npm start

# build
npm run build

Styles

Sass is our CSS preprocessor. Autoprefixer is also included.

Architecture

ITCSS is our CSS architecture.

  • settings: Global variables, site-wide settings, config switches, etc.
  • tools: Site-wide mixins and functions.
  • generic: Low-specificity, far-reaching rulesets (e.g. resets).
  • elements: Unclassed HTML elements (e.g. a {}, blockquote {}, address {}).
  • objects: Objects, abstractions, and design patterns (e.g. .o-layout {}).
  • components: Discrete, complete chunks of UI (e.g. .c-carousel {}).
  • utilities: High-specificity, very explicit selectors. Overrides and helper classes (e.g. .u-hidden {})

source

Naming

We use a simplified BEM syntax.

.block .block_element -modifier

Namespaces

We namespace our classes for more transparency.

  • o-: Object that it may be used in any number of unrelated contexts to the one you can currently see it in. Making modifications to these types of class could potentially have knock-on effects in a lot of other unrelated places.
  • c-: Component is a concrete, implementation-specific piece of UI. All of the changes you make to its styles should be detectable in the context you’re currently looking at. Modifying these styles should be safe and have no side effects.
  • u-: Utility has a very specific role (often providing only one declaration) and should not be bound onto or changed. It can be reused and is not tied to any specific piece of UI.
  • s-: Scope creates a new styling context. Similar to a Theme, but not necessarily cosmetic, these should be used sparingly—they can be open to abuse and lead to poor CSS if not used wisely.
  • is-, has-: Is currently styled a certain way because of a state or condition. It tells us that the DOM currently has a temporary, optional, or short-lived style applied to it due to a certain state being invoked.

source

Example

<div class="c-block -large">
    <div class="c-block_layout o-layout">
        <div class="o-layout_item u-1/[email protected]">
            <div class="c-block_heading o-h -medium">Heading</div>
        </div>
        <div class="o-layout_item u-1/[email protected]">
           <a class="c-block_button o-button -outline" href="#">Button</a>
        </div>
    </div>
</div>
.c-block {
    &.-large {
        padding: rem(60px);
    }
}

.c-block_heading {
    @media (max-width: $to-medium) {
        .c-block.-large & {
            margin-bottom: rem(40px);
        } 
    }
}

Scripts

modularJS is a small framework we use on top of ES modules. It compiles with Rollup and Babel.

Why

  • Automatically init visible modules.
  • Easily call other modules methods.
  • Quickly set scoped events with delegation.
  • Simply select DOM elements scoped in their module.

source

Example

<div data-module-example>
    <div data-example="main">
        <h2>Example</h2>
    </div>
    <button data-example="load">More</button>
</div>
import { module } from 'modujs';

export default class extends module {
    constructor(m) {
        super(m);

        this.events = {
            click: {
                load: 'loadMore'
            }
        }
    }

    loadMore() {
        this.$('main')[0].classList.add('is-loading');
    }
}

Learn more

Page transitions

modularLoad is used for page transitions and lazy loading.

Example

<nav>
    <a href="/">Home</a>
    <a href="/page" data-load="transitionName">Page</a>
</nav>
<div data-load-container>
    <img data-load-src="assets/images/hello.jpg">
</div>
import modularLoad from 'modularload';

this.load = new modularLoad({
    enterDelay: 300,
    transitions: {
        transitionName: {
            enterDelay: 450
        }
    }
});

Learn more

Scroll detection

Locomotive Scroll is used for elements in viewport detection and smooth scrolling with parallax.

Example

<div data-module-scroll>
    <div data-scroll>Trigger</div>
    <div data-scroll data-scroll-speed="1">Parallax</div>
</div>
import LocomotiveScroll from 'locomotive-scroll';

this.scroll = new LocomotiveScroll({
    el: this.el,
    smooth: true
});

Learn more

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].