Skip to content

Instantly share code, notes, and snippets.

@benfavre
Last active July 20, 2017 17:27
Show Gist options
  • Save benfavre/76fd32c1dbf64a0fcd31dede97a2aed1 to your computer and use it in GitHub Desktop.
Save benfavre/76fd32c1dbf64a0fcd31dede97a2aed1 to your computer and use it in GitHub Desktop.
Css balisage pour abovethefold parsing
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<script>
<!-- Include Dynamique côté client -->
function loadCSS( href, before, media, callback ){ ... }
loadCSS( '/path/to/your/full.css' );
</script>
<style type="text/css">
<?php
include('parser.php');
$parser = new CssParser();
$parser->load_string('/path/to/your/full.css');
$parser->parse();
/* Couper le fichier d'après le balisage et remplacer les liens */
}
?>
</style>
<body>
Contenu
footer
<noscript>
<!-- Include pour pas de JS -->
<link href='/path/to/your/full.css' rel='stylesheet' type='text/css'>
</noscript>
</body>
</html>
/* === ABOVESTART === */
.shell {
width:960px;
}
/* === ABOVEEND === */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment