Git Product home page Git Product logo

docsify-darklight-theme's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docsify-darklight-theme's Issues

Toggle button not working on mobile

Whenever I click darkmode toggle button, a new tab for git project opens. Maybe the reason for this is that toggle button is not properly aligned with github corner button.

Any way to remove github fork button or align toggle button ?

Need a "back to top" button

My pages is so longer, I hope have a button back to top. can you add a button on the right bottom,thank you!

Error with docsify option onlyCover=true

Hello,

The problem is that when I set the option "onlyCover" to true then docsify is in an infinite render loop.

In my opinion the plugin tries to set the theme switcher button on the cover but on the HTML page of the cover there is no hook for it. But now your script tries to find the HTML tag and use the property "setAttribute". Here it needs a check for NULL.

A Screenshot from the error

image

The content from the specified file

window.$docsify.plugins=[].concat((e,t)=>{let o={siteFont:"PT Sans",defaultTheme:"dark",codeFontFamily:"Roboto Mono, Monaco, courier, monospace",bodyFontSize:"17px",dark:{accent:"#42b983",toogleBackground:"#ffffff",background:"#091a28",toogleImage:"url(https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/icons/sun.svg)"},light:{accent:"#42b983",toogleBackground:"#091a28",background:"#ffffff",toogleImage:"url(https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/icons/moon.svg)"}};if(t.config.hasOwnProperty("darklightTheme")){for(var[r,d]of Object.entries(t.config.darklightTheme))"light"!==r&&"dark"!==r&&"defaultTheme"!==r&&(o[r]=d);for(var[r,d]of Object.entries(o))"light"!==r&&"dark"!==r&&(o[r]=d,document.documentElement.style.setProperty("--"+r,d));if(t.config.darklightTheme.hasOwnProperty("dark"))for(var[r,d]of Object.entries(t.config.darklightTheme.dark))o.dark[r]=d;if(t.config.darklightTheme.hasOwnProperty("light"))for(var[r,d]of Object.entries(t.config.darklightTheme.light))o.light[r]=d}else for(var[r,d]of Object.entries(o))"light"!==r&&"dark"!==r&&(o[r]=d,document.documentElement.style.setProperty("--"+r,d));window.matchMedia("(prefers-color-scheme: dark)").matches?o.defaultTheme="dark":window.matchMedia("(prefers-color-scheme: light)").matches&&(o.defaultTheme="light");var i=e=>{if(document.getElementById("docsify-darklight-theme").setAttribute("data-link-title",e),document.getElementById("docsify-darklight-theme").click(),localStorage.setItem("DARK_LIGHT_THEME",e),o.defaultTheme=e,"light"==e)for(var[t,r]of Object.entries(o.light))document.documentElement.style.setProperty("--"+t,r);else if("dark"==e)for(var[t,r]of Object.entries(o.dark))document.documentElement.style.setProperty("--"+t,r)};e.afterEach((function(e,t){t(e='<div id="docsify-darklight-theme"><p>.</p></div>'+e)})),e.doneEach((function(){let e=localStorage.getItem("DARK_LIGHT_THEME");"light"==e||"dark"==e?(o.defaultTheme=e,i(o.defaultTheme)):i(o.defaultTheme),document.getElementById("docsify-darklight-theme").addEventListener("click",(function(){"light"===o.defaultTheme?i("dark"):i("light")}))}))},window.$docsify.plugins);

Duplicate header with `autoHeader` and `loadSidebar` set to true

I found that there’s an odd bug with docsify-darklight-theme plugin, whether it’s used with or without docsify-themeable.

If you setup a raw docsify project:

npx docsify init ./test-docs

And edit docsify’s options in index.html:

window.$docsify = {
  loadSidebar: true,
  autoHeader: true
}

Then create the following _sidebar.md:

- [Title 1](/autotitle.md)
- [Title 2](/customtitle.md)

With the following pages:

autotitle.md

This page has an auto-generated title.

customtitle.md

# My custom title

This page has a custom title.

When loaded, the autotitle.md will have an auto-generated title matching its link text from _sidebar.md.

auto-title-default

When loaded, the customtitle.md will keep its custom title.

custom-title-default


However, after docsify-darklight-theme setup, the customtitle.md will have two main titles:

  • the one from the sidebar
  • the one from its content

custom-title-darklight

I find this behavior very strange and can’t understand where it’s coming from… I heavily rely on the default behavior in order to have short links in my sidebar with more detailed page titles.

For now, I will disable the autoHeader feature and manually provide page titles, but I’d really like to use the default behavior with docsify-darklight-theme… If you could look into this, it would be greatly appreciated!

Thanks 🙂

Is there a way to skip a particular element?

Hello. I'm currently using docsify with mermaid.

When turning dark mode on, mermaid diagrams are not readable since they get completely dark

Is there a way to tell the theme to skip certain elements so the diagram color doesn't get changed?

how to hide the scroll bar

the default scroll bar is so wide, how to hide it or set the with is 0

especial in dark mode, the scroll bar is ugly

Different image for dark-mode

Is it possible to load different image in markdown based on dark/light mode ? (ie. one logo for light mode, another logo for dark mode) ?

Redesigned search box not appearing

I've been trying to get the Redesigned search box to work but I can only see the old search box.
I wonder if I have any conflicts in the css below? Perhaps there's something I need to add in <script></script>?

<html lang="en">
<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, shrink-to-fit=no, viewport-fit=cover">
   <meta name="description" content="">
   <title>UN*Xity</title>

   <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@3/dist/docsify-themeable/style.min.css" type="text/css">

   <!-- docsify-themeable styles-->
   <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css" title="light">
   <link rel="stylesheet alternative" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css" title="dark">

   <!-- Themes (light + dark) -->
   <!-- <link rel="stylesheet" media="(prefers-color-scheme: dark)" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css"> -->
   <!-- <link rel="stylesheet" media="(prefers-color-scheme: light)" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css"> -->

   <!-- Custom Styles -->
   <style>
     :root {
       /* --theme-hue: 325; */
     }
   </style>
</head>
<body>
   <div id="app"></div>

   <script>
     // Docsify Configuration
     window.$docsify = {
        name: 'UN*Xity',
        loadSidebar: true,
        coverpage: true,
        coverpage: '_coverpage.md',
        onlyCover: false
     };
   </script>

   <!-- Required -->
   <script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js"></script>
   <!-- <script src="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js"></script> -->

   <!-- Plugins -->
   <script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.js"></script>
   <script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
   <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

  <script type="module">
    import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
    mermaid.initialize({ startOnLoad: true });
    window.mermaid = mermaid;
  </script>
  <script src="//unpkg.com/[email protected]/dist/docsify-mermaid.js"></script>


<script
    src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@3/dist/docsify-themeable/main.min.js"
    type="text/javascript">
</script>

<script
    src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@3/dist/docsify-themeable/index.min.js"
    type="text/javascript">
</script>


</body>
</html>

White screen flicker issue in dark mode

To reproduce do a hard refresh or continuously refresh for >2s.
This is caused since we cannot set the CSS attributes based on the theme (stored in local storage) before the DOM being rendered. Have attached a sample video for reference.

In docsify-themeable this has been handled and they can set the previously stored theme. Let me know if you have any possible solution for this issue am happy to contribute as well. Thanks.

Screen.Recording.2023-02-14.at.4.43.56.PM.online-video-cutter.com.mp4

Use `npx` to generate files

The current method of installation requires that we setup a package.json and install this package, it would be better to setup npx to do the codegen instead.

Can I move the trigger icon for changing the theme

Thank you for the theme. I want to add the icon to the navbar, so I tried moving it as shown below. However it gets recreated somehow in the original position, with the result that there are now two icons, and neither can trigger.

Is there any way to move the icon safely?

         hook.doneEach(function() {
			const darkLightLink = document.querySelector("#docsify-darklight-theme");
			const fred = document.getElementsByClassName("app-nav")[0].appendChild(darkLightLink); //
			darkLightLink.style.display = 'inline-block';
			darkLightLink.style.position = 'relative';
			darkLightLink.style.top = '15px';
          });

Support themeability for switch icons

Right now the icons are fetched from jsdeliver, there doesn't seem to be an option to overide them. Could the switch just change its class so that custom css can be applied?

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.