2

CSS not loading properly in magento2. Getting below error:

NameError: variable @button__shadow-active is undefined

in _buttons.less
NoNaMe
  • 6,020
  • 30
  • 82
  • 110
user2733745
  • 220
  • 2
  • 4
  • 13

6 Answers6

1

Do you use wampserver ?

  1. Go to your wampserver icon and click on it and than

Apache->apache modules->rewrite_module[enable this]

After this start all services and check it ........

Ashish Patel
  • 772
  • 5
  • 12
0

Css not loaded properly means static content rendering problem so,

Remove cache,page_cache,view_preprocessed from var table

Give full permissions to var folder

Run static command in magento root folder php bin/magento setup:static-content:deploy

now Roload the site

Sathish Kumar VG
  • 2,154
  • 1
  • 12
  • 19
0

CSS not loading properly due to static deploy not push the file to pub/static directory.

You have to follow the below steps.

  1. rm -rf var/*
  2. rm -rf pub/static/*
  3. php bin/magento setup:static-content:deploy
  4. chmod -R 7777 var pub/static
Abhinav Kumar Singh
  • 2,325
  • 1
  • 10
  • 11
0

As the error says your less variable is missing and not found. It means these are possible reasons for your error:

  • Invalid .less variable declaration.
  • If you are importing variables from another file - you have an invalid declaration of that file in the XML or you didn't import that file on your less file with @import "custom-variables.less";
  • There is a typo in your main .less file

Without code, there are only guesses. Please provide us a code so we could check it more precisely. Also, check your .log files there can be some hints.

Macas
  • 560
  • 3
  • 22
0

From

<Directory /var/www/>

     Options Indexes FollowSymLinks

     AllowOverride None

     Require all granted

</Directory>

From

<Directory /var/www/>

     Options Indexes FollowSymLinks

     AllowOverride All

     Require all granted

</Directory>
  • sudo service apache2 restart
  • rm -rf var/cache/*
  • rm -rf var/generation/*
  • php bin/magento setup:upgrade
  • php bin/magento setup:static-content:deploy
  • chmod -R 777 pub var This will solve your css issues, admin 404 issues , link/url 404 issue , version-xxx issue.
Mage Crane
  • 11
  • 4
-1

Try this,

  1. set permission on /var and /pub folders to 777

  2. ssh using this command

    php bin/magento setup:static-content:deploy
    
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Pradeep Kumar
  • 152
  • 1
  • 3