forgejo/web_src/css
oliverpool 83ea43cf49 frontend: generic lazy loader for webcomponents (#8510)
After seeing #8111 use a webcomponent, I think that they are a neat usecase for Forgejo where most of the frontend is backend-generated, with some "island of enhancements".

I am considering using a webcomponent for the CITATION management (last occurrence of [`Blob.GetBlobContent`](https://codeberg.org/forgejo/forgejo/issues/8222)), however I noticed that the developer experience wasn't ideal.

With this PR it would be very easy to declare a webcomponent, which will be loaded only if needed (I converted `model-viewer` and `pdf-object` to this technique).

Some cleanup in the neighbor webcomponents.

## Testing

1) Create a new repository or use an existing one.
2) Upload a `.pdf` or `.glb`  file (such as https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/testdata/data/viewer/Unicode%E2%9D%A4%E2%99%BBTest.glb)
3) Open the Network inspector and view the file in the repository.
    - After a short loading spinner, the PDF or 3D model should be rendered in a viewer
    - the related JS should have been loaded (e.g. http://localhost:3000/assets/js/model-viewer.494bf0cd.js)
    - visiting another page and check that this JS file isn't loaded

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8510
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-07-23 04:10:50 +02:00
..
chroma [Port] gitea#30014: Various code view improvements 2024-03-28 16:43:14 +01:00
codemirror Remove EasyMDE focus outline on text (#25328) 2023-06-18 04:10:07 +00:00
editor fix(ui): ensure consistent switch position in markdown editor (#7492) 2025-04-09 17:37:46 +00:00
features chore(ui): clean up hashbox CSS, small design changes (#7822) 2025-05-25 12:51:27 +02:00
markup feat(ui): global styling for kbd tag (#7958) 2025-06-10 22:59:24 +02:00
modules frontend: generic lazy loader for webcomponents (#8510) 2025-07-23 04:10:50 +02:00
repo fix(ui): make releases filtering responsive (#8399) 2025-07-08 16:58:49 +02:00
shared fix(ui): improve milestone/project header consistency (#7174) 2025-03-09 16:24:52 +00:00
standalone Add toasts to UI (#25449) 2023-06-27 02:45:24 +00:00
themes feat(ui): redesign migration selection screen (#6795) 2025-04-19 13:51:35 +00:00
actions.css Add support for workflow_dispatch (#3334) 2024-06-28 05:17:11 +00:00
admin.css User details page (#26713) 2023-08-31 11:21:18 +02:00
base.css fix(ui): remove unused rule with unused class .tight (#8573) 2025-07-19 15:49:48 +02:00
dashboard.css feat(ui): welcome screen for user dashboard (#7030) 2025-02-23 08:41:31 +00:00
explore.css [Port] gitea#29982 Introduce .secondary-nav and handle .page-content spacing universally 2024-03-28 16:43:09 +01:00
font_i18n.css Fix @font-face overrides (#24855) 2023-05-24 01:48:51 +00:00
form.css feat!: Abusive content reporting (#6977) 2025-05-18 08:05:16 +00:00
helpers.css Merge pull request 'Replace gt-word-break with tw-break-anywhere' (#4102) from 0ko/forgejo:ui-replace-gt-word-break into forgejo 2024-06-11 10:39:03 +00:00
home.css fix(ui): center footer links (#7925) 2025-05-22 15:27:00 +02:00
index.css feat: remove fomantic's tab module (#8587) 2025-07-21 22:33:17 +02:00
install.css UI improvements to optional sections in installation page (#4062) 2024-06-07 17:57:54 +00:00
migrate.css feat(ui): redesign migration selection screen (#6795) 2025-04-19 13:51:35 +00:00
org.css feat(ui): improve org header with new noJS dropdown and more options (#8572) 2025-07-23 02:06:13 +02:00
repo.css frontend: generic lazy loader for webcomponents (#8510) 2025-07-23 04:10:50 +02:00
review.css fix(ui): put buttons in a single row on mobile 2024-11-25 18:43:09 +05:00
user.css feat(ui): redesign user profile actions layout (#7906) 2025-06-24 14:16:51 +02:00