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

Add an option to combine dynamic css link with @import #121

Closed
kevinptt0323 opened this Issue Dec 6, 2017 · 3 comments

Comments

2 participants
@kevinptt0323
Contributor

kevinptt0323 commented Dec 6, 2017

This plugin will only combine css which is ending with .css.

Could you add an option to combine dynamic css with @import?

For example: Google Fonts.

Ref

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 6, 2017

Owner

That would be opening Pandora's box, dynamically generated (and/ or remote) CSS (and JS) can change based on context. Making dynamic CSS (or JS) static does away with any business logic implemented, thereby potentially breaking things. Google Fonts is a good example actually; when requesting the CSS Google sends different responses to different browsers, which would not work when having AO import the CSS, effectively breaking your site (or at least the font-rendering) in some browsers.

So no, I'm afraid I don't want go there. On the bright side; I'm working on "AO Extra", which is a separate plugin for now but which will be integrated in Autoptimize and optimizing Google Fonts will actually be one of the new features.

Owner

futtta commented Dec 6, 2017

That would be opening Pandora's box, dynamically generated (and/ or remote) CSS (and JS) can change based on context. Making dynamic CSS (or JS) static does away with any business logic implemented, thereby potentially breaking things. Google Fonts is a good example actually; when requesting the CSS Google sends different responses to different browsers, which would not work when having AO import the CSS, effectively breaking your site (or at least the font-rendering) in some browsers.

So no, I'm afraid I don't want go there. On the bright side; I'm working on "AO Extra", which is a separate plugin for now but which will be integrated in Autoptimize and optimizing Google Fonts will actually be one of the new features.

@futtta futtta closed this Dec 6, 2017

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 7, 2017

Owner

I just committed the Google Font optimization (choice between "remove", "combine fonts & link" and "combine fonts and load asynchronous with webfont.js") feature to AO Extra (it will integrate with your Autoptimize installation), so if you want download https://github.com/futtta/ao_extra/archive/master.zip and give it a spin maybe? :-)

Owner

futtta commented Dec 7, 2017

I just committed the Google Font optimization (choice between "remove", "combine fonts & link" and "combine fonts and load asynchronous with webfont.js") feature to AO Extra (it will integrate with your Autoptimize installation), so if you want download https://github.com/futtta/ao_extra/archive/master.zip and give it a spin maybe? :-)

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 17, 2017

Owner

now added all of ao_extra to autoptimize itself, testing would be appreciated @kevinptt0323 :-)

Owner

futtta commented Dec 17, 2017

now added all of ao_extra to autoptimize itself, testing would be appreciated @kevinptt0323 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment