[Solved] Reduce unused CSS [100% Working Solutions ]
Optimizing CSS by reducing unused styles is essential for improving website speed and performance. Here are some important steps to follow to reduce unused CSS:
1. Perform a CSS audit: Use browser developer tools or online services to identify and analyze unused CSS rules and selectors.
2. Remove unused styles: any unused styles manually but carefully, ensuring that the functionality and appearance of the website remains unaffected.
3. Minify and compress CSS: Use CSS compression tools to minimize white spaces, comments, and line breaks. This reduces the file size of the CSS without impacting its functionality.
4. Use CSS preprocessors: Take advantage of preprocessor features, such as mixins and variables, to generate optimized and concise CSS code.
5. Optimize CSS delivery: Instead of loading a single large CSS file, split the CSS into smaller files based on page templates or components. Load only the necessary CSS for each page, prioritize critical CSS, and use asynchronous or lazy loading to improve initial page load times.
Or Add this js code from over their which file creating issue
<style id="styles_css"></style>
<script>window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp.onreadystatechange
=function(){4==xmlhttp.readyState&&200==xmlhttp.status&&(document.getElementById("styles_css").innerHTML=xmlhttp.
responseText)},
xmlhttp.open("GET","{{- 'rt.vendors.scss.css' | asset_url -}}",!1),xmlhttp.send();</script>