bug: Progress bar doesn't use theme colors
See original GitHub issueBug Report
Ionic version:
[x] 4.x
Current behavior:
Using an ion-progress-bar
with a dark theme results in a white progress bar.
Expected behavior:
Progress bar would pick up the theme colors.
Steps to reproduce:
- Create an app with a progress bar
- Use the dark theme
- Progress bar is a white strip
Related code: I had to do the following to fix it:
ion-progress-bar {
--buffer-background: var(--ion-background-color);
--background: var(--ion-background-color);
--progress-background: var(--ion-color-step-400);
}
It seems like that should be the default.
Ionic info:
Ionic:
Ionic CLI : 5.4.12
Ionic Framework : @ionic/react 4.11.6
Capacitor:
Capacitor CLI : 1.2.1
@capacitor/core : 1.3.0
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v12.11.0
npm : 6.13.4
OS : macOS Mojave
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top Results From Across the Web
bug: Progress bar doesn't use theme colors · Issue #20098
Expected behavior: Progress bar would pick up the theme colors. Steps to reproduce: Create an app with a progress bar; Use the dark...
Read more >Reading Progress Bar is not work with colors others than the ...
Hi, I enabled the reading progress bar for my blogs. Previously I used this using the default Green colour. Now, I changed to...
Read more >Bug when using theme on a progress bar - Watch Face Studio
it happens only when theme colors are applied (if it only has one default color, then it appears correctly on the watch); it...
Read more >Can you apply a theme color to a Progress Bar? : r/DearPyGui
Is it possible to change the color of progress bars either using themes or with a different method? 2.
Read more >Angular material progress bar not loading primary color from ...
there is no error in the console. I inspected the element and I can see the button css from node_modules/@angular/material/_theming.
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 FreeTop 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
Top GitHub Comments
Ok, I found a solution and will create a pull-request soon. It works with a wrapper for the circles buffer bar. It’s moved by absolute position
left
and overflow hidden. Tested with reversed bar and theme light / dark.This is not exactly right. It does not appearing as white. It is set to white (‘#fff’). See line 77 (code block below). It violates style conventions. Any idea is welcome. …
Here is the reason for the solid color.
https://github.com/ionic-team/ionic-framework/blob/0a765c7172d49211e94ca5f37ca6059a33844b40/core/src/components/progress-bar/progress-bar.scss#L74-L77
Changing to this:
Result:
But, this should not be the solution. Never use fixed colors. Use theme variables or fixed colors with semi transparent color which does not interfere the theme.
We need a dark mode for the test bench during development and in the docs. But back to this issue: Any suggestions? A spontaneous ideas: Use width and position for the buffer dots. So that the elements do not overlay. Or use a solid theme color. … I see that the
.buffer-circles
animation is based on position (translateX). This limits possible quick fixes like using width / scale. 🤔 Maybe with a wrapper overlay hidden? …