# Frontend development guidelines This document covers frontend-specific architecture and contribution expectations. For the general workflow see [CONTRIBUTING.md](../CONTRIBUTING.md), and for building and testing see [development.md](development.md) and [testing.md](testing.md). ## Background The frontend uses [Vue 3](https://vuejs.org/), [Fomantic-UI](https://fomantic-ui.com/) (built on jQuery) and [Tailwind CSS](https://tailwindcss.com/). Pages are rendered with Go HTML templates. Source files live in: - `web_src/css/`: CSS styles - `web_src/js/`: JavaScript and TypeScript - `web_src/js/components/`: Vue components - `web_src/js/features/`: feature modules wired up at page load - `templates/`: Go HTML templates ## Dependencies Frontend dependencies are managed with [pnpm](https://pnpm.io/). The same rules as for [backend dependencies](guidelines-backend.md#dependencies) apply, except the relevant files are `package.json` and `pnpm-lock.yaml`, and new versions must always reference an existing published version. ## Framework usage Mixing frameworks arbitrarily makes code hard to maintain. Recommended combinations: - Vue3 - Vanilla JavaScript - Fomantic-UI (jQuery), deprecated, we vendored a specific version with a lot of changes. Avoid combinations such as Vue with Fomantic-UI. Vue components may reuse Fomantic-UI CSS classes for visual consistency. Use Go templates for simple or SEO-relevant pages and Vue for complex, interactive pages. Gitea uses Vue 3 **without** JSX to keep HTML and JavaScript separate. > [!NOTE] > Fomantic-UI is not an accessibility-friendly framework. Gitea patches some ARIA > behavior, but accessibility work is ongoing — prefer semantic HTML and test > keyboard/screen-reader behavior where you can. ## Gitea-specific conventions - Keep features in their own files or directories. - Use kebab-case for HTML `id`s and classes, ideally with 2-3 feature keywords. - Prefix classes to avoid short-name conflicts between different frameworks. - Create a new class name when overriding framework styles instead of editing the framework's own classes, or fix the framework's source to fix all cases. - Prefer semantic elements such as `