diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8ede3d52 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,37 @@ +default_language_version: + python: python3.9 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: check-case-conflict + - id: check-merge-conflict + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.263' + hooks: + - id: ruff + - repo: https://github.com/rtts/djhtml + rev: 'v2.0.0' + hooks: + - id: djhtml + entry: djhtml --tabwidth 2 + files: .*/templates/.*\.html$ + alias: autoformat + - repo: https://github.com/ambv/black + rev: 22.8.0 + hooks: + - id: black + - repo: local + hooks: + - id: rustywind + name: rustywind Tailwind CSS class linter + language: node + additional_dependencies: + - rustywind@0.16.0 + entry: rustywind + args: [ --write, templates ] + types_or: [ html ] diff --git a/frontend/styles.css b/frontend/styles.css index 55481e9b..bb37d346 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -9,7 +9,7 @@ } body { - @apply text-charcoal dark:text-white; + @apply text-slate/80 dark:text-white; @apply font-cairo; } h1 { @@ -41,20 +41,20 @@ } /* Forum style overrides */ textarea { - @apply w-full rounded bg-charcoal border border-slate; + @apply w-full rounded bg-white dark:bg-charcoal border border-slate; } input[type=email] { - @apply w-full rounded bg-charcoal border border-slate mt-3; + @apply w-full rounded bg-white dark:bg-charcoal border border-slate mt-3; } input[type=checkbox] { - @apply mr-3 rounded bg-charcoal border border-slate text-orange; + @apply mr-3 rounded bg-white dark:bg-charcoal border border-slate text-orange; } input[type=file] { - @apply block w-full px-3 py-1 text-base font-normal text-orange bg-clip-padding border border-solid border-slate rounded transition ease-in-out my-2; + @apply block w-full px-3 py-1 text-base text-slate dark:text-white font-normal text-orange bg-clip-padding border border-solid border-slate rounded transition ease-in-out my-2; } #signup_form input[type=email], #signup_form input[type=password]{ - @apply rounded bg-charcoal text-white border border-slate w-full; + @apply rounded bg-white dark:bg-charcoal text-slate dark:text-white border border-slate w-full; } #authpages #footerSignup { @apply hidden; diff --git a/package.json b/package.json index 1e26a8ea..a91f64a2 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "autoprefixer": "^10.4.12", "cssnano": "^5.1.14", "htmx": "^0.0.2", + "rustywind": "^0.16.0", "tailwindcss": "^3.2.1" } } diff --git a/pyproject.toml b/pyproject.toml index 9d7aba75..a2402520 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,3 +3,5 @@ fail-under = 100 quiet = false verbose = 2 whitelist-regex = ["test_.*"] +[tool.ruff] +line-length = 88 diff --git a/static/css/styles.css b/static/css/styles.css index 3ac530b2..30e8ea9c 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -587,8 +587,7 @@ select { } body { - --tw-text-opacity: 1; - color: rgb(23 42 52 / var(--tw-text-opacity)); + color: rgb(49 74 87 / 0.8); } .dark body { @@ -659,6 +658,11 @@ textarea { border-width: 1px; --tw-border-opacity: 1; border-color: rgb(49 74 87 / var(--tw-border-opacity)); + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.dark textarea { --tw-bg-opacity: 1; background-color: rgb(23 42 52 / var(--tw-bg-opacity)); } @@ -670,6 +674,11 @@ input[type=email] { border-width: 1px; --tw-border-opacity: 1; border-color: rgb(49 74 87 / var(--tw-border-opacity)); + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.dark input[type=email] { --tw-bg-opacity: 1; background-color: rgb(23 42 52 / var(--tw-bg-opacity)); } @@ -681,11 +690,16 @@ input[type=checkbox] { --tw-border-opacity: 1; border-color: rgb(49 74 87 / var(--tw-border-opacity)); --tw-bg-opacity: 1; - background-color: rgb(23 42 52 / var(--tw-bg-opacity)); + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); --tw-text-opacity: 1; color: rgb(255 159 0 / var(--tw-text-opacity)); } +.dark input[type=checkbox] { + --tw-bg-opacity: 1; + background-color: rgb(23 42 52 / var(--tw-bg-opacity)); +} + input[type=file] { margin-top: 0.5rem; margin-bottom: 0.5rem; @@ -704,6 +718,7 @@ input[type=file] { font-size: 1rem; line-height: 1.5rem; font-weight: 400; + color: rgb(49 74 87 / var(--tw-text-opacity)); --tw-text-opacity: 1; color: rgb(255 159 0 / var(--tw-text-opacity)); transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; @@ -713,6 +728,11 @@ input[type=file] { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } +.dark input[type=file] { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + #signup_form input[type=email], #signup_form input[type=password] { width: 100%; @@ -721,6 +741,14 @@ input[type=file] { --tw-border-opacity: 1; border-color: rgb(49 74 87 / var(--tw-border-opacity)); --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgb(49 74 87 / var(--tw-text-opacity)); +} + +.dark #signup_form input[type=email],.dark + #signup_form input[type=password] { + --tw-bg-opacity: 1; background-color: rgb(23 42 52 / var(--tw-bg-opacity)); --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); @@ -999,16 +1027,16 @@ input[type=file] { margin: 0px; } -.mx-auto { - margin-left: auto; - margin-right: auto; -} - .my-8 { margin-top: 2rem; margin-bottom: 2rem; } +.mx-auto { + margin-left: auto; + margin-right: auto; +} + .my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; @@ -1099,10 +1127,6 @@ input[type=file] { margin-top: 1.25rem; } -.mt-1 { - margin-top: 0.25rem; -} - .mb-3 { margin-bottom: 0.75rem; } @@ -1131,6 +1155,10 @@ input[type=file] { margin-right: 0.75rem; } +.mt-1 { + margin-top: 0.25rem; +} + .mt-0 { margin-top: 0px; } @@ -1613,6 +1641,11 @@ input[type=file] { border-bottom-width: calc(1px * var(--tw-divide-y-reverse)); } +.divide-gray-200 > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-divide-opacity)); +} + .divide-slate > :not([hidden]) ~ :not([hidden]) { --tw-divide-opacity: 1; border-color: rgb(49 74 87 / var(--tw-divide-opacity)); @@ -1740,6 +1773,21 @@ input[type=file] { border-color: rgb(90 213 153 / 0.4); } +.border-gray-600 { + --tw-border-opacity: 1; + border-color: rgb(75 85 99 / var(--tw-border-opacity)); +} + +.border-gray-500 { + --tw-border-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-border-opacity)); +} + +.border-gray-400 { + --tw-border-opacity: 1; + border-color: rgb(156 163 175 / var(--tw-border-opacity)); +} + .bg-red-600 { --tw-bg-opacity: 1; background-color: rgb(220 38 38 / var(--tw-bg-opacity)); @@ -1759,6 +1807,11 @@ input[type=file] { background-color: rgb(255 159 0 / var(--tw-bg-opacity)); } +.bg-gray-300 { + --tw-bg-opacity: 1; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)); +} + .bg-green\/10 { background-color: rgb(90 213 153 / 0.1); } @@ -1790,9 +1843,12 @@ input[type=file] { background-color: transparent; } -.bg-slate { - --tw-bg-opacity: 1; - background-color: rgb(49 74 87 / var(--tw-bg-opacity)); +.bg-green\/30 { + background-color: rgb(90 213 153 / 0.3); +} + +.bg-green\/20 { + background-color: rgb(90 213 153 / 0.2); } .bg-opacity-70 { @@ -1961,6 +2017,10 @@ input[type=file] { padding-right: 0.5rem; } +.pl-2 { + padding-left: 0.5rem; +} + .pb-3 { padding-bottom: 0.75rem; } @@ -2013,10 +2073,6 @@ input[type=file] { padding-left: 1.5rem; } -.pl-2 { - padding-left: 0.5rem; -} - .pb-2 { padding-bottom: 0.5rem; } @@ -2194,10 +2250,6 @@ input[type=file] { color: rgb(255 255 255 / 0.6); } -.text-white\/70 { - color: rgb(255 255 255 / 0.7); -} - .text-slate\/80 { color: rgb(49 74 87 / 0.8); } @@ -2252,6 +2304,10 @@ input[type=file] { color: rgb(181 201 211 / var(--tw-text-opacity)); } +.text-white\/70 { + color: rgb(255 255 255 / 0.7); +} + .text-gray-200 { --tw-text-opacity: 1; color: rgb(229 231 235 / var(--tw-text-opacity)); @@ -2426,6 +2482,11 @@ input[type=file] { display: none; } +.dark .dark\:divide-slate > :not([hidden]) ~ :not([hidden]) { + --tw-divide-opacity: 1; + border-color: rgb(49 74 87 / var(--tw-divide-opacity)); +} + .dark .dark\:border-slate { --tw-border-opacity: 1; border-color: rgb(49 74 87 / var(--tw-border-opacity)); @@ -2441,6 +2502,15 @@ input[type=file] { background-color: rgb(23 42 52 / var(--tw-bg-opacity)); } +.dark .dark\:bg-slate { + --tw-bg-opacity: 1; + background-color: rgb(49 74 87 / var(--tw-bg-opacity)); +} + +.dark .dark\:bg-green\/10 { + background-color: rgb(90 213 153 / 0.1); +} + .dark .dark\:font-medium { font-weight: 500; } @@ -2450,6 +2520,15 @@ input[type=file] { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.dark .dark\:text-orange { + --tw-text-opacity: 1; + color: rgb(255 159 0 / var(--tw-text-opacity)); +} + +.dark .dark\:text-white\/70 { + color: rgb(255 255 255 / 0.7); +} + .dark .dark\:text-white\/50 { color: rgb(255 255 255 / 0.5); } @@ -2486,11 +2565,6 @@ input[type=file] { color: rgb(147 197 253 / 0.6); } -.dark .dark\:text-orange { - --tw-text-opacity: 1; - color: rgb(255 159 0 / var(--tw-text-opacity)); -} - .dark .dark\:ring-gray-500 { --tw-ring-opacity: 1; --tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity)); @@ -2616,14 +2690,14 @@ input[type=file] { margin-top: 0.75rem; } - .md\:mb-11 { - margin-bottom: 2.75rem; - } - .md\:mt-5 { margin-top: 1.25rem; } + .md\:mb-11 { + margin-bottom: 2.75rem; + } + .md\:mt-8 { margin-top: 2rem; } @@ -2740,18 +2814,18 @@ input[type=file] { justify-content: space-between; } - .md\:space-x-4 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(1rem * var(--tw-space-x-reverse)); - margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); - } - .md\:space-y-0 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(0px * var(--tw-space-y-reverse)); } + .md\:space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1rem * var(--tw-space-x-reverse)); + margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); + } + .md\:space-x-6 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(1.5rem * var(--tw-space-x-reverse)); diff --git a/templates/404.html b/templates/404.html index e5193805..2d937eea 100644 --- a/templates/404.html +++ b/templates/404.html @@ -3,12 +3,12 @@ {% block title %}Page Not Found{% endblock %} {% block content_wrapper %} -
-

404 - Page Not Found

+
+

404 - Page Not Found

-
+

The page you requested was not found on this site.

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/500.html b/templates/500.html index 851bfa6b..5cf05d80 100644 --- a/templates/500.html +++ b/templates/500.html @@ -3,12 +3,12 @@ {% block title %}Server Error{% endblock %} {% block content_wrapper %} -
-

500 - Server Error

+
+

500 - Server Error

-
+

There was a problem building the page you requested.

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/account/login.html b/templates/account/login.html index 5df0436f..f892c49c 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -10,28 +10,28 @@ {% block content %} -
-
+
+
-
+

{% trans "Log In" %}

-
+
{% get_providers as socialaccount_providers %} {% if socialaccount_providers %} -

+

{% blocktrans with site.name as site_name %} - Log in with one of your existing third party accounts
or you can - {% else %} -

{% blocktrans %}If you have not created an account yet, then please +

{% blocktrans %}If you have not created an account yet, then please sign up first.{% endblocktrans %}

{% endif %}