Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dark mode "flashing" when sorting by duration in light mode #545

Open
evgeni opened this issue Apr 29, 2024 · 2 comments
Open

dark mode "flashing" when sorting by duration in light mode #545

evgeni opened this issue Apr 29, 2024 · 2 comments
Labels
bug UI Related to the built-in user interface

Comments

@evgeni
Copy link

evgeni commented Apr 29, 2024

What is the issue ?

Screencast.from.2024-04-29.18-47-51.webm

What should be happening ?

No flashing.
Doesn't happen in darkmode

@dmsimard
Copy link
Contributor

Hi @evgeni and thanks for another good find.

I don't know the fix for this one yet but it likely resides within how we select and load the light or dark bootstrap theme within theme.js: https://github.com/ansible-community/ara/blob/master/ara/ui/static/js/theme.js

We load the css files:

{% static 'css/bootstrap.min.css' as ara_bootstrap %}
<link id="bootstrap-css" rel="stylesheet" href="{% static_url ara_bootstrap %}">
{% static 'css/pygments-dark.css' as ara_pygments_dark %}
<link id="pygments-dark-css" rel="stylesheet" href="{% static_url ara_pygments_dark %}" disabled>
{% static 'css/pygments-light.css' as ara_pygments_light %}
<link id="pygments-light-css" rel="stylesheet" href="{% static_url ara_pygments_light %}">

And then we use theme.js to select the theme here:

{% static 'js/theme.js' as theme_js_url %}
<script src="{% static_url theme_js_url %}"></script>

@dmsimard dmsimard added bug UI Related to the built-in user interface labels Apr 29, 2024
@dmsimard
Copy link
Contributor

twbs/bootstrap#37774 suggests that the javascript theme selection should run as early as possible (instead of at the end of the body like we are doing now) and made blocking in order to resolve or mitigate the issue.

I can look into this eventually if no one gets to it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug UI Related to the built-in user interface
Projects
None yet
Development

No branches or pull requests

2 participants