Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

bootswatch

> 前端框架
Open source

Themes for Bootstrap

14.7K stars0 likes3 views
WebsiteGitHub

About

Themes for Bootstrap

Bootswatch

A collection of open source themes for Bootstrap
View Bootswatch themes »

Report bug · Request feature · Blog

Usage

There are a few different ways you can integrate Bootswatch into your project.

Via Pre-compiled Asset

Download the bootstrap.min.css file associated with a theme and replace Bootstrap's default stylesheet. You must still include Bootstrap's JavaScript file to have functional dropdowns, modals, etc.

Via CDN

You can use the themes via CDN at jsDelivr.

Via Sass Imports

If you're using Sass (SCSS) in your project, you can import the _variables.scss and _bootswatch.scss files for a given theme. This method allows you to override theme variables.

scss
// Your variable overrides go here, e.g.:
// $h1-font-size: 3rem;

@import "~bootswatch/dist/[theme]/variables";
@import "~bootstrap/scss/bootstrap";
@import "~bootswatch/dist/[theme]/bootswatch";

Make sure to import Bootstrap's bootstrap.scss in between _variables.scss and _bootswatch.scss!

Via npm

You can install as a package with the command npm install bootswatch.

React Users (create-react-app, or similar bundler)

Modern JavaScript bundlers (webpack, parcel, rollup) support importing CSS from JS files. This can make it easier to deploy various 1st and 3rd party assets predictably. Note: There are tradeoffs to the following method, research your tooling before deploying to production.

Before continuing, ensure you've run npm install bootswatch in your local project folder. (Use either npm or yarn.)

Add the following import to your top-level index.js (or App.js) file. Add it before any other .css imports.

javascript
import "bootswatch/dist/[theme]/bootstrap.min.css";
// TODO: Note: Replace ^[theme]^ (examples: darkly, slate, cosmo, spacelab, and superhero. See https://bootswatch.com for current theme names.)

Here's an example of updated imports in App.js to use "slate" theme (using a create-react-app fresh project.)

javascript
import React from 'react';
import logo from './logo.svg';
import 'bootswatch/dist/slate/bootstrap.min.css'; // Added this :boom:
import './App.css';

function App() {
...

Via Ruby Gem

In your Ruby project, you can access the latest version of each theme by adding the following to your Gemfile and running bundle install:

ruby
gem "bootswatch", github: "thomaspark/bootswatch"

Each theme directory is then accessible via the path "#{Gem.loaded_specs["bootswatch"].load_paths.first}/[theme]".

Ruby on Rails users can add the following to an initializer (e.g. config/initializers/bootswatch.rb):

ruby
Rails.application.config.assets.paths += Gem.loaded_specs["bootswatch"].load_paths

And thus be able to import themes via Sass like so:

scss
@import "[theme]/variables";
@import "~bootstrap/scss/bootstrap";
@import "[theme]/bootswatch";

Via API

A simple JSON API is available for integrating your platform with Bootswatch. More info can be found on the Help page.

Customization

Bootswatch is open source and you’re welcome to modify the themes.

Each theme consists of two SASS files. _variables.scss, which is included by default in Bootstrap, allows you to customize the settings. _bootswatch.scss introduces more extensive structural changes.

Check out the Help page for more details on building your own theme.

Contributing

It's through your contributions that Bootswatch will continue to improve. You can contribute in several ways:

  • Issues: Provide a detailed report of any bugs you encounter and open an issue on GitHub.

  • Documentation: If you'd like to fix a typo or beef up the docs, you can fork the project, make your changes, and submit a pull request.

  • Code: Make a fix and submit it as a pull request. When making changes, it's important to keep the CSS and SASS versions in sync. To do this, be sure to edit the SASS source files for the particular theme first, then run the tasks grunt swatch to build the CSS.

  • Donation: Donations are gratefully accepted via GitHub and PayPal.

Author

Thomas Park

  • https://github.com/thomaspark
  • https://thomaspark.co/

Thanks

  • Mark Otto and Jacob Thornton for Bootstrap.
  • XhmikosR for ongoing maintenance support.
  • Jenil Gogari for his contributions to the Flatly theme.
  • James Taylor for cors-lite.
  • Corey Sewell for SASS conversion.

Copyright and License

Copyright 2014-2023 Thomas Park

Code released under the MIT License.

Issues· 71 open

View all issuesOpen on GitHub
  • #1355

    [dark mode] Several themes hardcode direct CSS properties that bypass Bootstrap 5.3's dark mode variable remapping

    Updated Jul 16, 2026
  • #1354

    How to get the HTML+SRI on jsDelivr hosted theme other than Cerulean?

    Updated Jun 6, 2026
  • #1351

    will you support v6 too?

    Updated Apr 6, 2026
  • #1324

    Compiler can't work with google font link (material theme)

    Updated Mar 12, 2026
  • #1349

    Better support for dark mode

    Updated Jan 8, 2026
  • #1346

    Validation messages should not appear when the input field is empty

    Updated Nov 24, 2025
  • #1344

    Brite: unreadable nav-link text with prefers-color-scheme: dark

    Updated Nov 7, 2025
  • #1274

    5.3.1 Superhero primary color

    Updated Sep 23, 2025
  • #1337

    Regarding the styles of input and textarea elements for certain themes in dark mode

    Updated May 23, 2025
  • #1335

    Minor issue: wrong (old) version 5.3.5 y Brite CSS files for version 5.3.6

    Updated May 15, 2025

> Tags

JavaScriptbootstrapbootswatchcsscss-framework

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架