JSPM

darktheme

1.1.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q10355F
    • License ISC

    Get dark/light theme for your web projects

    Package Exports

    • darktheme

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (darktheme) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Get dark/light theme for your web projects

    1. Installation

    Goto terminal and install darktheme using command

    npm i darktheme

    Add class="darktheme" to our HTML file

    <body class="darktheme">
        This is dark theme!
    
       
        <script src="./index.js"></script>
    </body>
    

    2. Usage

    First import package in our JavaScript file (we can use require or import)

    using require

    const { darktheme } = require('darktheme');

    or

    using import

    import { darktheme } from 'darktheme';

    Then select a theme

    [dark background and white text color]

    darktheme({
       background_color: 'dark',
       color: 'light'
    });
    

    [light background and black text color]

    darktheme({
       background_color: 'light',
       color: 'dark'
    });
    

    3. Run

    we are going to use parcel

    npm i parcel -g

    parcel index.html