Somehow we need to extract cssonly certain selectors from files for better performance! For example, #javascriptand #ideafrom a css file with 540 selectors. We only need a selector that is called from #htmland #page. Any smart js code?
Example
<!DOCTYPE html>
<html lang="whatever">
<head>
<meta charset="utf-8">
<title>Another Page</title>
<link rel="stylesheet" href="core.css" required>
<link rel="stylesheet" href="interface-elements.css" partial>
</head>
<body>
<button class="btn">Do something</button>
<h1 class="title">Huh</h1>
<p><span class="dropcap">L</span>orem ipsum Bla bla bla</p>
</body>
</html>
How do we do it better?
You have 2 css files button.cssthat have a kernel button style and colors.cssthat contains a set of colors. You call a html page <a class="btn btn-primary"></a>, and the browser downloads all your color classes danger, primary, successetc. Do you understand what I mean?
source
share