Skip to content

Commit

Permalink
Merge pull request #55 from basxsoftwareassociation/refactor/precompi…
Browse files Browse the repository at this point in the history
…led-css

Refactor/precompiled css
  • Loading branch information
saemideluxe authored Jul 5, 2021
2 parents 2e1a661 + 9b1a06c commit 8868089
Show file tree
Hide file tree
Showing 8 changed files with 18,731 additions and 26 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ locale:
checks:
black --check bread
flake8 bread

css:
sassc -I bread/static/design/carbon_design/scss/globals/scss/vendor/ bread/static/design/carbon_design/scss/styles.scss > bread/static/css/bread-main.css
sassc -s compressed -I bread/static/design/carbon_design/scss/globals/scss/vendor/ bread/static/design/carbon_design/scss/styles.scss > bread/static/css/bread-main.min.css

watch_css:
find bread/static/design/carbon_design/scss -name '*.scss' | entr sassc -I bread/static/design/carbon_design/scss/globals/scss/vendor/ bread/static/design/carbon_design/scss/styles.scss > bread/static/css/bread-main.css

1 change: 0 additions & 1 deletion bread/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

def bread_context(request):
ret = {
"OVERRIDE_STYLESHEET": getattr(settings, "OVERRIDE_STYLESHEET", None),
"headerlayout": layout.shell_header.ShellHeader(
hg.C("PLATFORMNAME"),
"",
Expand Down
16 changes: 1 addition & 15 deletions bread/settings/required.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

_third_party_apps = [
"django_extensions", # for developer friendliness
"guardian", # per-object permissions
Expand Down Expand Up @@ -77,8 +75,6 @@
],
},
}
# required to compile sass theme
COMPRESS_PRECOMPILERS = (("text/x-scss", "django_libsass.SassCompiler"),)
COMPRESS_OFFLINE_CONTEXT = "bread.context_processors.compress_offline_context"
COMPRESS_FILTERS = {
"css": [
Expand All @@ -87,15 +83,14 @@
],
"js": ["compressor.filters.jsmin.JSMinFilter"],
}
LIBSASS_OUTPUT_STYLE = "compressed"

# not sure why we need this
LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/"
# named urlpattern to redirect to if login is required
LOGIN_URL = "login"

# required for compressor (which is the base of the sass compiler)
# required for compressor
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
Expand Down Expand Up @@ -171,13 +166,4 @@
# This one should only be activated in production or in dev environments with celery ready to run
# HAYSTACK_SIGNAL_PROCESSOR = "celery_haystack.signals.CelerySignalProcessor"

# necessary because of some sass imports in the carbon vendor packages
ADDITIONAL_CARBON = "static/design/carbon_design/scss/globals/scss/vendor"
LIBSASS_ADDITIONAL_INCLUDE_PATHS = [
ADDITIONAL_CARBON, # search path when collectstatic has been called, used in production
os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))), ADDITIONAL_CARBON
), # search path in bread-package
]

SIMPLE_HISTORY_FILEFIELD_TO_CHARFIELD = True
Loading

0 comments on commit 8868089

Please sign in to comment.