Giter Club home page Giter Club logo

bulma-darkify's Introduction

Bulma Darkify ๐ŸŒ—

Add a touch of darkness to your Bulma-powered websites. This project allows you to embrace the dark side of web design while maintaining the sleekness of Bulma's UI framework. Say goodbye to bright lights and welcome the relaxing warmth of dark mode.

Features

  • Fully customizable dark mode support.
  • Ability to toggle between light and dark modes using the [data-theme] attribute.
  • Compatibile with your existing Bulma styles.

Getting Started

Installation

pnpm add -D bulma-darkify

or

npm install bulma-darkify --save-dev

or

yarn add -D bulma-darkify

Import

Full Import (Larger Bundle Size)

Include the provided SCSS file into your existing SASS/SCSS file:

@import "bulma/bulma";

// Import your own dark mode variables
@import "your-dark-mode-variables";
@import "bulma-darkify/bulma-darkify";

Modular Import (Smaller Bundle Size)

Include only the SCSS files that you need:

// Import the relevant Bulma files before importing from bulma-darkify
@import "bulma/sass/utilities/_all";
@import "bulma/sass/elements/button";

// Import your own dark mode variables
@import "your-dark-mode-variables";

// Import from bulma-darkify
@import "bulma-darkify/scss/utilities/_all";
@include color-mode(dark) {
    @import "bulma-darkify/scss/elements/button";
}

Use

To use the dark mode, add the data-theme attribute to your HTML tag. For example:

<html lang="en" data-theme="dark">

</html>

Toggle

To toggle between themes, simply change this attribute to light:

<html lang="en" data-theme="light">

</html>

Customization

This library does not come with predefined styles for dark mode. This means that you will need to define how you want the dark mode styles to appear. To do this, follow Bulma's guide on customization using SASS variables: https://bulma.io/documentation/customize/variables/.

Then, append your style names with -dark.

For example, to change a button's default background color in light mode, you would normally define a variable like:

$button-background-color: #YOUR-COLOR-HERE

For dark mode, you can change the button's background color by simply adding -dark to this variable name:

$button-background-color-dark: #YOUR-COLOR-HERE

Contributing

Contributions from the community are welcomed! If you encounter a bug, have a feature request, or want to enhance this library, please open a pull request

License

This project is under the MIT license. Feel free to use, modify, and distribute it as you please.


bulma-darkify's People

Contributors

aggarwal-h avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

 avatar

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.