I want to split my CSS into multiple files to match with each template and app. But the following problem keeps me baffled.
In the base.css of my base.html template, I have an element class button declared as following:
.button {
...
}
So, all buttons should follow this css.
In an app called table, in a template table_view.html that extends base.html
{% extends "base.html" %}
{% load static %}
{% block content %}
<link href="{% static 'css/table.css' %}" rel="stylesheet" />
...
<button class="btn-avail table">Table</button>
...
{% endblock %}
I have a different format for class btn-avail in table.css. But I could not get it to load and override the base format. If I change the class name to button (of base.css), it reflects the base format. Or if I place btn-avail in the base.css, then its format is correctly reflected.
In my settings.py, here is my static directory:
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
What am I doing wrong? Thanks.
Update: here is the folder structure for app table
table/static/css/table.css.
And the base.css sits here: project_root/static/css.