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

Define default classes while subclassing #3843

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

falkoschindler
Copy link
Contributor

This PR introduces default_classes, default_style and default_props arguments for Element.__init_subclass__ so that defaults like "nicegui-*" classes can be defined while subclassing. This way they can be removed by the user calling something like ui.link.default_classes(replace='text-red-500'), solving issue #3826.

@ghbm-itk
Copy link
Contributor

ghbm-itk commented Oct 8, 2024

Isn't this technically a breaking change or can it be defined as a bugfix? Some users might be reliant on the existing behavior

@falkoschindler falkoschindler marked this pull request as draft October 8, 2024 08:09
@falkoschindler falkoschindler removed the request for review from rodja October 8, 2024 08:10
@falkoschindler
Copy link
Contributor Author

@ghbm-itk That's a good question. At the moment even the pytests are broken. I'll try to fix them first. Then we should evaluate how exactly the behavior changed and if we consider it a bug fix or a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui.link.default_classes(replace) doesn't replace the nicegui-link class
2 participants