I recently launched the first production version of Halfmoon, a front-end framework that I have been building for the last few months. This is a short introductory post about what the framework is, and why I decided to build it.

The elevator pitch
Halfmoon is a front-end framework with a few interesting things going for it:
- Dark mode built right in: Creating a dark mode version of a site is baked in and a snap.
- Modular components: A lot of consideration has gone into making modular components — such as forms, navbars, sidebars, dropdowns, toasts, shortcuts, etc. — that can be used anywhere to make layouts, even complex ones like dashboards.
- JavaScript is optional: Many of the components found in Halfmoon are built to work without JavaScript. However, the framework still comes with a powerful JavaScript library with no extra dependencies.
- All the CSS classes you need: The class names should be instantly familiar to anyone who has used Bootstrap because that was the inspiration.
- Cross-browser compatibility: Halfmoon fully supports nearly every browser under the sun, including really old ones like Internet Explorer 11.
- Easily customizable: Halfmoon uses custom CSS properties for things like colors and layouts, making it extremely easy to customize things to your liking, even without a CSS preprocessor.
In many ways, you can think of Halfmoon as Bootstrap with an integrated dark mode implementation. It uses a lot of Bootstrap’s components with slightly altered markup in many cases.


OK, great, but why this framework?
Whenever a new framework is introduced, the same question is inevitably pops up: Why did you actually build this? The answer is that I freaking love dark modes and themes. Tools that come with both a light and a dark mode (along with a toggle switch) are my favorite because I feel that being able to change a theme on a whim makes me less likely to get bored looking at it for hours. I sometimes read in dim lighting conditions (pray for my eyes), and dark modes are significantly more comfortable in that type of situation.
Anyway, a few months ago, I wanted to build a simple tool for myself that makes dark mode implementation easy for a dashboard project I was working on. After doing some research, I concluded that I had only two viable options: either pickup a JavaScript-based component library for a front-end framework — like Vuetify for Vue — or shell out some cash for a premium dark theme for Bootstrap (and I did not like the look of the free ones). I did not want to use a component library because I like building simple server-rendered websites using Django. That’s just my cup of tea. Therefore, I built what I needed: a free, good-looking front-end framework that’s along the same lines as Bootstrap, but includes equally good-looking light and dark themes out of the box.
Future plans
I just wanted to share Halfmoon with you to let you know that it exists and is freely available if you happen to be looking for an extensible framework in the same vein as Bootstrap that prioritizes dark mode in the implementation.
And, as you might imagine, I’m still working on Halfmoon. In fact I have plenty of enhancements in mind:
- More components
- More customization options (using CSS variables)
- More examples and templates
- Better tooling
- Improved accessibility examples in the docs
- Vanilla JavaScript implementations of useful components, such as custom multi-select (think Select2, only without jQuery), data tables and form validators, among other things.
In short, the plan is to build a framework that is really useful when it comes to building complex dashboards, but is still great for building any website. The documentation for the framework can be found on the project’s website. The code is all open-source and licensed under MIT. You can also follow the project on GitHub. I’d love for you to check it out, leave feedback, open issues, or even contribute to it.
Best of Luck!
Thank you!
Nice mashallah, keep up the good work
I’ll use it for sure
Sounds amazing. Dark mode is indispensable to front end development these days. I will definitely give a test drive
Please add utilities like tailwind does
This is a nice job. I’m a person of dark mode at always when designing and using systems. Your work will really help level up the stress in integration of Javascript libraries. Good job.
I really like bootstrap but sometimes I think it could be more easy or simple to it in another way. You catched my attention and subscription, good luck!!
Thank you, the next update should be coming soon hopefully.
You should make it React JS friendly
Halfmoon is available as an npm package. You can install it in your React project and start from there. Please read the following docs: https://www.gethalfmoon.com/docs/download/#using-npm
I have found this ==> https://www.npmjs.com/package/react-dark-light-ui library. it has almost all components with utility customization, Dark / Light UI
Starred! I’ll give this a whirl for a python project I’m working on…
Awesome! Halfmoon’s documentation site is built with Django as well.
I’ve previously hacked this in bootstrap by recompiling a second theme via scss inside a darkmode wrapper class and jquerying it onto the body… Cheers for designing it in!
Thank you. Nice to know someone else had a similar idea.
I’m new to programming and totally inspired by all of css-tricks forums and totally a fan of dark mode. I can’t wait to npm i halfmoon and try it out! Thank you so much for putting in the hours and hard work to create this. Much appreciated.
Thank you, looking forward to seeing what people build with it.
Looks great… I’m gonna begin a project with that sweet dark mode
Awesome!
Is there a CDN available for ur framework or available for those who want to build with u??.
Wow, you built an entire framework in just a few months? It would have taken me a few months just to write documentation that’s as nice as yours. I really like that a lot of the components are pure HTMl and CSS with no Javascript, really shows your mastery of the browser features!
What did you use to create your documentation btw, it looks so well organized!
Thanks, the documentation took a long time to write. The documentation is made using Django on the backend, and Halfmoon on the frontend.
Nice! How do I test this out on vscode or while using django via pycharm?
Anyway to install and use the classes?
You can include Halfmoon using script tags and add it to your Django templates. If you add it to your base template, then all the other templates extending the base will also have Halfmoon loaded in them. Please see this link: https://www.gethalfmoon.com/docs/download/#cdn
I like your framework Very much! The dark mode is so sweet and natural that I can’t believe. Very nice job! I plan to use your framework in some projects, and I want an information: There will be a library for React?
Thank you. There are some devs who are working on React components for Halfmoon. However, that project is still in its infancy.
Very nice! Starred, following and excited to try it out!
Thank you!
I like the name better than bootstrap. I am definitely going to give it a try. Thumbs up
When I try to go to the website, it gets blocked by McAfee, saying there is malware on it. Github works, but I can’t get the documentation.
What’s up with the website?
That is really weird. The only third party scripts I have are Google Analytics, and Github Star Button. I am pretty sure there is some weird config with your virus guard that is causing this issue. Google marks the site as safe: https://transparencyreport.google.com/safe-browsing/search?url=www.gethalfmoon.com&hl=en
The issue has been fixed. It was incorrectly marked by McAfee.
I took a look at Halfmoon, and it looks promising. I might use it for my next projects. Best of luck !
Thank you.
Wow this is so interesting, when will the framework be available for use?
The first production version is already out: https://www.gethalfmoon.com/
Wow, Man supercool!
I love dark modes, I wanted some framework with dark modes. You got it thanks man. I have already started using it and I am loving it already.
Power to you, Man.
Thank you, looking forward to seeing what people build with it.
Nice. Framework! Dark mode love! Thank you for sharing…
I myself added the toggle switch, on a setting page…but also added a quick gesture instant night mode.
Thank you
We have developed a JavaScript alert library that is fully customizable and powerful with zero dependencies.
Please have a look and share your reviews.
https://quantumalert.cosmogic.com
this is what i actually wanted…..amazing css framework
Awesome! Its a good feeling to build something that people want.
I Love the darkmode man…good work
I tried Halfmoon yesterday. It’s brilliant! It was kinda annoying for me building dark modes from scratch every time and this came as a relief. I only wish more people are on it, coz there are plenty of plugins in VS Code for using bootstrap.
Wishing you all the best!
Thank you! And I also hope the ecosystem develops around it with more tools. All in due time I suppose.
Anyone using this with Microsoft asp.Net Core 3? Might save me some time! Setting up Bootstrap with Light and Dark and SASS is way too complex!
How does it work with Django? I really like it and use Django
The docs site is written using Django as well, so I would say it works pretty well. Probably the best way to use it in a Django project is with the CDN: https://www.gethalfmoon.com/docs/download/#cdn
Looks great… I’m gonna begin a project with that sweet dark mode
Nicee; Waiting for an update for this