UI-Research / college-affordability.urban.org

0 stars 0 forks source link

Fouc fix #219

Closed digitalsutton closed 7 years ago

digitalsutton commented 7 years ago

Added ExtractTextPlugin and configured to extract a global css file (components.css) from all global elements. Singlepage (anything inside /pages directory) is still loaded via js.

Best solution I could come up with here required hard-coding the tag to components.css in the render output in components/10-html/html.jsx. This is a bit of a hack, but does achieve the goal of eliminating or reducing FOUC.

TODO:

  1. Possibly replace hard-coded link in html.jsx -- figure out how to reference external css using node/jsx functions.
  2. Dynamically reference external css files from each singlepage. This requires solving TODO #1.

NOTE: also noticed an error in my previous commit to add 2nd and 3rd level items to breadcrumb. Fixed this error in singlepage.jsx.