noumo / easyii

Easy yii2 cms powered by Yii framework 2
http://easyiicms.com
593 stars 270 forks source link

Remove Bootstrap dependency from the front-end navbar #39

Open vnenkpet opened 9 years ago

vnenkpet commented 9 years ago

Sometimes loading the bootstrap css and js files can break your layout if your front-end doesn't use bootstrap at all. Can we create a new Asset that only affects easyii-navbar and is loaded alone instead of the Bootstrap asset when not in the /admin area?

noumo commented 9 years ago

Yes this is good idea, but we need to reproduce frontend navbar on pure css, fortunately he is very simple :)

YaroslavShapoval commented 9 years ago

Hello. I am thinking about the separation of easyii-navbar style and bootstrap style. It is pretty simple to implement, but still have some questions:

  1. Should it be responsive like bootstrap's container?
  2. Should I move needed glyphicons to png-icons?
  3. Why opensans googlefont registered here?
lial commented 7 years ago

Подскажите как отключается bootsrap для форнтенда ? Летит вся вся верстка из-за него

sim2github commented 7 years ago

@lial Бандлы можно переназначить в конфиге

    'components' => [
        'assetManager' => [
            'class' => 'yii\web\AssetManager',
            'linkAssets' => true,
            'appendTimestamp' => YII_ENV_DEV,
            'bundles' => [
                'yii\bootstrap\BootstrapAsset' => [
                    'sourcePath' => null, 'css' => [], 
                ],
                'yii\bootstrap\BootstrapPluginAsset' => [
                    'sourcePath' => null, 'js' => [],
                ],
                'yii\jui\JuiAsset' => [
                    'sourcePath' => null, 'css' => [], 'js' => [],
                ],
            ],
        ],
lial commented 7 years ago

Я спрашивал как отключать их для фронта только, то что указали вы есть в манах Yii и оно проблему не решает, ибо отключает их как для фронта так и для бэкенда, чуствуете разницу ?

sim2github commented 7 years ago

Тогда внимательнее прочитайте маны по yii\web\AssetBundle

app\assets\AppAsset
    public $depends = [
        'yii\web\JqueryAsset',
        //'yii\bootstrap\BootstrapAsset',
    ];

Данный код уберет из подгрузки зависимость bootstrap.css. Я правильно прочувствовал разницу?