backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 39 forks source link

[D9] Add a sub theme starter kit to Basis #3914

Open stpaultim opened 5 years ago

stpaultim commented 5 years ago

Description of the need

I just had some very confusing issues with how color module works in a custom theme I was making based upon Basis (https://github.com/backdrop/backdrop-issues/issues/3341). I think that one would have the same confusion in sub theming basis. I've seen comments (https://github.com/backdrop/backdrop-issues/issues/2225#issuecomment-249030392) suggesting that we better document how to sub theme with Basis.

Would it make sense to include a sub theme starter kit in Basis with detailed documentation similar to what the Zen theme for Drupal had?

I understand that many people are already sub theming Basis AND this would fit the strategy of making Backdrop CMS friendly for beginning developers.

The Basis theme is probably the most likely piece of code that a new developer would engage with directly in Backdrop CMS Core.

Proposed solution

We could include this starter kit in the /themes directory which currently ships empty. The starter kit could be focused on Basis, but documented in such a way as to help a user sub theme any theme, using this as a template.

Alternatives that have been considered

This could be a contrib theme entirely and we could just add a note pointing at this contrib sub theme in the themes readme file that comes with core?

klonos commented 5 years ago

We could include this starter kit in the /themes directory which currently ships empty.

Yes to this idea, but not this bit specifically.

The way core is updated (both manually, as well ad automatically), is to replace the /core directory. If we shipped this subtheme outside /core, then people would miss any future updates/changes we'd make to it as part of core. We should either have it live under /core/themes, or have this be in contrib land.

stpaultim commented 4 years ago

A frustrated user in Gitter this evening provided some specific feedback about sub-theming Basis:

I'm using a subtheme of Basis—but following the docs and trying to only have the override files in that folder fails, I'm messing up something in syntax or file structure. The only way I can create the subtheme is to make a complete copy of the Basis folder. Which doesn't appear to be doing any harm? Or maybe it's the cause of my CSS nightmares, I have no idea.

I think that the primary take-away from this is that there might be real value in a sub-theme starter kit. I'm working on one for Tatsu and once I'm comfortable with that, I'd like to get feedback and see if we can adapt it for Basis/core.

stpaultim commented 4 years ago

We started talking about this issue BEFORE the DEV meeting today (it didn't get recorded).

The idea of providing help for creating sub-themes is popular, but it's not clear exactly the best way to handle this. We discussed.

1) Adding a starter kit to Basis 2) Adding a drush command for spinning up a sub-theme of Basis 3) Creating module that creates a subtheme.

The idea of a module that helps create a subtheme was a new idea and we started to talk about what that might look like. Can anyone elaborate?

domaingood commented 4 years ago

For sub theme. My prefer is zen theme.

serundeputy commented 4 years ago

this doc by @wesruv is excellent: https://paper.dropbox.com/doc/Basis-Theming-Sub-Theming-YtzvW2SgWnZ7MQz2QVgAS

If that doc is not already replicated on b.org we should do that; when/if it is we should point at it from the README.md in the /themes/README.md file

I think that is the low hanging fruit to start from then we can iterate on how to improve this for people from there.

stpaultim commented 4 years ago

@domaingood - Zen is a great example of a sub-theme starter kit. We are looking for feedback on the best way to provide this kind of assistance in Backdrop core - or if this is a core issue at all, maybe it is better handled by contrib theme or module?

How do you suggest we better help users create sub-themes inside or outside of Backdrop CMS core?

domaingood commented 4 years ago

I think adapt zen as core theme.because zen is better then Basis theme.

It's my thinking. Also check Genesis WordPress philosophy. And keep sub theme outside from core. So when any user update core and everything. Their design need to work as before.

PS I always work with Genesis and Drupal sub theme so when security updates our website safe also safe our design.

olafgrabienski commented 4 years ago

The idea of a module that helps create a subtheme was a new idea and we started to talk about what that might look like.

I know one Drupal module for creating sub-themes, Omega Tools. Are there more?

docwilmot commented 4 years ago

Coder Upgrade is already designed to parse a project and write modified version of it. I wonder if we could come up with a Coder Subthemer module.

If someone could delineate a bunch of requirements or expectations or processes for such an idea we could try that.

Graham-72 commented 4 years ago

I think adapt zen as core theme.because zen is better then Basis theme.

When I worked with D7 I used to almost always create a subtheme of Zen. When I moved to Backdrop 4+ years ago I realised that because of layouts there is a major difference in what is contained in what we now call a theme. I seem to remember adjusting layouts by settings within Zen.

I think that anything useful as an equivalent of a 'traditional theme' in Backdrop has to be theme + layout. I hasten to say that as a site-builder I like the separation of theme and layouts. My point is that it is the combination of these that the client sees as the 'theme' of their site.

Although I am a regular user of Basis my main reservation about it is that it makes assumptions about layout of blocks within the header. One can of course override the assumptions but an off-the-shelf theme should make this easier than it is.

ghost commented 4 years ago

This might not be relevant (since people creating a sub-theme probably don't need it to be a GitHub repository), but this might work too: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository

Also see https://github.com/backdrop-ops/contrib/issues/344

olafgrabienski commented 4 years ago

Coder Upgrade is already designed to parse a project and write modified version of it. I wonder if we could come up with a Coder Subthemer module.

@docwilmot Nice idea, but I guess Coder Upgrade is too overwhelming for people who only want to create a sub-theme. What do you think about forking Coder Upgrade to make a standalone module only for sub-theme creation?

docwilmot commented 4 years ago

I wonder if we could come up with a Coder Subthemer module.

@olafgrabienski thats what i meant.

klonos commented 3 years ago

D9 now ships with a starterkit theme generator See: https://www.drupal.org/node/3206389

New starterkit theme generator has been added as an experimental new tool in core. The starterkit theme generator allows developers to create a starting point for their theme. The generated theme has similar markup and CSS previously provided by Classy base theme including common CSS classes and markup. Instead of inheriting the markup and CSS from a base theme, the starterkit theme generator copies the defaults into a new theme. Tooling is provided as part of the included Drupal command line interface for automating this:

php core/scripts/drupal generate-theme mytheme

As a result of this change, front-end developers can expect more frequent updates to the default markup and CSS shipped as part of Drupal core.