Caution re css compression widget - it overwrites the stylesheet.
If you install the CSS Compression Widget by importing the partial design snapshot CSSCompressionWidget-Sitexxx.acd you will overwrite your stylesheet with a default Stylesheet, any customisation or additions you have made to the stylesheet will be lost.
To avoid this, open the Actinic Stylesheet by clicking 'Curent Stylesheet' in Design View,
At the very very top make a new line and paste the following:
At the very very bottom, after everything else, make a new line and paste the following:
It works really well, thank you Hugh! Better than this forum does. Inexplicably the forum replaces bits of code with smileys for heaven's sake. Please fix this Sellerdeck.
Here it is as a text file:https://graphicz.solutions/csscomp.txt
If you install the CSS Compression Widget by importing the partial design snapshot CSSCompressionWidget-Sitexxx.acd you will overwrite your stylesheet with a default Stylesheet, any customisation or additions you have made to the stylesheet will be lost.
To avoid this, open the Actinic Stylesheet by clicking 'Curent Stylesheet' in Design View,
At the very very top make a new line and paste the following:
Code:
/* sd.widget.CSS Compression Widget.1.2:BEGIN */ <actinic:block php="true"> $sCSS = <<<'CSSDefinition' /* sd.widget.CSS Compression Widget.1.2:END */
Code:
/* sd.widget.CSS Compression Widget.1.2:BEGIN */ CSSDefinition; <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCompressionEnabled%22%20%2f%3e"> // Clean up CSS $sCSS = preg_replace('/ | /', ' ', $sCSS); // eliminate newlines $sCSS = preg_replace('/\s+/', ' ', $sCSS); // convert all multiple tabs and spaces to a single space $sCSS = preg_replace('/\/\*.*?\*\//', '', $sCSS); // remove all comments $sCSS = preg_replace('/\s*(\{|\}|:|;|,|>|\/)\s*/', '${1}', $sCSS); // eliminate spaces either side of { } : ; , > / $sCSS = preg_replace('/([^0-9])0px/', '${1}0', $sCSS); // convert 0px to 0 $sCSS = preg_replace('/^\s*/', '', $sCSS); // remove spaces remaining at start of CSS $sCSS = preg_replace('/([^\'])#([0-9a-fA-F])\2([0-9a-fA-F])\3([0-9a-fA-F])\4/', '${1}#${2}${3}${4}', $sCSS); // convert colours like #aabbcc to #abc $sCSS = preg_replace('/(padding|margin):([0-9]+(?:px|%)+) \2;/', '${1}:${2};', $sCSS); // convert margin:0 0; to margin:0; $sCSS = preg_replace('/(padding|margin):([0-9]+(?:px|%)+) \2 \2 \2;/', '${1}:${2};', $sCSS); // convert margin:0 0 0 0; to margin:0; $sCSS = str_replace(' !important', '!important', $sCSS); // remove space before !important $sCSS = str_replace(';}', '}', $sCSS); // get rid of trailing ; in rules </actinic:block> echo $sCSS; </actinic:block> /* sd.widget.CSS Compression Widget.1.2:END */
Here it is as a text file:https://graphicz.solutions/csscomp.txt
Comment