Skip to content

avoid flash when switching to dark theme at devtools ui #908

@userquin

Description

@userquin

🆒 Your use case

When switching to dark theme from light and once the radial animation finish there is an small flash.

You can remove the flash adding fill: 'forwards', in the animate call here https://github.com/nuxt/devtools/blob/main/packages/devtools-ui-kit/src/components/NDarkToggle.vue#L58:

    document.documentElement.animate(
      {
        clipPath: isDark.value
          ? [...clipPath].reverse()
          : clipPath,
      },
      {
        duration: 400,
        easing: 'ease-in',
        fill: 'forwards', // <== ADD THIS NEW OPTION
        pseudoElement: isDark.value
          ? '::view-transition-old(root)'
          : '::view-transition-new(root)',
      },
    )

🆕 The solution you'd like

no flash

🔍 Alternatives you've considered

No response

ℹ️ Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions