SCSS structure
We are use 7-1 tire
scss
folder structure in our
template
And to compile the scss files we have used libsass
.
Follow the below given steps if you want to use scss for styling you site.
Step 1: Installing django-sass-processor
Install libsass
by using the below given command.
pip install libsass django-compressor django-sass-processor
step 2: Check Libsass
Make sure that it is installed using this command:
pip show libsass
Step 3: Configuration
After installing the package add it to the INSTALLED APPS in settings.py.
INSTALLED_APPS = [
...
...
'sass_processor',
]
And add configuration for STATICFILES_FINDERS in settings.py.
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'sass_processor.finders.CssFinder',
]
Now to store the compiled css files add STATIC_ROOT AND SASS_PROCESSOR_ROOT in settings.py. Change the file path as per your needs.
STATIC_ROOT = BASE_DIR / 'static'
SASS_PROCESSOR_ROOT = STATIC_ROOT
Step 4: Using Scss Files in html
We have now configured our project to use scss files, now where we add the link in html file, we have to add it in this way:
<link rel="stylesheet" type="text/css" href="{% sass_src 'assets/scss/style.scss' %}" />
- scss
- base
- components // all
components scss
- layout
- pages
- themes
- utils
- vendors // All plugins scss
folder and files here
- animate
- aos
- bootstrap
- button-builder
- calendar
- chartist
- data-table
- datatable-extension
- date-picker
- daterange-picker
- date-time-picker
- dropzone
- echart
- feather-icon
- flag-icon
- icoicon
- image-cropper
- jsgrid
- owltheme
- page-builder
- photoswipe
- prism
- range-slider
- rating
- scrollable
- scrollbar
- select2
- simple-mde
- sticky
- summernote
- svg-icon
- sweetalert2-master
- themify
- time-picker
- todo
- tour
- tree
- vector-map
- whether-icon
- animate
- base
If you want to add new scss
so you can add in _custom.scss
file
because we are update template
in future at that time you can take
update template easily
and use it
only one custom
scss file you need to put from your side
Intelligent customization using scss
You can change in assets/scss/utils/_variables.scss
file
Common settings
Variables set | Content |
---|---|
$theme-body-font-color: #2f2f3b; |
whole themplate body font color set here |
--font-color: #aaa3a0; |
whole themplate body font color set here |
For font family
$font-nunito: Nunito; |
set Body font family |
$font-roboto: Roboto; |
set second font family |
For main color settings
--primary-color: #308e87; |
All color template settings |
--secondary-color: #f39159; |
|
--success-color: #3eb95f; |
|
--info-color: #02a2b9; |
|
--warning-color: #ea9200; |
|
--danger-color: #e74b2b; |
|
--light-color: #f5f5f5; |
For sidebar settings
$sidebar-width: 253px; |
set sidebar width |
$mobile-sidebar-width: 240px; |
set mobile sidebar width |
$logo-shadow: 0px 4px 15px rgba(var(--black), 0.05); |
set logo shadow color |
$sidebar-shadow: 0px 4px 40px rgba(var(--black), 0.1); |
set sidebar shadow color |
For card settings
$card-padding: 20px; |
set common card spacing |
$card-border: 1px solid rgba(var(--light-gray),1); |
set card border |
$card-header-bg-color: rgba(var(--white),1); |
set card header background |
$card-box-shadow: 0 0 50px rgba(var(--black), 0.03); |
set card-box-shadow |