1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00
Chauncey McAskill 2ac2d523cc Refactored Sass
Merged SCSS from various recent projects and implemented some of the latest features from InuitCSS.

When using the SCSS structure in your own project, modify the ‘settings/config*.scss’ files and leave ‘settings/core.scss’ intact.

Changes:
- Updated Normalize to 5.0.0;
- Migrated imports to ‘main.scss’;
- Split ‘settings.scss’ into smaller parts;
- Revised variable names for settings;
- Added spacing unit variables;
- Replaced ‘objects/grid.scss’ with ‘objects/layout.scss’ (from inuitcss);
- Added ‘objects/crop.scss’ and ‘objects/ratio.scss’ (from inuitcss);
- Added @font-face mixin/function from Bourbon;
- Added various new functions and mixins (widths, font-size, truncation,…);
- Renamed Trumps to Utilities;
- Added vatious new Utilities (print, states, spacing, widths);
- Reorganized Utilities into topics;
2016-12-19 13:43:35 -05:00
2016-12-19 13:43:35 -05:00
2016-11-10 11:38:11 -05:00
2016-12-19 13:43:35 -05:00
2016-09-07 18:30:36 -04:00
2016-09-07 18:30:36 -04:00
2016-12-18 14:22:53 -05:00
2016-09-07 18:30:36 -04:00
2016-12-18 14:16:17 -05:00
2016-09-07 18:30:36 -04:00

Locomotive's Front-end Boilerplate

Front-end boilerplate for projects by Locomotive.

Requirements

Prerequisite How to check How to install
Node.js 4.1.1 node -v nodejs.org
Grunt >= 0.1.13 grunt -v npm install -g grunt-cli

Getting started

  1. Get the latest node modules

    1. npm install -g npm-check-updates
    2. npm-check-updates -u
    3. npm install
  2. Run grunt and start coding

    • grunt

Grunt

Each Grunt task has it's own file in the grunt_tasks folder.

BrowserSync

BrowserSync will automatically inject, refresh and sync all your browsers.

Run grunt sync

CSS

Sass import order

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

Grid

We are using a simple inline-block grid system.

Usage

Insert a o-grid block and add o-grid_item elements inside it. No rows that contain floats, no twelve columns system; just the number of items you want, with the classes names you want, inside a single block.

  • Include the grid mixins in your components classes.
  • Create custom width grid items by including the grid_item mixin and adding the widths you need or just include the helpers mixins with fractions like names.
  • Add media queries, on the helpers mixins or on your custom components to change the grid items widths, for your content, on different screen sizes.

Demo

Form

We included some basic CSS styles and resets to the form elements so we can easily have custom style form elements that work on every browsers.

Demo

JavaScript

  • We use HTML data attributes to init our JavaScript modules: data-module
  • All DOM related JavaScript is hooked to js- prefixed HTML classes
  • jQuery is globally included
Description
基于数字优先的设计思想的网站模板
Readme MIT 5.2 MiB
Languages
JavaScript 45.8%
SCSS 42.4%
HTML 11.8%