question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Progress bar doesn't use theme colors

See original GitHub issue

Bug 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:

  1. Create an app with a progress bar
  2. Use the dark theme
  3. 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
domskecommented, Nov 24, 2020

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. fixed

1reaction
domskecommented, Nov 24, 2020

The progress bar background is actually using --buffer-background: rgba( 56,128,255 ,0.2); which is appearing as white, but it is a shade of the primary color.

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:

.progress-buffer-bar {
  background: var(--buffer-background);
}

Result:

demo-dark

demo-light

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? …

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found