Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove css-scope-inline #40

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ We use:
We spend all our hipster tech tokens for this project to help us build a front-end directly in Django-land. In particular, we use:

- [HTMX](https://htmx.org/) with [django-htmx](https://github.com/adamchainz/django-htmx)
- [css-scope-inline](https://github.com/gnat/css-scope-inline)
- [htpy](https://htpy.dev/) for HTML building, rather than Django templates (with a small handful of exceptions).

Having never used any of these toys before, we'll see how this pans out.
So far, I'm liking both. For projects like this one, HTMX is a keeper. `htpy` has its advantages and its frictions; I'm reminded of javascript templating land just before JSX got introduced.

(Update: HTMX is a keeper. It seems to pair nicely with web components. I'm finding `htpy` preferable to Django templates for this particular project, but there's definitely some friction here; I'm reminded of the frictions of javascript templating land just before JSX got introduced. And `css-scope-inline` is not worth the trouble; I intend to rip it out when I get a chance.)

(Other hipster tools under consideration included [surreal](https://github.com/gnat/surreal?tab=readme-ov-file), [django-slippers](https://github.com/mixxorz/slippers), [django-template-partials](https://github.com/carltongibson/django-template-partials), and [django-components](https://github.com/EmilStenstrom/django-components). All of these attempt to ameliorate pain points in Django's built-in templates but I'm not convinced they're terribly successful. And don't forget the [django-htmx-patterns](https://github.com/spookylukey/django-htmx-patterns/) documentation.)
(Other hipster tools under consideration included [css-scope-inline](https://github.com/gnat/css-scope-inline) and [surreal](https://github.com/gnat/surreal?tab=readme-ov-file) for "locality of behavior", none of which turned out to be particularly desirable in practice; [django-slippers](https://github.com/mixxorz/slippers), [django-template-partials](https://github.com/carltongibson/django-template-partials), and [django-components](https://github.com/EmilStenstrom/django-components), all of which attempt to relieve pain points in Django's built-in templates but none of which seem terribly successful at it; and various bits of wisdom from [django-htmx-patterns](https://github.com/spookylukey/django-htmx-patterns/).)

For code cleanliness, we also use:

Expand Down
56 changes: 56 additions & 0 deletions server/static/css/admin_extra.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,60 @@
/** Don't show inline item names; it's visual clutter. */
.tabular.inline-related td.original p {
visibility: hidden
}



/**---------------------------------
* Logo Specimen (Django admin view)
*---------------------------------*/

logo-specimen {
display: flex;
gap: 0.5rem;
}

logo-specimen .bubble {
display: flex;
align-items: center;
overflow: hidden;
width: 48px;
height: 48px;
background-color: var(--logo-bg-color);
}

logo-specimen .bubble img {
display: block;
margin: 0 auto;
max-width: 80%;
max-height: 80%;
}

logo-specimen .bg {
display: flex;
font-weight: 600;
align-items: center;
justify-content: center;
padding-left: 0.5rem;
padding-right: 0.5rem;
background-color: var(--logo-bg-color);
color: var(--logo-bg-text-color);
}

logo-specimen .action {
cursor: pointer;
display: flex;
font-weight: 600;
align-items: center;
justify-content: center;
padding-left: 0.5rem;
padding-right: 0.5rem;
transition: opacity 0.2s;
background-color: var(--logo-action-color);
color: var(--logo-action-text-color);
}

logo-specimen .action:hover {
opacity: 0.7;
transition: opacity 0.2s ease-in-out;
}
69 changes: 0 additions & 69 deletions server/static/css/base.css

This file was deleted.

Loading