Skip to content

Commit

Permalink
Added note about inlining critical CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
loganfranken committed Sep 3, 2019
1 parent 02eabc2 commit 8e81bb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion css.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,16 @@ the use of the `!important` keyword. This also clouds your markup file with
presentation information, violating the separation of content and presentation
principle.

The only exception to this rule is when elements are being manipulated by
An exception to this rule is when elements are being manipulated by
client-side scripting. However, even in this situation, the designer and
JavaScript developer should attempt to contain the CSS properties in a class
and then programmatically assign this CSS class to an element.

Another exception to this rule is the practice of putting the most important
CSS for the page within an inline style block to improve the performance of the
page. This practice is referred to as "inlining critical CSS," and should be
employed carefully, using performance metrics to measure the impact of the change.

#### Don't use `!important`

The `!important` keyword can be used to add "weight" to a CSS declaration. As
Expand Down

0 comments on commit 8e81bb7

Please sign in to comment.