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

Custom theme development improvement #1263

Open
concimuscb opened this issue Dec 18, 2024 · 1 comment
Open

Custom theme development improvement #1263

concimuscb opened this issue Dec 18, 2024 · 1 comment

Comments

@concimuscb
Copy link

As far as my understanding goes, to develop a custom theme, you have to alter an existing one. Right now, the process can be a bit annoying because parent elements do not necessarily cascade their settings to all offspring. This is because there might some intermediate elements with different settings.

To give a more concrete example:

  • I wanted to make all lines in my chart black. Hence, I apply: line=element_line(color='black')
  • But then I realized that the grid lines where still grey.
  • After a while I realized that the default theme has: panel_grid=element_line(color='grey)

This creates a situation where, if you want to create a custom theme, you need to define every single element in full just to make sure that there are not intermediate elements messing with your settings. With this, inheritance becomes useless.

In my eyes, the implementation should be such that the default theme has all elements defined as None. That way, if an element is passed to the theme, all offspring will correctly inherit its properties. Only at rendering time, any leftover Nones should be substituted by suitable defaults.

If I am missing something and there is already a way to achieve what I am describing, please let me know.

@alshan
Copy link
Collaborator

alshan commented Dec 19, 2024

Here you can try to start with theme_none() where only few top-level attributes are defined initially.

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

No branches or pull requests

2 participants