Topic: Theme error (Bootstrap3 CSS)

Hi!

I created a simple theme with last Bootstrap:

<?php
$theme_path = 'public/themes/zero/';
$theme_url = Site::url() . 'public/themes/zero/';
Stylesheet::add( $theme_path . 'css/bootstrap.min.css', 'frontend', 1 );
Stylesheet::add( $theme_path . 'css/bootstrap-theme.min.css', 'frontend', 2 );
Stylesheet::add( $theme_path . 'css/styles.css', 'frontend', 3 );
Javascript::add( $theme_path. '../../../post/1975/js/forum_subdomain/jquery.min.js', 'frontend', 1 );
Javascript::add( $theme_path. '../../../post/1975/js/forum_subdomain/bootstrap.js', 'frontend', 2 );
?>
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="utf-8">
    <title><?php echo Site::name() . ' - ' . Site::title(); ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="<?php echo Site::description(); ?>">
    <meta name="keywords" content="<?php echo Site::keywords(); ?>">
    <meta name="robots" content="<?php echo Page::robots(); ?>">
    <link rel="icon" href="<?php echo $theme_url; ?>favicon.gif" type="image/x-icon">
    <link rel="shortcut icon" href="<?php echo $theme_url; ?>favicon.gif" type="image/x-icon">
    <?php Stylesheet::load(); ?>
    <!--[if lt IE 9]>
    <script src="<?php echo $theme_url; ?>js/html5.js"></script>
    <![endif]-->
</head>
<body>
    <div class="container" id="outer">
    </div>
    <?php Javascript::load(); ?>
</body>
</html>

Seems, error occurred while execute Stylesheet::load()

Monstra 2.3.1

PS How I can see PHP errors in Monstra?

Re: Theme error (Bootstrap3 CSS)

Unfortunately, yes, problem in MinifyCSS::process()
For some reasone script fails while compiling TB3 CSS
Thats why I am using such code, now

<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/bootstrap.css" type="text/css" />

PS How I can see PHP errors in Monstra?

http://monstra.org/documentation/environments
http://monstra.org/documentation/error-handling

Monstra Loves You! Give some love back!

Re: Theme error (Bootstrap3 CSS)

Awilum, thanks for reply!

Monstra's code is very comfortable and good structured. Monstra has great potential.

I fixed my problem by replacing Stylesheet.php:123 from

file_put_contents($frontend_site_css_path, MinifyCSS::process($frontend_buffer));

to

file_put_contents($frontend_site_css_path, $frontend_buffer);

It's bad idea, I know, but Boostrap3's support is required. Maybe set an option (or several options) to contol minifying of HTML/JS/CSS?

4

Re: Theme error (Bootstrap3 CSS)

You need to comment the following lines in libraries/Gelato/Minify/MinifyCSS.php file (line 111)

        // remove ws in selectors
        /*
        $css = preg_replace_callback('/
                (?:              # non-capture
                    \\s*
                    [^~>+,\\s]+  # selector part
                    \\s*
                    [,>+~]       # combinators
                )+
                \\s*
                [^~>+,\\s]+      # selector part
                {                # open declaration block
            /x'
            ,array($this, '_selectorsCB'), $css);
        */