Skip to content

how is that transition of the icons when choosing dark/light/auto mode? #51

Answered by WalterWoshid
fcno asked this question in Q&A
Discussion options

You must be logged in to vote

@fcno

I created a small codepen: https://codepen.io/walterwoshid/pen/yLpNxjW

I used Vue 2 and Tailwind CSS 2, I hope you are a little bit familiar with it.

Explanation - Vue:

Vue has a virtual dom, that means, every variable in the data object of the new Vue({}) object is synced with the html. I change a number, it automatically changes in the html. I can include it with {{ variable }} or :class="variable"

Explanation - HTML:

  • :class="{ class: condition } - This is a list with conditional classes. If the condition is true, the class is added to the class attribute, see bg-gray-800 & bg-gray-100
  • @click="method" - This executes a method in the methods object of the new Vue({}) object
  • Utilit…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by fcno
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants