简体   繁体   中英

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.

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 %}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM