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

Add library with semantic controls to help standarize themes creation. #17512

Open
vpenades opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@vpenades
Copy link

vpenades commented Nov 14, 2024

Is your feature request related to a problem? Please describe.

Avalonia provides a foundation of controls that can be used to create rich applications. It also provides a powerful mechanism to create nice looking styles and themes.

After reviewing multiple available themes (Material, SukiUI and others) I've noticed there's a gap, or disconnection between the themes and the controls provided by avalonia.

To some degree, the themes need some contextual knowledge of the styled controls, and currently some of the themes resolve to create custom controls to fill this missing context, which IMHO, goes against the concept of a theme.

This is the same problem the web suffered with the div element which is the equivalent of the ContentControl, and was resolved in Html5 with the introduction of Semantic Elements:

Examples of non-semantic elements: div and span - Tells nothing about its content.
Examples of semantic elements: form, table, and article - Clearly defines its content.

Describe the solution you'd like

I would like to propose creating a library called avalonia.Themes.SemanticControls

The controls would look like this:

// commonly used controls
class GroupBox : HeaderedContentControl { }
class Card: ContentControl {}
// semantic web elements
class Section: ContentControl {}
class Article: ContentControl {}
class Summary: ContentControl {}
...

The list of semantic controls to include would be:

This would allow theme developers to create styles for these controls instead of creating styles for the lower level controls, which lack context about their usage within the layout.

Describe alternatives you've considered

No response

Additional context

No response

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

2 participants