Remove CSS transition

This commit is contained in:
Corentin 2021-04-02 15:44:56 +09:00
commit 722359e702
2 changed files with 8 additions and 9 deletions

View file

@ -185,7 +185,6 @@ svg
cursor: pointer; cursor: pointer;
padding: 4px; padding: 4px;
border-radius: 12px; border-radius: 12px;
transition-duration: 0.3s;
} }
.toggle:hover .toggle:hover

View file

@ -22,14 +22,14 @@ class MainComponent extends Component
componentDidMount() componentDidMount()
{ {
// Smooth color transitions (after rendering to avoid flash on reload) // Smooth color transitions (after rendering to avoid flash on reload)
setTimeout(() => { // setTimeout(() => {
const styleEl = document.head.getElementsByTagName('style')[0] // const styleEl = document.head.getElementsByTagName('style')[0]
document.head.appendChild(styleEl) // document.head.appendChild(styleEl)
const styleSheet = styleEl.sheet // const styleSheet = styleEl.sheet
styleSheet.insertRule( // styleSheet.insertRule(
'*, ::after, ::before { transition-property: background-color, color, fill; transition-duration: 1s;}') // '*, ::after, ::before { transition-property: background-color, color, fill; transition-duration: 1s;}')
}, // },
500) // 500)
} }
toggleTheme(checked) toggleTheme(checked)