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: #051A1A; |
whole themplate body font color set here |
$theme-body-font-color: #051A1A; |
whole themplate body font color set here |
For font family
$font-Montserrat: 'Montserrat', sans-serif; |
set Body font family |
For main color settings
$primary-color: #006666; |
All color template settings |
$secondary-color: #FE6A49; |
|
$success-color: #00AC46; |
|
$info-color: #9560DD; |
|
$warning-color: #FFAE1A; |
|
$danger-color: #FE6A49; |
|
$light-color: #E6E9EB; |
|
For sidebar settings
$sidebar-width: 265px; |
set sidebar width |
$sidebar-background-color: $primary-color; |
set sidebar background color |
$sidebar-shadow: none; |
set sidebar shadow color |
$sidebar-overflow: auto; |
set sidebar overflow scroll |
$sidebar-z-index: 9; |
set sidebar z index |
For card settings
$card-padding: 20px; |
set common card spacing |
$card-margin-bottom: 25px; |
set common card outside spacing |
$card-border-color: 1px solid $light-gray; |
set card border |
$card-border-radious: 8px; |
set card border radius |
$card-box-shadow: 0px 9px 20px rgba(46, 35, 94, 0.07); |
set card box shadow |