UI Ecosystem

DEG UI Code Standards, Design Patterns, Frameworks & Tooling

Table of Contents

  1. Code Style Guide - HTML - CSS - Javascript
  2. Design Patterns & Considerations - Atomic Design - Browser Support - Accessibility - Performance - Detailed Design Patterns & Anti-Patterns
  3. Frameworks - Skeletor - Pattern Lab
  4. Libraries - DEGJS - jQuery
  5. Tooling - IDEs/Editors - CSS - Javascript - Task Runners - Visual Editors - Virtual Machines - ALM/Version Control - Continuous Integration - Testing - Reviews and Pull Requests

Code Style Guide

HTML

Formatting & Syntax

HTML5 doctype

Semantics

CSS

PostCSS

Organization

Formatting

Pseudo BEM

Variables

Nested Selectors

Breakpoints & Media Queries

Vendor Prefixes

Javascript Hooks & State Classes

Box Sizing

Javascript

While DEG doesn’t maintain a specific code style guide in relation to Javascript, we do utilize es6 features and syntax and tend to follow the guidelines set out by airbnb in their Javascript style guide.

JSPM/SystemJS

Modules

Polyfilled Bundles

Frameworks

Skeletor

Skeletor is a Grunt-powered, Pattern Lab-centric, highly-customizable web project boilerplate and build tool created by the DEG UI team. Skeletor uses PostCSS for CSS processing and JSPM/SystemJS for Javascript package management, module bundling/loading, and transpilation. Full Skeletor documentation is available here.

Pattern Lab

Pattern Lab is a collection of tools to help you create atomic design systems. DEG uses Pattern Lab as a design & development tool, a prototyping & demo tool, and as an interactive style guide deliverable for clients. Although Pattern Lab comes with an out of the box pattern starter kit, we have modified this kit to more closely resemble the types of projects we work on and practices we follow. Our modified version of Pattern Lab can be found within Skeletor. Pattern Lab specific documentation can be found on the Pattern Lab website.

Libraries

DEGJS

DEGJS is a curated list of ES6-formatted JavaScript modules, encompassing front-end functionality and utilities, developed by the DEG UI team. All modules are hosted under our DEGJS GitHub account, and are formatted to work with Babel, the JSPM package manager and its accompanying JavaScript loader, System.js.

jQuery

* Magento & Legacy Only * The ubiquitous javascript library. Many legacy projects as well as anything on the Magento platform will include the jQuery library. The DEG UI team recommends against using jQuery when possible.

Design Patterns & Considerations

Atomic Design

The DEG UI team encourages the use of the Atomic Design methodology for creating design systems. The basic gist of atomic design is to break interfaces down into fundamental building blocks and work up from there. Traditional atomic design consists of 5 distinct levels:

DEG uses a modified version of these levels to simplify development, tie in better with design processes & deliverables, and to use terminology that is easier for clients to understand. Our version of atomic design consists of 4 dinstinct levels:

Browser Support

DEG uses the concept of Graded Browser Support, which defines the set of browsers that should receive a verified, usable experience. However, trying to deliver the same “A-grade” experience across all tested browsers is neither cost-effective nor common. We support a tiered approach to user experience design, development, and testing, and encourage each project to define their own tiers that serve their users and stakeholders best. For a more detailed explanation and a guide to help determine what browsers to support, view our Browser Support Guide on Google Docs.

Accessibility

DEG Standards of Quality stipulate a minimum of WCAG 2.0 Level A accessibility conformance. However, some projects may have more strict accessibility needs. For WCAG 2.0 Level A development requirements, reference the WCAG 2.0 Checklist.

Performance

Because speed and performance is a vital part of any website, DEG encourages the use of performance budgets to help guide design and development decisions.

A performance budget is like any other project budget: it defines a clear goal that the project can be evaluated against to determine success. More specifically, a performance budget sets limits for individual pages of a website that should not be exceeded. These limits can be expressed in the form of several metrics, such as how long it takes for a page to load and how many kilobytes a page weighs. A performance budget helps you choose how to display content or define functionality. It does not dictate what content should be displayed. Removing something important to decrease page weight is not a good performance strategy. The overall benefit of a performance budget is a fast, lightweight website.

For more details on how and when DEG sets performance budgets, view our Performance Budget Guide on Google Docs.

Detailed Design Patterns & Anti-Patterns

Although projects do often present unique challenges, there are certain challenges we see repeated across many projects. Because of this, the DEG UI team maintains a set of client facing documentation on the best practices for using and implementing common design patterns & anti-patterns including:

Tooling

IDEs/Editors

CSS

Javascript

Task Runners

Visual Editors

Virtual Machines

ALM / Version Control

Continuous Integration

Testing

Pull Requests

Pull Requests are both a great way to maintain high quality code and an opportunity to learn from each other. Here are a few best practices to get you started:

Submitting a Pull Request

Reviewing a Pull Request