Przejdź do treści
Biblioteka skilli
Programowanie · Przegląd i audyt

webui-code

/webui-code

Pomaga generować i przeglądać kod WebUI w architekturze Lit-element Chrome i zgodnie z jego wytycznymi dotyczącymi stylów.

Repozytorium
chromium ↗
Licencja
BSD-3-Clause
Ostatnia zmiana repozytorium
25.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
2
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 25.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

BSD-3-Clause, otwarta.

Co sprawdzić przed instalacją
  • 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: assets/component_name.html.ts, assets/component_name.ts

Co robi i kiedy

Pomaga generować i przeglądać kod WebUI w architekturze Lit-element Chrome i zgodnie z jego wytycznymi dotyczącymi stylów.

Oryginalny opis (EN)

Use this skill when generating or reviewing WebUI code. This skill contains knowledge on WebUI code following Chrome's Lit-element architecture and styling guidelines.

Jak działa

  1. General WebUI Guidelines
  2. Component Implementation
Sekcje z nagłówków SKILL.md, w oryginale · 75 linii, 317 słów
Podgląd SKILL.md
---
name: webui-code
description: Use this skill when generating or reviewing WebUI code. This skill contains knowledge on WebUI code following Chrome's Lit-element architecture and styling guidelines.
metadata:
  author: Chrome Design System Team
---

# WebUI: Coding Guidelines

## General WebUI Guidelines

- Adhere to the official Chromium WebUI documentation. Read and follow the
  guidelines in these files:
  - For core architecture, Lit implementation details, and migration guides:
    [docs/webui/webui_using_lit.md](//src/docs/webui/webui_using_lit.md)
  - For specific style rules, naming conventions, template guidelines, and
    safety standards:
    [docs/webui/webui_lit_style_guide.md](//src/docs/webui/webui_lit_style_guide.md)
- Adhering to the Chrome Design System. Reference component specs for relevant
  components using the `chrome-components` skill. Ensure code follows the
  guidelines for each component.
- As much as possible, prefer leverage existing WebUI components rather than
  creating new, bespoke components. Components are located under
  `ui/webui/resources/cr_elements/` and `ui/webui/resources/cr_components/`.

## Component Implementation

When implementing a new component, create these files.

### File 1: `<component_name>.ts`

The main TypeScript file defining the element class. It must:

1. Extend `CrLitElement`.
2. Expose the static `is` getter (returning the kebab-case tag name).
3. Load the CSS and HTML template wrappers:
   ```typescript
   import { getCss } from './<component_name>.css.js';
   import { getHtml } from './<component_name>.html.js';
   ```

Example Boilerplate: [component_name.ts](./assets/component_name.ts)

### File 2: `<component_name>.html.ts`

The HTML template containing the Lit markup.

1. Must wrap the template in `html` literal.
2. Must use slot elements correctly (e.g. `slot="title"`, `slot="body"`,
   `slot="footer"`).

Example Boilerplate: [component_name.html.ts](./assets/component_name.html.ts)

### File 3: `<component_name>.css`

Stylesheet guidelines:

- **Lit Compilation Metadata Headers**: It must contain the Lit compilation
  metadata headers importing shared variables so that the build system can wrap
  it into a Lit stylesheet module.
- **Chromium Stylelint Rules**: It must follow the style lint rules for Chromium
  WebUI
  ([//src/ui/webui/resources/tools/stylelint.config_base.mjs](//src/ui/webui/resources/tools/stylelint.config_base.mjs)).
- **Lint feedback loop**: Run Chromium's stylelint script (below) and fix
  errors. Repeat until there are no more errors.
  ```bash
  python3 ui/webui/resources/tools/stylelint.py --config ui/webui/resources/tools/stylelint.config_base.mjs --in_folder <relative_folder_path> --in_files <file_name>.css --out_file /tmp/stylelint.out
  ```
- **Token Fallback Chaining**: Always declare Material 3 dynamic tokens using
  Chromium's shared fallback variables
  (`var(--color-sys-<token>, var(--cr-fallback-color-<token>))`):
  ```css
  /* Preferred: Dynamic Material 3 token with Chromium fallback */
  background-color: var(--color-sys-surface2, var(--cr-fallback-color-surface2));

  /* Anti-pattern: Hardcoded hex fallbacks */
  background-color: var(--color-sys-surface2, #f3f6fc);
  ```

Example Boilerplate: [component_name.css](./assets/component_name.css)
Pliki w paczce (4)
  • SKILL.md 3 KB
  • assets/component_name.css 1 KB
  • assets/component_name.html.ts 1 KB
  • assets/component_name.ts 1 KB

Wersje

W bazie nie ma innych skilli o nazwie webui-code.

Migawka bazy z 13.11.2026 · wersja paczki e79f317b56f7 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90figma-to-webui
    Odtwarza ramki projektu z Figmy jako produkcyjny kod WebUI w Chromium, zgodny z architekturą elementów Lit i wytycznymi stylowania.
  • 100views-code
    Pomaga generować i przeglądać kod C++ Views zgodnie z architekturą i wytycznymi komponentów natywnych Views w Chrome.
  • 82webui-reference
    Pomaga pisać i sprawdzać kod aplikacji WebUI według oficjalnej referencji z instalacji lub repozytorium.
  • 95webui-page-builder
    Prowadzi przez tworzenie, ukrywanie i usuwanie stron pluginu WebUI w lewej nawigacji, z podglądem na żywo.
  • 100testing
    Pomaga uruchamiać i pisać testy w monorepo FAST: lokalne uruchamianie, workflowy CI, fixture'y Playwright i testy integracyjne WebUI.
  • 100ui-common-change
    Wprowadza zmiany w bibliotece ui-common w ramach zadania webui i sprawdza je w PR przed scaleniem biblioteki.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.