André Castro
André Castro

Reputation: 1565

Yii2 Where is the CSS file that permits to edit the style of pages

I'm new to Yii2, and i spent the last 2 hours in finding how to change the black top menu bar color of Yii2. In Yii1.1 it was easy, but now i cannot figure out where it is the CSS file. Inspecting element in Chrome says the file is in assets dir, but i edit this file and nothing happens. In the folder vendor/Yiisoft/bower/bootstrap -> editing the css files inside wont change a thing.

So, whats going on with Yii2 to change the CSS appearance of a page?

many thanks in advance.

Upvotes: 2

Views: 5305

Answers (1)

mijopabe
mijopabe

Reputation: 656

The css file is inherited from the bootstrap CSS files. The extension navbar.php uses navbar-default as its style when initiated. Including a CSS file with custom styling can be linked after the boostrap vendor CSS is included in the config file:

'components' => [
    'assetManager' => [
        'bundles' => [
             'yii\bootstrap\BootstrapAsset' => [
                 'sourcePath' => 'your-path',
                 'css' => ['css/bootstrap.css', 'path/to/custom.css']
            ],
        ],
    ],
],

Source: http://www.yiiframework.com/wiki/628/override-eliminate-bootstrap-css-js-for-yii-2-0-widgets/

Upvotes: 3

Related Questions