-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[regression/8.0.3] Order of priority between Styles.xaml and custom css has changed in .net 8 #18980
Copy link
Copy link
Closed
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorsmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/windowspotential-regressionThis issue described a possible regression on a currently supported version., verification pendingThis issue described a possible regression on a currently supported version., verification pendingt/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
After upgrading our project to .net 8 all of our custom css defined in a .css file and applied to a page/component is being overridden by the Style.xaml file. If the control exists in the Styles.xaml file then any css is ignored. If I remove the control type from the Styles.xaml file then the css works correctly.
Steps to Reproduce
- Create file -> new maui project
- Create Styles.css in /Resources/Styles
- Add record
.test{ background-color: yellow;}to Styles.css - Add StyleSheetExtension to MainPage.xaml
- Add new button with basic config and StyleClass="test"
- Run project and button will be default maui color
- Remove the Styles.xaml from the resource dictionary in App.xaml and re run the project, button will be yellow.
Link to public reproduction project repository
No response
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
Windows
Affected platform versions
Only tested on Windows 10
Did you find any workaround?
No no work around found
Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorsmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/windowspotential-regressionThis issue described a possible regression on a currently supported version., verification pendingThis issue described a possible regression on a currently supported version., verification pendingt/bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done