diff --git a/src/agenda_culturel/settings/base.py b/src/agenda_culturel/settings/base.py index c18f281..dcca4d4 100644 --- a/src/agenda_culturel/settings/base.py +++ b/src/agenda_culturel/settings/base.py @@ -1,4 +1,4 @@ -from os import getenv as os_getenv, path as os_path # noqa +from os import getenv as os_getenv, path as os_path # noqa from pathlib import Path from django.utils.translation import gettext_lazy as _ @@ -41,6 +41,7 @@ INSTALLED_APPS = [ 'django_extensions', 'django_better_admin_arrayfield', 'django_filters', + 'compressor', ] MIDDLEWARE = [ @@ -137,6 +138,12 @@ STATIC_ROOT = os_path.join(BASE_DIR, "static") MEDIA_URL = "media/" MEDIA_ROOT = os_path.join(BASE_DIR, "media") +STATICFILES_FINDERS = [ + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'compressor.finders.CompressorFinder' +] + # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field @@ -161,3 +168,8 @@ REDIS_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}" CELERY_BROKER_URL = REDIS_URL CELERY_RESULT_BACKEND = REDIS_URL + +# SCSS +COMPRESS_PRECOMPILERS = ( + ('text/x-scss', 'django_libsass.SassCompiler'), +) diff --git a/src/agenda_culturel/settings/production.py b/src/agenda_culturel/settings/production.py new file mode 100644 index 0000000..5befa23 --- /dev/null +++ b/src/agenda_culturel/settings/production.py @@ -0,0 +1,3 @@ +COMPRESS_OFFLINE = False +LIBSASS_OUTPUT_STYLE = 'compressed' +STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' diff --git a/src/agenda_culturel/static/css/style.css b/src/agenda_culturel/static/css/style.css deleted file mode 100644 index c440ffd..0000000 --- a/src/agenda_culturel/static/css/style.css +++ /dev/null @@ -1,142 +0,0 @@ -body { - font-family: 'Open Sans';font-size: 16px; -} - -#full_content>header { - padding-bottom: 1em; -} - -h1 a, h1 a:visited { - text-decoration: none; - color: #000; -} - -[role="doc-subtitle"] { - font-size: 140%; - margin-top: -1em; -} - -.nav-buttons { - padding: 0.6em 0; - font-weight: bold; -} - -.button { - box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.3); -} -.button:hover { - box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.2); -} - -.cat, .mode { - line-height: 2.4em; - box-sizing: border-box; - height: 2.4em; - margin: 0.2em; - padding: 0 1.4em; - border-radius: 1.2em; - text-decoration: none; - display: inline-block; - color: #000; -} - -span.cat, span.mode { - cursor: default; -} - -.mode { - background-color: rgb(230, 235, 235); -} - -a.mode:hover { - background-color: rgb(133, 136, 136); - color: #FFF; -} - -.mode.selected { - background-color: rgb(65, 67, 67); - color: #fff; -} - -.cat a.close { - text-decoration: none; - height: 1.6em; - width: 1.6em; - display: inline-block; - line-height: 1.6em; - background: #eee; - color: #000; - border-radius: 0.8em; - text-align: center; - font-weight: bold; - margin-left: 0.4em; - margin-right: -0.8em; -} -.cat a.close:hover { - background: #fff; -} - -.small-cat { - font-weight: bold; - text-decoration: none; - font-size: 80%; - display: inline-block; - padding: 0.1em 0.8em; - border-radius: .8em; -} - -.warning-simple { - font-style: italic; -} - -.warning { - background-color: rgb(230, 235, 235); - padding: 1em; - border-radius: 1.5em; -} - -.rich_button { - text-decoration: none; - display: inline-block; - background-color: rgb(230, 235, 235); - color: #000; - text-align: center; - border-radius: 1em; - line-height: 2em; - overflow: hidden; -} - - -.rich_button span { - display: inline-block; - height: 2em; - width: 2em; - font-weight: bold; - background-color: #008080; - color: #fff; - border-radius: 1em; - margin-left: 0.2em; - box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.3); -} - -.rich_button:hover { - background: rgb(133, 136, 136); - color: #fff; -} - -.rich_button:hover span { - background-color: rgb(1, 140, 140); -} - -#add_content_header, #edit_content_header { - font-size: 120%; - position: fixed; - top: 4em; - padding-left: 0.8em; - right: 2em; -} - -#edit_content_header { - top: 1.5em; -} - diff --git a/src/agenda_culturel/static/pico/_functions.scss b/src/agenda_culturel/static/pico/_functions.scss new file mode 100644 index 0000000..160870c --- /dev/null +++ b/src/agenda_culturel/static/pico/_functions.scss @@ -0,0 +1,4 @@ +// Output color in RGB format +@function to-rgb($color) { + @return unquote("rgb(#{red($color)}, #{green($color)}, #{blue($color)})"); +} \ No newline at end of file diff --git a/src/agenda_culturel/static/pico/_variables.scss b/src/agenda_culturel/static/pico/_variables.scss new file mode 100644 index 0000000..e2f653e --- /dev/null +++ b/src/agenda_culturel/static/pico/_variables.scss @@ -0,0 +1,69 @@ +// Config +// –––––––––––––––––––– + +// Set the root element for $enable-semantic-container and $enable-responsive-spacings +$semantic-root-element: "body" !default; + +// Enable
,
,