Skip to content

Smarty plugin that Improves CSS embedding with front-end performance in mind

Notifications You must be signed in to change notification settings

pjparra/smarty-cssEmbed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Smarty plugin cssEmbed

A simple smarty plugin to improve front-end performance by embedding in-page CSS rather than in an external file when the file is too small.

Usage:

{cssEmbed media="screen" href="/css/main.css" threshold="15000"}

The media parameter is optional, and is a simple mapping of the <link> media attribute. So you can specify any media query in here. The threshold is also optional, with a default value of 10000. If the file weights less than "threshold" bytes, then it will be embedded in-page. If it weights more, the file is left external.

Particularly efficient when used along with assetic-smarty

Warning

You may encounter problems with relative paths in url() statements, if your CSS files and HTML documents are not in the same directory. You should prefer absolute paths (beginin with /) when using this plugin to avoid any bad surprise.

About

Smarty plugin that Improves CSS embedding with front-end performance in mind

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages