aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwxiaoguang2023-03-03 17:45:19 +0800
committerGitHub2023-03-03 17:45:19 +0800
commit0bfcbcc5e769bd258e4f530e0f007f5465f42de5 (patch)
tree4ff4336bb8149551344f1afe560a6a40ccb9a65c
parentffce336f1802b2f2298fc8fd27e815086702c812 (diff)
Add document for `webcomponents` (#23261)
-rw-r--r--web_src/js/webcomponents/README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/web_src/js/webcomponents/README.md b/web_src/js/webcomponents/README.md
new file mode 100644
index 000000000..eabbc24ad
--- /dev/null
+++ b/web_src/js/webcomponents/README.md
@@ -0,0 +1,19 @@
+# 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),
+ so they should have their own dependencies and should be very light,
+ then they won't affect the page loading time too much.
+* If the component is not a public one, it's suggested to have its own `Gitea` or `gitea-` prefix to avoid conflicts.
+
+# TODO
+
+There are still some components that are not migrated to web components yet:
+
+* `<span class="js-pretty-number">`
+* `<time data-format>`