Skip to content

Instantly share code, notes, and snippets.

@Praseetha-KR
Last active June 22, 2017 09:27
Show Gist options
  • Save Praseetha-KR/0064643bf861a157b25be8ef46d4b74f to your computer and use it in GitHub Desktop.
Save Praseetha-KR/0064643bf861a157b25be8ef46d4b74f to your computer and use it in GitHub Desktop.
UI standardisation: CSS Frameworks, Pattern Libraries & Architectures

1. CSS Architectures

Architecture Concept Advantages Disadvantage
OOCSS - Identify repeating patterns & objects (or modules)
- Add multiple classes to achieve intended behaviour
- single responsibility
- separation of concerns
- decoupling
- encapsulation
- DRY
- styles size will be almost constant
templates get polluted
SMACSS Entire styles organized into 5 files
- base (elemental selectors, eg: bdy, p),
- layout (big page sections, prefix l-*, eg: header, footer),
- module (reusable parts of design, eg: button, dropdown),
- state (states of modules, prefix is-*, eg: is-opened),
- theme (apprearance)
basically it is OOCSS
- scalable & modular
- organize & structure styles
- no functional grouping
- tag/id selectors won't scale
BEM naming convention block__element--modifier - reusable components
- code sharing
- no specificity issues
- leads to very long class names
- could lead to large file sizes
- invadidates cascading concept
ITCSS Inverted Triangle layered architecture, cascade into a unified point.

generic --> explicit, far-reaching --> localised, low spacificity --> high specificity selectors

Default layers:
Settings: global vars, configs
tools: default mixings & functions
generic: ground-0 (normalize/reset)
base: unclassed html elements
objects: design patterns (eg: .ui-list, .ui-list__item)
components: chunks of UI (eg: .products-list)
trumps: helpers & overrides
each layer is a pass over DOM
- grows in a well rounded manner
- familiar environment
- progressively adding styles, never undoing
- sanitises inheritance
- can create a test layer for A/B testing
Atomic CSS Single-purpose units of styling (Atomic styles only apply a single style declaration)
<div class="D(b) Va(t) Fz(20px)">, Atomizer would create a style sheet containing these rules:
.D(b) { display: block; }
.Va(t) { vertical-align: top; }
.Fz(20px) { font-size: 20px; }
- separation of concerns - size grows too fast
DRY CSS - Never repeat style/property definition
- Group selectors with shared properties
(eg: .round-border,.btn,.input { border-radius: 0.3em }
- Preprocessors: @include border(10px) or $color
- single source of truth
- all uses of data change simultaneously
- acts like variables or functions
- less css, smaller stylesheets
- takes advantage of inspectors
- reduced readability
- no functional grouping

Resources

2. CSS Frameworks / UI Toolkits

Feature ↓ \ Framework → Bootstrap 4
(IE10+)
Skeleton
(IE9+/400 lines)
Bulma
(IE10+)
PureCSS
(IE7+/4.5KB)
Grid
Media object
Responsive utilities
Typography
Code
Images
Tables
Figures
Alert/Message
Badge/tag
Box
Breadcrumb
Button
Button group
Card
Carousal
Collapse
Dropdown
Form
Input group
Jumbotron
List group/panel
Modal
Navs/Menu
Navbar
Notification
Pagination
Popover
Progress
Scrollspy
Tooltip
Colors
Display
Spacing
Sections

other frameworks

3. Design System

  1. Style Guide: A Style Guide can typically encompass a company’s branding guidelines, which could include: logo usage, designated color palettes, and editorial tone. Style Guides deal with consistency and presentation but do not care about information.

  2. Pattern Library: Pattern Libraries often encompass static UI elements, e.g. tabbed navigation, dropdown menu, accordion, and even common web page layouts, like grids. Design Patterns care about information and interaction with content.

Style Guide (visual) + Pattern Library (functional) = User Experience

Examples

Design Systems
Style Guides
Pattern Libraries

More at: styleguides.io


Generators

styleguide generators list


Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment