Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX] Allow sub-themes to disable color support inherited by their parent theme #4463

Open
klonos opened this issue Jul 2, 2020 · 3 comments

Comments

@klonos
Copy link
Member

klonos commented Jul 2, 2020

This was brought up in Zulip: https://backdrop.zulipchat.com/#narrow/stream/218635-Backdrop/topic/Sub-theme.2C.20remove.20color.20support

@olafgrabienski

I was considering to provide color support for a sub-theme of Basis. Out of the box, I see the Basis color settings in my sub-theme. Then I wanted to provide a subset of the settings, e.g. only header and footer background but that seems to be complicated. So for now I want to just remove color support for the sub-theme, so that it doesn't show the settings coming from Basis. Does anyone know how to do it?

@klonos

Try setting settings[color] = false in the .info file of the theme ...see: https://github.com/backdrop/backdrop/blob/1.x/core/themes/basis/basis.info#L44

@indigoxela

settings[color] = false doesn't do anything.
@olafgrabienski I didn't find a way to achieve this (getting rid of a base modules color settings), but I'm also interested. Reading the color module's code makes me think that it's impossible. The base theme's settings are always merged regardless of what the sub theme sets or unsets. At best one can produce php notices...

@indigoxela
Copy link
Member

@klonos many thanks for opening this issue.

... to be more precise: It's currently not only impossible to completely disable color module support in a subtheme if the base theme has it, it's also impossible to get rid of selected base theme color settings.

@klonos
Copy link
Member Author

klonos commented Jul 2, 2020

Perhaps this was a side-effect of #3348? I have some time to spare, so I may have a go at this.

@indigoxela
Copy link
Member

indigoxela commented Jul 8, 2020

#3348 was an improvement for sure, but now we need to do the next step...

What's currently not working:

  • Subthemes of themes with color module support, that should not use color settings at all (bunches of php notices and no clean way to get rid of the base theme color form items)
  • Subthemes of themes with color module support, that want different color settings (other fields / palettes - leads to php notices like above)
  • Themes (base) that wish to use theme settings but no color schemes have to use a workaround

What we might need to implement:

  • At least a switch to turn color form off. settings[color] = FALSE in the (sub)themes' info file could be an option.
  • A switch to indicate if subthemes do want to inherit or want to override base themes' color settings.

Evaluation will probably go to function color_form_system_theme_settings_alter(), possibly to color_get_info().

Something like:

  • settings[color] = FALSE no color form items at all
  • settings[color] = 'inherit' (or maybe TRUE) load base theme settings
  • settings[color] = 'override' use different settings, do not merge base theme settings

@klonos what do you think - would this be clear enough from a theme developer and Backdrop user/admin perspective?

Any other thoughts here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants