Table of Contents for
Mastering PostCSS for Web Design

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Mastering PostCSS for Web Design by Alex Libby Published by Packt Publishing, 2016
  1. Cover
  2. Table of Contents
  3. Mastering PostCSS for Web Design
  4. Mastering PostCSS for Web Design
  5. Credits
  6. About the Author
  7. About the Reviewer
  8. www.PacktPub.com
  9. Preface
  10. What you need for this book
  11. Who this book is for
  12. Conventions
  13. Reader feedback
  14. Customer support
  15. 1. Introducing PostCSS
  16. Introducing PostCSS
  17. Setting up a development environment
  18. Creating a simple example using PostCSS
  19. Linting code using plugins
  20. Exploring how PostCSS works
  21. Summary
  22. 2. Creating Variables and Mixins
  23. Creating a hover effect example
  24. Transitioning to using PostCSS
  25. Adding variable support to PostCSS
  26. Updating our hover effect demo
  27. Setting the order of plugins
  28. Creating mixins with PostCSS
  29. Looping content with PostCSS
  30. Summary
  31. 3. Nesting Rules
  32. Navigating through pages
  33. Transitioning to using PostCSS plugins
  34. Exploring the pitfalls of nesting
  35. Making the switch to BEM
  36. Exploring our changes in more detail
  37. Summary
  38. 4. Building Media Queries
  39. Exploring custom media queries in PostCSS
  40. Making images responsive
  41. Adding responsive text support
  42. Optimizing media queries
  43. Retrofitting support for older browsers
  44. Moving away from responsive design
  45. Taking things further with CSS4
  46. Summary
  47. 5. Managing Colors, Images, and Fonts
  48. Managing fonts with PostCSS
  49. Creating image sprites
  50. Working with SVG in PostCSS
  51. Adding support for WebP images
  52. Manipulating colors and color palettes
  53. Creating color functions with PostCSS
  54. Summary
  55. 6. Creating Grids
  56. Creating an example with Bourbon Neat
  57. Exploring the grid plugins in PostCSS
  58. Transitioning to using PostCSS-Neat
  59. Creating a site using Neat and PostCSS
  60. Adding responsive capabilities
  61. Summary
  62. 7. Animating Elements
  63. Moving away from jQuery
  64. Making use of pre-built libraries
  65. Switching to using SASS
  66. Making the switch to PostCSS
  67. Exploring plugin options within PostCSS
  68. Updating code to use PostCSS
  69. Creating a demo in PostCSS
  70. Optimizing our animations
  71. Using our own animation plugin
  72. Summary
  73. 8. Creating PostCSS Plugins
  74. Dissecting the architecture of a standard plugin
  75. Creating an transition plugin
  76. Building a custom font plugin
  77. Simplifying the development process
  78. Guidelines for plugin building
  79. Making the plugin available for use
  80. Summary
  81. 9. Working with Shortcuts, Fallbacks, and Packs
  82. Exploring plugin packs for PostCSS
  83. Adding shortcuts with Rucksack
  84. Linting and optimizing your code
  85. Providing fallback support
  86. Summary
  87. 10. Building a Custom Processor
  88. Exploring our processor
  89. Dissecting issues with our processor
  90. Optimizing the output
  91. Adding reload capabilities
  92. Extending our processor further
  93. Testing the final pre-processor
  94. Getting started with some hints and tips
  95. Introducing the CSStyle library
  96. Summary
  97. 11. Manipulating Custom Syntaxes
  98. Preparing our environment
  99. Implementing custom syntax plugins
  100. Parsing CSS
  101. Formatting the output with the API
  102. Highlighting our syntax code
  103. Summary
  104. 12. Mixing Preprocessors
  105. Exploring the conversion process
  106. Introducing the Pleeease library
  107. Compiling with other preprocessors
  108. Using the PreCSS library
  109. Converting a WordPress installation
  110. Setting up our environment
  111. Considering the conversion process
  112. Making changes to our code
  113. Compiling and testing the changes
  114. Summary
  115. 13. Troubleshooting PostCSS Issues
  116. Exploring some common issues
  117. Getting help from others
  118. Summary
  119. 14. Preparing for the Future
  120. Converting CSS4 styles for use
  121. Supporting future syntax with cssnext
  122. Creating plugins to provide extra CSS4 support
  123. Summary
  124. Index

Getting help from others

At this stage, you've tried fixing an issue, but failed – you're not quite sure where to go next…

Don't worry, there are plenty of people who have been there, and needed help! A good start is the main documentation, which is available at https://github.com/postcss/postcss/tree/master/docs. If this draws a blank, then Google is a good option; in addition, there are a couple of other options that may help.

Logging issues at Stack Overflow

If you spend time researching Google and don't find anyone who has had this problem before, then you can try logging a question on Stack Overflow:

Logging issues at Stack Overflow

The URL is http://stackoverflow.com/questions/tagged/postcss—this lists all of the questions tagged with the name postcss, and is open to anyone to suggest a course of action or hopefully a tip that will get you back in business. If you do find yourself logging an issue, please try where possible to give details of the system you use (Windows, Mac, or Linux), any screenshots or details of the error, and the steps you were taking to arrive at the error.

Finding a bug with PostCSS

Taking things a step further, you can also log a development request, or an issue that requires a change to the code—to do this, please browse to the issues log on the GitHub site, at https://github.com/postcss/postcss/issues:

Finding a bug with PostCSS

There are a few things to bear in mind:

  • Don't be alarmed if you are advised to log the issue on the plugin's website, and not in GitHub for PostCSS – many issues are not as a result of a problem in PostCSS, but in the plugin itself.
  • It helps to show a copy of your task runner's task file and package.json, just in case—some of the issues that people experience are as a result of (known or unknown) compatibility issues between plugins, or where a certain order must be followed to ensure plugins can be used.
  • PostCSS plugin developers frequently develop on the Apple Mac or Linux platforms—it means that some errors you may see are as a result of using a platform that doesn't support one or more commands in the plugin.
  • If you do come across problems when using one or more plugins, try to strip back your processor tasks to those that include the plugins that are causing issues. Even if this doesn't eliminate the issue, it will help narrow the cause and avoid unnecessary checks by others during the troubleshooting process.
  • The license used by PostCSS is the MIT license—it effectively means that you can do as you like with the software, as long as the copyright notice remains with the library.
  • It's worth noting that CodePen supports the use of PostCSS—you may find it useful to try out code online (and have it compile automatically), rather than running your processor manually. CodePen only supports a limited range of plugins, so it won't be useful for all occasions—but hopefully some!

    Tip

    For more details, take a look at this blog posting on the CodePen site: https://blog.codepen.io/2015/07/14/postcss-now-supported-on-codepen/.

  • The downside of open source software (and plugins created for PostCSS) is the varying levels of support offered by plugin developers—whilst support for the core system is very good, you may find support for individual plugins to not be quite so active! Don't rely on plugin developers to respond quickly if you have a critical issue—please log it via Stack Overflow first, before raising it on the plugin site. The latter should be used if the issue is identified to require further development.

With these in mind, good luck! PostCSS is fast gaining ground—with some big name companies using it, such as WordPress and Google, it is sure to become very popular. It would be a shame to give up on something if you come across a problem with using a plugin!

Remember, if one plugin doesn't work, then look around—others may well be available that can take their place. It's a dog eat dog world, where those plugins that are not supported are likely to fall by the wayside, leaving those where support is active and problems are resolved efficiently and promptly.