GithubHelp home page GithubHelp logo

Comments (6)

brc-dd avatar brc-dd commented on June 10, 2024 2

released __VITEPRESS__ in [email protected]

from devtools-next.

brc-dd avatar brc-dd commented on June 10, 2024 1

Maybe something like

/vitepress/i.test(document.querySelector('meta[name=generator]')?.content)

Ah, wait. It's not there in dev. I can add it probably there too. This will be the most straightforward way I guess. Or I can just define __VITEPRESS__ to be true there (similar to how vue does that). You can then do !!window.__VITEPRESS__. WDYT?

You can also do this:

!!document.getElementById('check-dark-mode')?.innerText.includes('vitepress-theme-appearance')

from devtools-next.

brc-dd avatar brc-dd commented on June 10, 2024

const mode = useColorMode({
initialValue: isDarkModel.value ? 'dark' : 'light',
onChanged: (value) => {
isDarkModel.value = value === 'dark'
},
})

This needs to be made configurable. VitePress uses storageKey: 'vitepress-theme-appearance' -- vueuse has 'vueuse-color-scheme' as default. Toggling theme via devtools UI still works fine though.

from devtools-next.

LoTwT avatar LoTwT commented on June 10, 2024

Hi, @brc-dd.
Is there a good way to detect if a site is powered by Vitepress, both in development and production?

from devtools-next.

LoTwT avatar LoTwT commented on June 10, 2024

Thank you. ♥️
I think adding __VITEPRESS__ is a good way. In the future, someone may benefit from it too.

from devtools-next.

alexzhang1030 avatar alexzhang1030 commented on June 10, 2024

As we discussed in #233, style isolation is intuitive for users. Therefore, we're closing this comment as 'not planned.' I prefer to develop a plugin for this function. Let's revisit this by reopening or creating a new feature request once the devtools have a mature plugin system. Thank you anyway 🫶.

from devtools-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.