1

Sorry for the simply question,

I've seen in several posts that people have made a new theme and changed say the background of the homepage and would like to know where these variables are located. I know you have to make a new .less file however i'm unsure of how to correctly call variables to change aspects of my page.

How do you know the name of the variables, for example, the'background-color'? Where are the source files located?

1
  • I found some more paths where less variables are stored, please check edit Aug 23, 2018 at 17:14

1 Answer 1

1

The exact path would depend on whether you've installed magento using composer or web setup.

If you've used web setup, the files will be located here -

vendor/magento/theme-frontend-luma/web/css/source

and for composer installation they will be here -

app/design/frontend/Magento/luma/web/css/source

most of the variable of value will be located in (I think you can extrapolate relative paths for following for composer installation)

vendor/magento/theme-frontend-luma/web/css/source/_variables.less

and

vendor/magento/theme-frontend-luma/web/css/source/_theme.less

If you are extending Magento Blank theme instead of luma, you might wanna look here instead

vendor/magento/theme-frontend-blank/web/css/source/

EDIT :

After some further digging more variables can be found here -

vendor/magento/magento2-base/lib/web/css/source/lib/variables/

and for composer installation,

lib/web/css/source/lib/variables/
5
  • I can change the background colour but not another variable i have changed in vendor/magento/theme-frontend-luma/web/css/source. See my edit
    – Greg
    Aug 23, 2018 at 16:16
  • Please avoid asking multiple issues in same question. This is a different issue, please post a separate question for it. Aug 23, 2018 at 16:21
  • Its the same vein, just curious to know if i'm using the variable is all :)
    – Greg
    Aug 23, 2018 at 16:26
  • Np, let me look into it, also please accept the answer as it solved your original issue. Aug 23, 2018 at 16:27
  • Cheers mate - magento.stackexchange.com/questions/239397/…
    – Greg
    Aug 23, 2018 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.