Last active
August 29, 2015 14:13
-
-
Save protodave/40698bbdc50b1a70a20f to your computer and use it in GitHub Desktop.
Avoiding the FOUI (Flash of Unstyled Icon) in Iconic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Demo for Brian K.</title> | |
<script src="js/iconic.min.js"></script> | |
</head> | |
<body> | |
<!-- Option One: Hide the 'iconic' img tags --> | |
<style> | |
img.iconic { | |
visibility: hidden; | |
} | |
</style> | |
<img data-src="iconic/person.svg" title="person" class="iconic iconic-lg" alt="person"> | |
<!-- Option Two: Use a non-img tag and call 'inject' manually --> | |
<span data-src="iconic/person.svg" title="person" class="iconic iconic-lg" alt="person"></span> | |
<script> | |
IconicJS().inject('span.iconic'); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment