Default CSS (Without Minimization) (Design/Themes)
Where can I find the default style-sheets without minimization?
by Dustin , Saturday, November 08, 2014, 03:42 (3456 days ago)
Where can I find the default style-sheets without minimization?
by Alfie , Vienna, Austria, Sunday, November 09, 2014, 11:25 (3455 days ago) @ Dustin
Hi Dustin!
my_little_forum_2.3.3.zip
⇒ forum/themes/default/style.css
Don’t forget what’s given on its top:
/***********************************************************************
* NOTICE: In order to reduce bandwidth usage, a minimized version of *
* this stylesheet is used by default (style.min.js). Changes in this *
* file do not have any effect unless it is loaded by the template *
* (main.tpl). *
* The minimized version was created with the YUI Compressor *
* <http://developer.yahoo.com/yui/compressor/>. *
***********************************************************************/
--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)
by Auge , Monday, November 10, 2014, 11:39 (3454 days ago) @ Alfie
edited by Auge, Monday, December 15, 2014, 22:47
Hello
Don’t forget what’s given on its top:
/***********************************************************************
* NOTICE: In order to reduce bandwidth usage, a minimized version of *
* this stylesheet is used by default (style.min.js). Changes in this *
* file do not have any effect unless it is loaded by the template *
* (main.tpl). *
* The minimized version was created with the YUI Compressor *
* <http://developer.yahoo.com/yui/compressor/>. *
***********************************************************************/
Some additionally thoughts:
What does the minification? It replaces line breaks with blanks and merges multiple spaces to single ones.
/* source */ body { background: #ffffff; color: #000000; margin: 0; padding: 0; } /* minified */ body { background: #ffffff; color: #000000; margin: 0; padding: 0; }
Alex uses the linked tool yui-compressor. One can her- or himself minify the source with a capable editor. As said above, it is only necessary to replace line breaks with blanks and merge multiple spaces into one space in a second step. If the editor can search for control chars one can minify the source without an additional tool.
Search for "\r\n
" or "\n
" (OS dependant [1]), replace with "
". Search for multiple spaces with a regular expression (if possible) or with "
" (two spaces, maybe it needs multiple cycles). That should do the job.
[1] Searching for "\r" as MacOS line break for versions < 10 is (in Borg style) futile.
Tschö, Auge
--
Trenne niemals Müll, denn er hat nur eine Silbe!
by Alfie , Vienna, Austria, Monday, November 10, 2014, 14:35 (3454 days ago) @ Auge
Hi Auge,
I guess this attempt to reduce the amount of data transferred for narrow-bandwidth connections is obsolete and makes only the life of admins miserable. AFAIK nowadays most servers are by default configured to deliver gzipped-content (BTW, here as well – the main page as of today: gzipped: 5.49 KiB / decoded: 37.60 KiB = 85% decrease).
If gzip is not activated, try in .htaccess
:
<IfModule mod_deflate.c>
<FilesMatch "\.(php|html|htm|xml|css|gss|js|txt|svg|csv|xls)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
Note: Not meaningful to include content which is already compressed (binary data like images, etc).
If one wants to efficiently reduce the amount of data transferred, one can additionally play with cache-control, which is set here to Apache’s default of 300 seconds). This is what I use in my .htaccess
:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 300 seconds"
ExpiresByType image/png "access plus 2 months"
ExpiresByType image/gif "access plus 2 months"
ExpiresByType image/jpeg "access plus 2 months"
ExpiresByType text/javascript "access plus 2 months"
ExpiresByType image/x-icon "access plus 2 months"
ExpiresByType text/css "access plus 1 week"
</IfModule>
That’s already conservative; if you don’t change regularly icons and css you could even opt for a longer expiration period.
--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)
by Auge , Monday, November 10, 2014, 15:02 (3454 days ago) @ Alfie
Hello Alfie,
I guess this attempt to reduce the amount of data transferred for narrow-bandwidth connections is obsolete …
Maybe, it depends on the standard settings of the mobile browsers (because they are the main targets of minification and bandwidth saving).
… and makes only the life of admins miserable.
ACK
AFAIK nowadays most servers are by default configured to deliver gzipped-content …
Makes it any difference to serve an minified or unminified file to gzip? If not, you are complete right.
Tschö, Auge
--
Trenne niemals Müll, denn er hat nur eine Silbe!
by Alfie , Vienna, Austria, Tuesday, November 11, 2014, 01:48 (3453 days ago) @ Auge
Hi Auge,
Maybe, it depends on the standard settings of the mobile browsers (because they are the main targets of minification and bandwidth saving).
Hhm. Do you know a source stating which mobile browser don’t support it?
Makes it any difference to serve an minified or unminified file to gzip?
I does (size in byte):
style.css 37,414 style.css.gz 6,439 -82.8%
style.min.css 28,929 style.min.css.gz 5,191 -82.1%
-22.7% -19.4%
Some google-stuff.
--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)
by Auge , Tuesday, November 11, 2014, 09:53 (3453 days ago) @ Alfie
Hello Alfie
Maybe, it depends on the standard settings of the mobile browsers …
Hhm. Do you know a source stating which mobile browser don’t support it?
No, it's a hypothetical thought.
Makes it any difference to serve an minified or unminified file to gzip?
I does (size in byte):
style.css.gz 6,439 -82.8%
style.min.css.gz 5,191 -82.1%
-19.4%
Ouch, around one and a half Kilobyte.
Tschö, Auge
--
Trenne niemals Müll, denn er hat nur eine Silbe!