I have just started to work with Magento 2 and I have the building blocks in place for my custom theme.

I'm only restyling the default luma theme and overriding the styling to fit in more with our business.

I am wondering how I can add more colors to _colors.less, Is it a simple case of adding more definitions to the file in the below location?



or do I override this somehow? I can't find much documentation on adding your own custom colors, just guides that use the default colours provided by Magento.

1 Answer 1


You need to create custom magento theme.

You have to override variable value in your custom theme web\css\source_theme.less file as below:

@button__color: red;
  • Can I just copy the _colors.less file into my own themes /lib/ folder and add colours to that?
    – cz84
    Commented Apr 4, 2018 at 15:58
  • @cz84 you can define your variable in above file and reuse it in your custom theme css. That is standard practice to override theme Commented Apr 4, 2018 at 16:20

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.