Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Support for CSS @import #48

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 17 comments
Closed

Support for CSS @import #48

GoogleCodeExporter opened this issue Apr 6, 2015 · 17 comments

Comments

@GoogleCodeExporter
Copy link

A feature request: Currently mod_pagespeed rewrites css that is pulled in with 
the <link> tag just fine, e.g.:

<link rel="stylesheet" type="text/css" 
href="http://www.mysite.com/mystylesheet.css" />

However, it could be nice it it would work with @import as well, e.g. 

<style type="text/css" media="screen">@import 
url(http://www.mysite.com/mystylesheet.css) ;</style>

We have a lot of sites that are using that pattern.

mod_pagespeed does not rewrite that in my end. If the current mod_pagespeed 
version is supposed to pick up @import I can provide some debug info.

Pagespeed version: 0.9.0.0-128

Original issue reported on code.google.com by antonsto...@gmail.com on 8 Nov 2010 at 3:55

@GoogleCodeExporter
Copy link
Author

This is definitely on our list of things to do.  This will now be our official 
"Issue" for it.

Original comment by jmara...@google.com on 8 Nov 2010 at 4:51

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Issue 47 has been merged into this issue.

Original comment by jmara...@google.com on 8 Nov 2010 at 5:11

@GoogleCodeExporter
Copy link
Author

Original comment by sligocki@google.com on 8 Nov 2010 at 5:35

@GoogleCodeExporter
Copy link
Author

Original comment by sligocki@google.com on 19 Jan 2011 at 9:31

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Have news about it?

Original comment by diogo...@gmail.com on 21 Jan 2011 at 12:47

@GoogleCodeExporter
Copy link
Author

What's the motivation for using the inline @import, as opposed to the form 
above it in the description.

Original comment by jmara...@google.com on 21 Jan 2011 at 1:20

@GoogleCodeExporter
Copy link
Author

@diogo..., It's on our radar, but lower priority than some other things.

Original comment by sligocki@google.com on 21 Jan 2011 at 4:19

@GoogleCodeExporter
Copy link
Author

Summary was: Support for css @import

Original comment by sligocki@google.com on 17 Mar 2011 at 6:48

  • Changed title: Rewrite CSS in @import or combine it into the main CSS

@GoogleCodeExporter
Copy link
Author

One thing to add:
It would be cool if @import would be inlined in external stylesheets as well.
Wordpress requires child themes to use @import in style.css for obscure reasons.

Original comment by Lange.Fa...@gmail.com on 7 Dec 2011 at 1:07

@GoogleCodeExporter
Copy link
Author

Yep, we're working on that as we speak.

Suammary was: Rewrite CSS in @import or combine it into the main CSS

Original comment by sligocki@google.com on 7 Dec 2011 at 4:31

  • Changed title: Support for CSS @import
  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

To the original request, this is implemented in the latest release by the new 
inline_import_to_link which is part of the core set of filters:
http://code.google.com/speed/page-speed/docs/filter-css-inline-import.html

Inlining @import in external stylesheets (or even in internal stylesheets 
comprising more than a simple single @import) is in development now and should 
be available soon.

Original comment by matterb...@google.com on 7 Dec 2011 at 10:01

@GoogleCodeExporter
Copy link
Author

Fixed in 0.10.20.1

Original comment by matterb...@google.com on 24 Jan 2012 at 7:04

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by matterb...@google.com on 24 Jan 2012 at 7:26

  • Added labels: release-note

@GoogleCodeExporter
Copy link
Author

confirmed working in 0.10.21.2 built.
Wordpress child themes can now be optimized. Thanks!

Original comment by Lange.Fa...@gmail.com on 9 Feb 2012 at 8:37

@GoogleCodeExporter
Copy link
Author

Thanks for the confirmation!

Original comment by matterb...@google.com on 9 Feb 2012 at 1:40

  • Changed state: Verified

@GoogleCodeExporter
Copy link
Author

Fabian, would you mind telling me the URL of your site please, so I can see the 
effect?
Email me directly if you'd prefer (let me know if you can't see my email 
address).
Thanks!

Original comment by matterb...@google.com on 15 Feb 2012 at 4:45

@GoogleCodeExporter
Copy link
Author

Original comment by jmara...@google.com on 23 May 2012 at 2:49

  • Added labels: Milestone-v21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant