Written the logic to extract and merge all stylesheets