New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CSS @import #48

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

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Issue 47 has been merged into this issue.

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

  • Changed state: Accepted
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Have news about it?

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

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

@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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Fixed in 0.10.20.1

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

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

  • Added labels: release-note
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Thanks for the confirmation!

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

  • Changed state: Verified
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

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

  • Added labels: Milestone-v21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment