K
K
kanly2020-04-17 16:14:41
css
kanly, 2020-04-17 16:14:41

How to connect sass to yii2?

I want to include sass files in my project, I included them via AppAsset:

class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.css',
        'css/style.css',
        'css/owl.carousel.min.css',
        'css/owl.theme.default.min.css',
    ];
    public $sass = [
        'css/main.sass',
    ];
    public $js = [
        'js/script.js',
        'js/main.js',
        //'js/bootstrap.js',
        'js/owl.carousel.min.js',
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
        'yii\bootstrap\BootstrapPluginAsset',
    ];
}


but does not accept, connected incorrectly or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-04-18
@kanly

1. Use webpack. Then connect the compiled file to the framework.
2. Expansion

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question