Comments (1)
Here's what I ended up doing in order to use Bulma's swatches & components, in case it helps anyone. Is there a better method?
Beginning with what's currently in the documentation:
pip install django-bulma
Add to settings.py: 'bulma',
Set up bulma & extensions:
python manage.py copy_bulma_static_into_project
python manage.py bulma install
Locate the directory with package.json
, in order for npm to install in the correct place:
cd …my_django_project/static/bulma/sass
npm install bulmaswatch bulma-extensions
python manage.py bulma start
My style.sass looks like:
// 1. Import the initial variables
@import "./node_modules/bulma/sass/utilities/initial-variables"
// 2. Set your own initial variables
@import './node_modules/bulmaswatch/simplex/_variables';
// 3. Import the rest of Bulma
@import "./node_modules/bulma/bulma"
// 4. Import your stuff here
@import './node_modules/bulma-extensions/bulma-carousel/src/sass/index';
@import './node_modules/bulmaswatch/simplex/_overrides';
And in the django template:
{% block css %}
<link rel="stylesheet" href="{% static 'bulma/css/font-awesome.min.css' %}">
<link rel="stylesheet" href="{% static 'bulma/css/style.css' %}">
{% block extra_css %}{% endblock extra_css %}
{% endblock css %}
…
{% block extra_javascript %}
<script type="text/javascript" src="{% static 'bulma/sass/node_modules/bulma-extensions/bulma-carousel/dist/js/bulma-carousel.min.js' %}"></script>
<script type="text/javascript">
var carousels = bulmaCarousel.attach(); // carousels now contains an array of all Carousel instances
</script>
{% endblock extra_javascript %}
from django-bulma.
Related Issues (20)
- Using bulma horizontal forms
- Possible conflict with AllAuth? HOT 2
- Email and file upload field not formatting – class name
- Don't overwrite user-defined widget classes in addclass filter
- Django 3 not support ? HOT 1
- lib folder not being copied HOT 3
- Customize input class using Bulma template rendering HOT 1
- shell=True in subprocess.run HOT 1
- Create a new release to the improvements already done HOT 1
- Bulma 0.8.1 and 0.8.2 released HOT 1
- templatetags HOT 1
- field.html label for HOT 1
- Why `{{ form|bulma }}` ? HOT 1
- python manage.py bulma start
- Use CDN instead serving css from server
- Bulma v0.9.3 released HOT 1
- Support for Django 4.0 HOT 1
- Error when executing "bulma start"
- Example App
- setuptools dependency missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-bulma.