You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use mincss to create a CSS file containing the subset used by my site.
However, the same CSS file is linked by different pages using different relative links (../foo.css and ../../foo.css) which means mincss sees it as two different things.
I am using this script to try and analize what mincss can do:
import os
import sys
output_folder = os.path.abspath(sys.argv[1])
from mincss.processor import Processor
p = Processor()
urls = []
for root, dirs, files in os.walk(output_folder):
for f in files:
if not f.endswith('.html'):
continue
url = os.path.join(output_folder, root, f)
urls.append(url)
p.process(*urls)
for inline in p.links:
print "===>", inline.href, len(inline.before), len(inline.after)
Apparently there is no support for multiple pages in mincss, which kind of negates the point of the tool in real life. What you see is probably the sum of every css linked in your pages, whatever they're duplicated or not.
I am trying to use mincss to create a CSS file containing the subset used by my site.
However, the same CSS file is linked by different pages using different relative links (../foo.css and ../../foo.css) which means mincss sees it as two different things.
I am using this script to try and analize what mincss can do:
And here is it's output:
It's perfectly possible that I am using mincss wrong, of course :-)
The text was updated successfully, but these errors were encountered: