From 81c8bbe911a112bac06e7c45951196f7e4534173 Mon Sep 17 00:00:00 2001 From: Greg Newman Date: Thu, 27 Apr 2023 08:22:25 -0400 Subject: [PATCH 1/7] :art: not so dark font --- frontend/styles.css | 2 +- static/css/styles.css | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/styles.css b/frontend/styles.css index 55481e9b..10b7f29d 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 { diff --git a/static/css/styles.css b/static/css/styles.css index 3ac530b2..33d470ba 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 { From 0139d4af66177a581174904c1f97bcfb9b91e9ee Mon Sep 17 00:00:00 2001 From: Greg Newman Date: Fri, 28 Apr 2023 09:21:48 -0400 Subject: [PATCH 2/7] :hammer: adding rustywind --- package.json | 1 + yarn.lock | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) 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/yarn.lock b/yarn.lock index 5dd8417c..5704f688 100644 --- a/yarn.lock +++ b/yarn.lock @@ -75,6 +75,11 @@ acorn@^7.0.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +agent-base@5: + version "5.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" + integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== + alpinejs@^3.10.2: version "3.10.2" resolved "https://registry.yarnpkg.com/alpinejs/-/alpinejs-3.10.2.tgz#bf3a12b8c3793f346bc9794038bb6e09341600e4" @@ -286,6 +291,13 @@ csso@^4.2.0: dependencies: css-tree "^1.1.2" +debug@4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + defined@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.1.tgz#c0b9db27bfaffd95d6f61399419b893df0f91ebf" @@ -433,6 +445,14 @@ htmx@^0.0.2: resolved "https://registry.yarnpkg.com/htmx/-/htmx-0.0.2.tgz#790b3cd816b74f9f2648326e5f4f8a9b320f9fb0" integrity sha512-FfUo3ynRYr6Ra4vqmS4Nq9g47607FSmvHYCOuU8bvbW8s4kPMhAmCbMBjuW2cEZI6DauaFNZKinfgV91cc9Feg== +https-proxy-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" + integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== + dependencies: + agent-base "5" + debug "4" + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -517,6 +537,11 @@ minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" @@ -836,6 +861,11 @@ postcss@^8.4.17: picocolors "^1.0.0" source-map-js "^1.0.2" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -881,6 +911,14 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +rustywind@^0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/rustywind/-/rustywind-0.16.0.tgz#b3355c23e84949608119ed4bb7fad2832b70b4cd" + integrity sha512-V3Z8eSY7eVpA8y+6LKVv4l6ary9aVzxYBp5oCu1Nj40PKOivfnGureeDYI9wnSw/qO2DLLpPo90WKlkbJwr7MQ== + dependencies: + https-proxy-agent "^4.0.0" + proxy-from-env "^1.1.0" + source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" From 34a64a9ee24c322a50ff90c4fed377ae167743c4 Mon Sep 17 00:00:00 2001 From: Greg Newman Date: Fri, 28 Apr 2023 09:25:47 -0400 Subject: [PATCH 3/7] :hammer: Adding pre-commit Adds: * Ruff and a little config in pyproject.toml * djhtml * black * rustywind --- .pre-commit-config.yaml | 37 +++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 .pre-commit-config.yaml 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/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 From 057c16bb9fc2531769c185b43e2d9fd7cd4d13a6 Mon Sep 17 00:00:00 2001 From: Greg Newman Date: Fri, 28 Apr 2023 09:27:38 -0400 Subject: [PATCH 4/7] :art: cleaning up some home page styles First pass with rustywind is doing massive cleanup --- static/css/styles.css | 38 ++++-- templates/404.html | 8 +- templates/500.html | 8 +- templates/account/login.html | 20 ++-- templates/account/password_reset.html | 6 +- templates/account/signup.html | 16 +-- templates/base.html | 2 +- templates/board_base.html | 18 +-- templates/boost/about.html | 32 ++--- templates/boost/moderators.html | 12 +- templates/boost/people.html | 12 +- templates/boost/people_detail.html | 10 +- templates/docs_temp.html | 34 +++--- templates/donate/donate.html | 4 +- templates/forum/forum_detail.html | 26 ++--- templates/forum/forum_list.html | 104 ++++++++--------- templates/forum/index.html | 10 +- .../forum_attachments/attachment_formset.html | 6 +- .../forum_attachments/attachments_detail.html | 2 +- .../forum_polls/poll_detail.html | 2 +- .../forum_polls/poll_option_formset.html | 2 +- .../forum_polls/poll_results.html | 8 +- .../forum_polls/poll_vote_form.html | 10 +- .../partials/post_form.html | 6 +- .../partials/topic_detail_actions.html | 10 +- .../partials/topic_form.html | 24 ++-- templates/forum_conversation/post_create.html | 16 +-- templates/forum_conversation/post_update.html | 12 +- .../forum_conversation/topic_create.html | 8 +- .../forum_conversation/topic_detail.html | 22 ++-- templates/forum_conversation/topic_list.html | 32 ++--- .../forum_conversation/topic_update.html | 8 +- .../forum_member/forum_profile_detail.html | 20 ++-- templates/forum_member/topic_subscribe.html | 4 +- templates/forum_member/topic_unsubscribe.html | 4 +- .../moderation_queue/list.html | 2 +- templates/homepage.html | 108 ++++++++--------- templates/includes/_contact_form.html | 6 +- templates/includes/_footer.html | 34 +++--- templates/includes/_form_input.html | 8 +- templates/includes/_header.html | 58 ++++----- templates/libraries/_library_list_item.html | 12 +- templates/libraries/list.html | 6 +- templates/mailing_list/list.html | 2 +- templates/markdown_template.html | 2 +- templates/news/news_detail.html | 13 +-- templates/news/news_list.html | 56 ++++----- templates/partials/breadcrumb.html | 8 +- templates/partials/form_field.html | 2 +- templates/resources/resources.html | 78 ++++++------- templates/review/past_reviews.html | 110 +++++++++--------- templates/review/review_detail.html | 24 ++-- templates/review/review_form.html | 8 +- templates/review/review_process.html | 60 +++++----- templates/review/upcoming_reviews.html | 60 +++++----- templates/scratch.html | 31 +++-- templates/socialaccount/login.html | 4 +- templates/support/contact.html | 18 +-- templates/support/getting_started.html | 20 ++-- templates/support/support.html | 28 ++--- templates/users/_library.html | 2 +- templates/users/_library_version.html | 2 +- templates/users/photo_upload.html | 22 ++-- templates/users/profile.html | 30 ++--- .../versions/_past_version_list_item.html | 8 +- templates/versions/detail.html | 42 +++---- templates/versions/list.html | 18 +-- 67 files changed, 729 insertions(+), 709 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index 33d470ba..f8300e99 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1098,10 +1098,6 @@ input[type=file] { margin-top: 1.25rem; } -.mt-1 { - margin-top: 0.25rem; -} - .mb-3 { margin-bottom: 0.75rem; } @@ -1130,6 +1126,10 @@ input[type=file] { margin-right: 0.75rem; } +.mt-1 { + margin-top: 0.25rem; +} + .mt-0 { margin-top: 0px; } @@ -1612,6 +1612,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)); @@ -1758,6 +1763,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); } @@ -1794,6 +1804,11 @@ input[type=file] { background-color: rgb(49 74 87 / var(--tw-bg-opacity)); } +.bg-gray-500 { + --tw-bg-opacity: 1; + background-color: rgb(107 114 128 / var(--tw-bg-opacity)); +} + .bg-opacity-70 { --tw-bg-opacity: 0.7; } @@ -2425,6 +2440,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)); @@ -2449,6 +2469,11 @@ 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\/50 { color: rgb(255 255 255 / 0.5); } @@ -2485,11 +2510,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)); 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..49370e62 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -10,19 +10,19 @@ {% block content %} -
-
+
+
-
+

{% trans "Log In" %}

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

+

{% blocktrans with site.name as site_name %} {% 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 %}