Skip to content

Dark mode transition#288

Open
Kledis98 wants to merge 2 commits into
mainfrom
dark-mode-transition
Open

Dark mode transition#288
Kledis98 wants to merge 2 commits into
mainfrom
dark-mode-transition

Conversation

@Kledis98

Copy link
Copy Markdown
Collaborator

It is looking like this now.
Open to any suggestions!
Screencast from 30.9.23 10:34:53.MD CEST.webm

@AndiBraimllari

Copy link
Copy Markdown
Collaborator

Looks awesome! Well done.

<label class="dark-mode-label cursor-pointer">
<input
data-test="dark-mode-button-toggle-switch"
id="prova"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

></button>
</div>
<hr />
<br />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this removed for a reason?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because the transition in that area ( above ''Cilesimet'' ) was taking a bit more time, all the time.

@@ -1,3 +1,6 @@
*{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is added in some files, what if a new component is added, then the dark mode switch for that will not have a transition? Can we add this to a global styles file? Does it make sense to have it there? What do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point.
Maybe if a component or several ones might not need it, we can change the property of transition to none using a class for example.
It makes sense to be on global styles file.

Comment on lines +30 to +32
const styleTag = document.createElement('style');
styleTag.append(this.DARK_MODE)
document.body.append(styleTag);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Comment on lines +1 to +3
*{
transition: background-color 0.5s ease;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please check if there's a better way of doing the smooth dark mode transition? I'll also research this a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants