Hello community!
XamlCSS enables developers to
- structure UI with xaml and
- style it with css.
Benefits
- No verbose style declarations (xml is very verbose)
- Simple values like numbers, colors, thickness,…
- Use of markup-extensions like
Binding
,StaticResource
andDynamicResource
- Full support for css-selectors:
- Custom, mergeable, semantic styles (aka css-classes) like “warning”, “important”, “default”, “primary”,…
- Styling based on hierarchy like
.warning Button {...}
(“if button in a warning, then…”) - Detects UI-structure changes (added/removed controls)
- Live designer-preview for WPF and UWP
- MIT license
Supported Platforms
XamlCSS is available on all xaml platforms
- WPF
- UWP
- Xamarin.Forms (Android, iOS, WinRT)
NuGet Packages
GitHub
Example: WPF-Designer + Css Code
Personal Note
This project is just at its beginning, but it’s more than a proof of concept - it works as expected although some features like triggers and viewstates are currently missing. But it shows what is possible even without native support from the frameworks.
It’s main goal is:
Show that css could definitely have its place in the xaml ecosystem!
If you like this project: Spread the word - maybe some time in the future Microsoft enables css in WPF, Xamarin.Forms and UWP natively!
David Rettenbacher