build powerful frontend workflows with postcss
play

Build Powerful FrontEnd Workflows with PostCSS Guide to - PowerPoint PPT Presentation

Build Powerful FrontEnd Workflows with PostCSS Guide to writing/generating cutting edge CSS Key TakeAways PostCSS - Deep Dive plugins you can use custom plugins Workflow Essential Concepts Plugins to help with tasks Drupal Theme Starter


  1. Build Powerful FrontEnd Workflows with PostCSS Guide to writing/generating cutting edge CSS

  2. Key TakeAways PostCSS - Deep Dive plugins you can use custom plugins Workflow Essential Concepts Plugins to help with tasks Drupal Theme Starter Template

  3. Introduction Essential Advanced

  4. What is it? Microservice Architecture Introduction Single Responsibility Principle Installation what - why - how Gulp Script

  5. Philosopher’s Stone

  6. Alchemy

  7. What is PostCSS? Transformer! A Workflow Tool - (post/pre)processor Language Extender CSS Wayback/Time Machine

  8. architecture Collection of API & Micro Services

  9. Architecture

  10. What does PostCSS do? Parses CSS Creates Node Tree Provides APIs for processors Pipes between processors

  11. Plugin Design Principle Single Responsibility Principle Do one thing and do well Node Modules Written in JS

  12. 200+ You have a plugin for that! PostCSS.parts

  13. Why roll yours in PostCSS? Choice - freedom to choose Usage - tailor to your workflow Modular/ lightweight hence faster

  14. Limitations of pre-processors @extend across media queries Automatically fix errors Feature Requests and how it is handled

  15. Installation and First Task

  16. Required Tools Node.js NPM - Dependency Management System Gulp/Grunt - The task runner

  17. Workflow Anatomy

  18. Installation Install Node

  19. Gulp Task

  20. Requirements of a Workflow? Essential Autoprefixer Linting PostCSS futureCSS Quantity Queries Container Queries Build custom workflow CSS Modules Packs

  21. Workflow Goals ENVIRONMENT CODE HELPERS Mechanical Rules Future Proofing Enforcement Fallback Support Debug Language Extensions Linting Shortcuts Easy SetUp Utilities

  22. Toolchain ENVIRONMENT CODE HELPERS Mechanical Rules Fallback Support - oldie Enforcement - stylelint Future Proofing - cssnext Debug - sourcemaps Language Extensions precss Linting - stylelint Shortcuts - short Easy SetUp - npm Utilities - lot I/O - import/cssnano

  23. ENVIRONMENT

  24. Importer - postcss-import Before PostCSS - CSS

  25. Linters - Stylelint StyleLint Mechanical Rules Enforcement Over 100 Rules Choose the ones you want

  26. Linters - Stylelint

  27. Packers cssnano Does minify and some errors. postcss-css-mqpacker Concats all styles of same media query. postcss-cachebuster Busts assets cache using url params. postcss-data-packer embedded base64 to separate file.

  28. Source Maps

  29. Style Guides postcss-style-guide, psg-theme-default Provides KSS Style Living Guides Uses Annotation to generate HTML

  30. Style Guides

  31. CODE HELPERS Future CSS

  32. Future CSS postcss-custom-media postcss-custom-properties postcss-extend postcss-initial postcss-media-minmax cq-prolyfill

  33. PostCSS Extend example from plugin page

  34. Container Queries cq-prolyfill

  35. Quantity Queries postcss-quantity-queries :at-least(count) :at-most(count) :between(start,end) :exactly(count)

  36. CSS Modules postcss-initial {all:initial}

  37. CODE HELPERS Language Extenders

  38. Pre/post compiler PRE COMPILER POST COMPILER write code in write CSS Code, gets scss/less/stylus, gets converted into CSS. converted into css. precss cssnext

  39. Pre/post compiler PRE COMPILER POST COMPILER mixins needs to be plain CSS, which is learned, their APIs parsed by Autoprefixers provides sass like uses W3C css Variables mixins, functions etc.

  40. CODE HELPERS Utility Plugins

  41. Utility Plugins autoprefixer pxtorem postcss-sorting perfectionist postcss-font-pack postcss-fontpath

  42. Utility Plugins - AutoPrefixer refers caniuse.com to generate does not generate for border-radius etc… http://autoprefixer.github.io/

  43. Utility Plugins - pxtorem

  44. Packs Curated plugins Takes care of interplay Does heavy lifting

  45. Packs cssnano - packer, optimizer for production rucksack - new features and shortcuts short - shorthand properties precss - language extender cssnext - language extender (W3C) https://github.com/timaschew/postcss- compare-packs

  46. Write your own plugin Advanced CSS Architecture BEM / SMACSS Organization Putting it all together Beyond the Basics

  47. PostCSS Boilerplate postcss-plugin-boilerplate Wizard to help creation Clean git history Write index.js and test.js Document

  48. Examine a plugin

  49. Anatomy of a Plugin this is postcss-currency plugin

  50. CSS Architecture

  51. Architecture Challenges Abstraction Maintainability Change Management Debugging Documentation

  52. SMACSS Categorizing / Organizing CSS Rules Base - base level CSS Layout - layout based classes (l-) Module - reusable modules State - state of an item is-active Theme - related to colors Reduced dependency on structure Thinking in Components

  53. Block Element Modifier Rules to Name selectors

  54. Theming Process Component Inventory - ppt Component Library - code Layout Pages Composition of Components Oddball Components Context based alignment/changes

  55. End To End Workflow CLASSY THEME Configure with postCSS Folder Structures Plugins Code Organization Debugging - source maps Linting

  56. DEMO & CODE WALKTHROUGH

  57. Summary What is PostCSS Architecture Why PostCSS How To start coding in PostCSS Workflow Goals PostCSS Tools that support Useful Plugins Write Plugin SMACSS/BEM All together

  58. Appendix - UseFul Links PostCSS Page Plugins List PostCSS.parts cssnext precss compare css packs BEM SMACSS

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend