Lines Matching +full:style +full:. +full:local +full:. +full:ini

6  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
7 * @author Andreas Gohr <andi@splitbrain.org>
15 if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
19 require_once(DOKU_INC . 'inc/init.php');
33 * @author Andreas Gohr <andi@splitbrain.org>
56 // load style.ini
63 $cache_files[] = $tplinc . 'style.ini';
64 $cache_files[] = DOKU_CONF . "tpl/$tpl/style.ini";
67 $cache_files[] = $conf['cachedir'] . '/preview.ini';
77 $files[DOKU_INC . 'lib/styles/' . $mediatype . '.css'] = DOKU_BASE . 'lib/styles/';
81 $files[DOKU_INC . 'lib/scripts/jquery/jquery-ui-theme/smoothness.css'] =
82 DOKU_BASE . 'lib/scripts/jquery/jquery-ui-theme/';
101 // Make it preventable.
105 // unset if prevented. Nothing will be printed for this mediatype.
109 // finish event.
115 'styles' .
116 $_SERVER['HTTP_HOST'] .
117 $_SERVER['SERVER_PORT'] .
118 $INPUT->bool('preview') .
119 DOKU_BASE .
120 $tpl .
122 '.css'
135 // plugins decide whether to include the DW default styles.
136 // This can be done by preventing the Default.
142 // Check if there is a wrapper set for this type.
149 // Print the styles.
152 echo $cssData['encapsulationPrefix'] . ' {';
154 echo '/* START ' . $cssData['mediatype'] . ' styles */' . NL;
169 echo ' END ' . $cssData['mediatype'] . ' styles */' . NL;
179 // apply style replacements
193 $css = preg_replace_callback('#(url\([ \'"]*)(' . $base . ')(.*?(?:\.(png|gif)))#i', 'css_datauri', $css);
234 if (preg_match('/\/(\* XXXXXXXXX )(.*?)( XXXXXXXXX \*)\//', $lines[$i], $m)) {
236 $msg .= ' in ' . $m[2] . ' at line ' . ($lno - $i);
243 $error = 'A fatal error occured during compilation of the CSS files. ' .
244 'If you recently installed a new plugin or template it ' .
245 'might be broken and you should try disabling it again. [' . $msg . ']';
247 echo ".dokuwiki:before {
262 * Does placeholder replacements in the style according to
263 * the ones defined in a templates style.ini file
265 * This also adds the ini defined placeholders as less variables
272 * @author Andreas Gohr <andi@splitbrain.org>
276 // we convert ini replacements to LESS variable names
281 $lkey = '@ini_' . $lkey;
282 $less .= "$lkey: $value;\n";
287 // we now replace all old ini replacements with LESS variables
291 $css = $less . $css;
302 * @author Gerry Weißbach <gerry.w@gammaproduction.de>
310 'encapsulationPrefix' => '@media ' . $mediatype
321 * @author Gerry Weißbach <gerry.w@gammaproduction.de>
336 * $name is the identifier given in the config. All Interwiki links get
337 * an default style with a default icon. If a special icon is available
338 * for an interwiki URL it is set in it's own class. Both classes can be
339 * overwritten in the template or userstyles.
341 * @author Andreas Gohr <andi@splitbrain.org>
346 // default style
347 echo 'a.interwiki {';
348 echo ' background: transparent url(' . DOKU_BASE . 'lib/images/interwiki.svg) 0 0 no-repeat;';
358 $file = 'lib/images/interwiki/' . $iw . '.' . $ext;
360 if (file_exists(DOKU_INC . $file)) {
361 echo "a.iw_$class {";
362 echo ' background-image: url(' . DOKU_BASE . $file . ')';
373 * @author Andreas Gohr <andi@splitbrain.org>
378 // default style
379 echo '.mediafile {';
380 echo ' background: transparent url(' . DOKU_BASE . 'lib/images/fileicons/svg/file.svg) 0px 1px no-repeat;';
388 if ($dh = opendir(DOKU_INC . 'lib/images/fileicons/svg')) {
390 if (preg_match('/(.*?)\.svg$/i', $file, $match)) {
398 echo ".mf_$class {";
399 echo ' background-image: url(' . DOKU_BASE . 'lib/images/fileicons/svg/' . $ext . '.svg)';
421 * @author Chris Smith <chris@jalakai.co.uk>
437 * for less files.
451 $css = preg_replace_callback('#(url\( *)([\'"]?)(.*?)(\2)( *\))#', [$this, 'replacements'], $css);
452 $css = preg_replace_callback('#(@import\s+)([\'"])(.*?)(\2)#', [$this, 'replacements'], $css);
474 $regex = '/^(' . implode('|', $basedir) . ')/';
485 * @param array $match see http://php.net/preg_replace_callback
486 * @return string see http://php.net/preg_replace_callback
493 } elseif (str_ends_with($match[3], '.less')) { // a less file import? - requires a file system location
495 $match[3] = $this->getRelativePath() . '/' . $match[3];
498 $match[3] = $this->location . $match[3];
506 * Convert local image URLs to data URLs if the filesize is small
522 $local = DOKU_INC . $url;
523 $size = @filesize($local);
525 $data = base64_encode(file_get_contents($local));
528 $url = 'data:image/' . $ext . ';base64,' . $data;
530 $url = $base . $url;
532 return $pre . $url;
541 * @author Andreas Gohr <andi@splitbrain.org>
549 $list[DOKU_PLUGIN . "$p/$mediatype.css"] = DOKU_BASE . "lib/plugins/$p/";
550 $list[DOKU_PLUGIN . "$p/$mediatype.less"] = DOKU_BASE . "lib/plugins/$p/";
551 // alternative for screen.css
553 $list[DOKU_PLUGIN . "$p/style.css"] = DOKU_BASE . "lib/plugins/$p/";
554 $list[DOKU_PLUGIN . "$p/style.less"] = DOKU_BASE . "lib/plugins/$p/";
565 * @author Andreas Gohr <andi@splitbrain.org>
575 return '"STR' . (count($quote_storage) - 1) . '"';
578 $css = preg_replace_callback('/(([\'"]).*?(?<!\\\\)\2)/', $quote_cb, $css);
581 $css = preg_replace_callback('#(/\*)(.*?)(\*/)#s', 'css_comment_cb', $css);
584 $css = preg_replace_callback('/^.*\/\/.*$/m', 'css_onelinecomment_cb', $css);
593 '/([: ])0+(\.\d+?)0*((?:pt|pc|in|mm|cm|em|ex|px)\b|%)(?=[^\{]*[;\}])/',
596 ); // "0.1em" to ".1em", "1.10em" to "1.1em"
598 '/([: ])\.(0)+((?:pt|pc|in|mm|cm|em|ex|px)\b|%)(?=[^\{]*[;\}])/',
601 ); // ".0em" to "0"
603 '/([: ]0)0*(\.0*)?((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/',
608 '/([: ]\d+)(\.0*)((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/',
613 '/([: ])0+(\d+|\d*\.\d+)((?:pt|pc|in|mm|cm|em|ex|px)(?=[^\{]*[;\}])\b|%)/',
620 '/(?<![\w\-])((?:margin|padding|border|border-(?:width|radius)):)([\w\.]+)( \2)+(?=[;\}]| !)/',
625 '/(?<![\w\-])((?:margin|padding|border|border-(?:width)):)([\w\.]+) ([\w\.]+) \2 \3(?=[;\}]| !)/',
656 * @author Andreas Gohr <andi@splitbrain.org>