gitea/web_src/js/webcomponents
Mykhailo ee009ebec8
Support dark/light theme images in markdown (#36922)
This PR matches GitHub's behavior more closely on how to render Markdown
images in light/dark mode.
Images with source suffix `#gh-dark-mode-only` / `#gh-light-mode-only`
will only show when the correct theme is requested.
Closes: #35545

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-03-21 12:44:33 +00:00
..
README.md Add `<overflow-menu>`, rename webcomponents (#29400) 2024-03-15 02:05:31 +00:00
index.ts Support dark/light theme images in markdown (#36922) 2026-03-21 12:44:33 +00:00
origin-url.ts Enable TypeScript `strictNullChecks` (#35843) 2025-12-03 02:13:16 +00:00
overflow-menu.ts Prevent navigation keys from triggering actions during IME composition (#36540) 2026-02-08 14:39:09 +08:00
polyfill.test.ts Polyfill WeakRef (#34025) 2025-03-26 23:56:25 +08:00
polyfills.ts Vendor relative-time-element as local web component (#36853) 2026-03-13 10:43:17 +00:00
relative-time.test.ts Vendor relative-time-element as local web component (#36853) 2026-03-13 10:43:17 +00:00
relative-time.ts Vendor relative-time-element as local web component (#36853) 2026-03-13 10:43:17 +00:00

README.md

Web Components

This webcomponents directory contains the source code for the web components used in the Gitea Web UI.

https://developer.mozilla.org/en-US/docs/Web/Web_Components

Guidelines

  • These components are loaded in <head> (before DOM body) in a separate entry point, they need to be lightweight to not affect the page loading time too much.
  • Do not import svg.js into a web component because that file is currently not tree-shakeable, import svg files individually insteat.
  • All our components must be added to webpack.config.js so they work correctly in Vue.