TIL How CSS get added into the DOM
POSTED ON:
When a application encounters a CSS file, it'll:
- Wait for the file to be downloaded
- load the CSS file
- create a CSS Object Model. (CSSOM)
- Combine the CSSOM with the DOM tree.
At the end, the DOM tree becomes the "Render Tree". (Render Tree is CSSOM + DOM Tree with all the correct stylings)
That step 1 where it waits for the file to be downloaded is render-blocking.
SOURCE: "Simple CSS Hack to Reduce Page Load Time"
https://javascript.plainenglish.io/simple-css-hack-to-reduce-page-load-time-366f7aaaa3be
Related TILs
Tagged: css