All Styles don't work.
See original GitHub issueCode built on Microsoft Visual Studio Community 2019 Version 16.8.4
Describe the bug All Styles don’t work.
To Reproduce Steps to reproduce the behavior:
- Create a new Avalonia Empty project
- Add code to MainWindow.axaml
<Window.Styles>
<Style Selector="Button:pointerover">
<Setter Property="Background" Value="Red"/>
</Style>
<Style Selector="TextBox:focus /template/ Border#border">
<Setter Property="BorderBrush" Value="Red" />
</Style>
<Style Selector="TextBox:pointerover /template/ Border#border">
<Setter Property="BorderBrush" Value="Red"/>
</Style>
</Window.Styles>
<StackPanel>
<Button Content="Test" />
<TextBox Text="Some text" />
</StackPanel>
- Build the project
- Start the project
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why is my CSS style not being applied?
Clear the cache and cookies and restart the browser .As the style is not suppose to change frequently for a website browser kinda...
Read more >Help! My CSS Isn't Working!
Upon encountering a problem, the first impulse is often to wonder if the styles are correctly written. Fortunately, there are a number of...
Read more >Troubleshooting CSS
This tutorial will walk through options to troubleshoot why your CSS is not working and offer possible solutions. In This Article.
Read more >Dynamic styles don't work with styled components and ...
When trying to use dynamic styles through props and styled components the styles that were supposed to be applied don't work.
Read more >Editor styles don't work
Hey all,. Has anyone had any luck getting styles applied to your block previews in the WordPress editor? I've tried all 3 file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Why Button doesn’t work: ContentPresenter inside of template changes background, not the whole button. This behavior is by design, otherwise it would break expected from WPF behavior. See https://github.com/AvaloniaUI/Avalonia/pull/2662#issuecomment-515764732 and related PR.
Why TextBox doesn’t work: There is no Border with name “border” in Fluent theme - https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
Fixed styles:
For those who don’t want their TextBox appearance change when focus changes(maybe you are making onscreen keyboard as me):