3

I'm wondering which theme is best to use as my custom theme's parent theme?

Should it be Magento/blank or Magento/luma?

Does is matter or is one more stable than the other? I noticed some LESS files where changed in our latest upgrade.

app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_progress-bar.less

some additional style rules were added which effected our child theme.

Even with that, luma has some features which are better than in blank, such as the layered nav being responsive on mobile with the Shop By Button which opens the layered nav in a slide in modal.

enter image description here

With Blank the Layered Nav is styled very poorly.

enter image description here

2 Answers 2

7

Short Answer: This depends on how likely Magento are to make updates to Blank/Luma.

In the past it has been advised you DO NOT use the Luma theme as a parent, as this is Magento's demo theme they are more likely to update this without warning.

Quotes

Alan Kent (Magento chief architect)

The Luma theme is not designed to be inherited from - it is purely developed as a demo store for people to explore and play with

Taken from https://github.com/magento/magento2/issues/2547

I have just noticed that approx 1 year after making that comment Alan said this:

I checked with the PM's more recently, and they said aim is now to allow people to inherit from Luma. We might need to clean up a few things over time to make this "nicer

Source - https://github.com/magento/magento2/issues/3220#issuecomment-177296871

So it sounds like they are aware people are using Luma as a parent so in my opinion it shouldn't really matter which one you use.

The flip side

On the flip side you can still use Luma as a parent without issue, I have built one project using Luma as a parent and didn't run into any Luma specific issues.

What I did to workaround the 'Magento may update Luma' issue is to clone the Luma theme naming it lumaClone. And then used that as a parent, the downside of this is you have to manually make all the template changes made in patches.

My recommendation

My recommendation is to create your own blank theme (not using Magento's Blank or Luma themes), and use that as a parent. But of course that takes a considerable amount of time to do so not everyone will be able to do so.

But this gives you a better starting point, more flexibility, and more control. With the downside patches will potentially involve more manual work.

5
  • thanks, do you know if there are many features, like the layered nav, missing from blank which are in luma? it shouldn't be difficult to add that one in on my child theme
    – Holly
    Jul 11, 2017 at 15:21
  • I'm not too sure on the differences sorry, it shouldn't take too long to figure out though. Any files inside the Luma theme directory have been updated.
    – Ben Crook
    Jul 11, 2017 at 15:27
  • 1
    I've updated my answer with more info btw.
    – Ben Crook
    Jul 11, 2017 at 15:28
  • @BenCrook helpful. Jul 11, 2017 at 15:45
  • 1
    @BenCrook did a little more digging, see my answer below. Interested in your point of view :)
    – Holly
    Jul 13, 2017 at 5:54
2

In addition to @BenCrook's answer, I downloaded most recent releases & release candicates from Magento and ran diff commands on them to see how many changes were made to the theme.

diff -x '.*' -Nr Magento-CE-2.1.0-2017-03-29-01-43-36/vendor/magento/theme-frontend-luma/  Magento-CE-2.1.7-2017-05-30-02-18-42/vendor/magento/theme-frontend-luma/
diff -x '.*' -Nr Magento-CE-2.1.0-2017-03-29-01-43-36/vendor/magento/theme-frontend-blank/  Magento-CE-2.1.7-2017-05-30-02-18-42/vendor/magento/theme-frontend-blank/

diff -x '.*' -Nr Magento-CE-2.1.7-2017-05-30-02-18-42/vendor/magento/theme-frontend-luma/ magento2-2.2.0-RC1.1/app/design/frontend/Magento/luma/
diff -x '.*' -Nr Magento-CE-2.1.7-2017-05-30-02-18-42/vendor/magento/theme-frontend-blank/ magento2-2.2.0-RC1.1/app/design/frontend/Magento/blank/

diff -x '.*' -Nr magento2-2.2.0-RC1.1/app/design/frontend/Magento/luma/ magento2-2.2.0-RC1.3/app/design/frontend/Magento/luma/
diff -x '.*' -Nr magento2-2.2.0-RC1.1/app/design/frontend/Magento/blank/ magento2-2.2.0-RC1.3/app/design/frontend/Magento/blank/

I found there were lots of differences between releases on both Luma & Blank theme's style rules. In which case style rules from both are not stable.

This is annoying. If your theme inherits the Magento blank or luma, upgrades could change the appearance of your theme. I can understand a few additional style rules for new elements introduced in a release but not so many.

If you were to follow Ben's recommendation by creating your own blank theme, and use that as a parent, could you loose important updates in Layout XML updates or KO template files? I'm wondering which is the lesser of two evils, this or needing to fix CSS issues which arise from updates to core blank/luma LESS files.

8
  • Yeah you would lose the updates as the files will no longer be falling back to the updated templates, but this also happens when you create a theme from scratch. Any time you overwrite a template you lose that option, so regardless of whether you use a parent theme or not you'll run into this problem. Although it will likely require more time if you have overwritten all the files.
    – Ben Crook
    Jul 13, 2017 at 8:16
  • There are quite a few pros and cons to each method so I don't think one method is better than another, it all depends on how often Magento make changes that will break styling/other templates and each client's budget/time allocation. For example if a client only has a small retainer, say a few hours a week then manually updating the files from a large patch could take them over their allocated time.
    – Ben Crook
    Jul 13, 2017 at 8:20
  • thanks @BenCrook , one last question. In your answer you say it takes a "considerable amount of time" to clone the blank or luma themes. Is it not just a case of copying the luma directory into your app/design/frontend/vendor/luma-clone-2-1, and updating a few files, theme.xml, registration.php etc
    – Holly
    Jul 13, 2017 at 8:25
  • I meant it takes a considerable amount of time to create your own base theme, as in not using Blank or Luma but creating your own from scratch that can be used across all projects.
    – Ben Crook
    Jul 13, 2017 at 8:36
  • I thinking cloning Luma &/or blank is a good approach, they mostly just contain LESS files, very little phtml/email templates and some layout files. Still think the style rules from Magento should be more stable
    – Holly
    Jul 13, 2017 at 12:36

Your Answer

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

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