randomdatascientist
randomdatascientist

Reputation: 611

Using a Bootstrap theme with Flask-Bootstrap

I'm new to UI web development with Flask and have tried some sample projects with Flask-Bootstrap. Is it possible to use a custom Bootstrap "theme" with Flask-Bootstrap? I'd like to use this theme for my website: https://github.com/kristopolous/BOOTSTRA.386

But because I'm relatively new to UI stuff/JS/CSS, I can't tell if it's possible to use the Bootstrap.386 theme with Flask-Bootstrap.

Can anyone with experience tell me this if this is technically feasible and maybe point me towards a tutorial or something where someone has done similar? I haven't had much luck with Googling.

Upvotes: 1

Views: 485

Answers (1)

Grey Li
Grey Li

Reputation: 12762

Flask-Bootstrap has a built-in base template with some pre-defined macros, you can rewrite the styles macro to use your own Bootstrap CCS files.

Suppose you have downloaded the Bootstrap theme file, it will contain the main CCS file called bootstrap.min.css. Put this file to your static folder. Then overwrite the styles macro in your base template to include it:

{% extends 'bootstrap/base.html' %}

{% block styles %}
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='path/to/your/bootstrap.min.css')}}">
{% endblock %}

Upvotes: 1

Related Questions