Skip to content

Instantly share code, notes, and snippets.

@protodave
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protodave/40698bbdc50b1a70a20f to your computer and use it in GitHub Desktop.
Save protodave/40698bbdc50b1a70a20f to your computer and use it in GitHub Desktop.
Avoiding the FOUI (Flash of Unstyled Icon) in Iconic
<!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