CSS files

Contents

    Bludit provides helpers for developers to write less code.

    For the purpose of this tutorial we will use the following names:

    • Name of the theme box
    • Site URL https://www.example.com
    • Theme path /bl-themes/box/
    • CSS file path /bl-themes/box/style.css

    Let's add a CSS file called style.css, the file is located in /bl-themes/box/style.css, you don't need to care about the absolute path if you the helper Theme::.

    <?php
        echo Theme::css('style.css');
    ?>

    HTML output

    <link rel="stylesheet" type="text/css" href="https://www.example.com/bl-themes/box/style.css">

    Example

    The next HTML and PHP code is a complete example of how to include two CSS files in a theme.

    <!DOCTYPE html>
    <html>
        <head>
            <title>Hello</title>
    
            <?php
                echo Theme::css('style.css');
                echo Theme::css('buttons.css');
            ?>
        </head>
    <body>
    
    <h1>This is a Heading</h1>
    <p>This is a paragraph.</p>
    
    </body>
    </html>