winzik/docs/ide/css-editor.md
David Nurdin 7de153fc14 IDE documentation: one page per feature (docs/ide/, French in docs/ide/fr/) and a Doc browser inside the IDE
- docs/ide/: 49 user pages grouped in toc.json (editing, languages, run / test / debug, Git, web sites and Symfony, databases,
  Docker and SSH, games, AI, team, settings); pages of features still being built are "coming soon" stubs with a TODO list;
  15 pages translated into French; docs/ide.md and docs/ide.fr.md link to them.
- The Doc button at the top right of the IDE, Help > Documentation, Search Everywhere "Documentation" and a "?" in each tool
  window's header open the Doc browser (ide/ui/js/docs-browser.js): table of contents, rendered pages (pictures, code, tables,
  links between pages and to headings), full-text search, back / forward, the IDE's language with English as the fallback.
- ide/src/Docs/DocsLibrary.php (docs.index, docs.image): reads only the documentation folder (strict names, real path checked);
  the packaged copy ui/docs first, else the repository's docs/ide.
- Packaging: tools/stage-game.sh copies docs/ide into the exported IDE (its *.md exclusion would drop them), overlay-build.php
  puts them in code updates, bin/jumphp ide syncs them.
- Tests: docs-model.test.mjs (TOC, links, anchors, pictures, search; every page and picture of docs/ide exists), DocsLibraryTest
  (path traversal refused), the i18n test covers the new texts in 14 languages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JkYTqsvYu6AYr9yQ3Q4Nt6
2026-11-16 00:08:42 +01:00

34 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Visual CSS / SCSS editor
`.css` and `.scss` files have **Code / Split / Design / Preview** (bottom right of the editor).
![The CSS editor](images/css-editor.png)
## Design
- **Rules** (left): a tree of the file's rules, `@media` / `@supports` / `@container` / `@layer` groups, `@font-face`,
`@keyframes`, SCSS nesting, `%placeholders`, `@use` / `@include` / `@mixin`. Filter, add, duplicate, delete, move with `Alt+↑` /
`Alt+↓`. The file's `--custom-properties` and `$variables` with their colours.
- **Inspector** of the selected rule, grouped like a design tool: Layout (flex and grid drawn as small pictures, grid tracks), Box
(margin / border / padding widget, radius), Size, Position, Typography (with a preview in the font), Colours and backgrounds
(colour pickers: hex / rgb / hsl / oklch / named, alpha, the project's colours, a gradient editor), Effects (shadows, opacity,
filter, transform, transition), Other declarations.
- Numbers change with the arrows or by dragging their label (`Shift` ×10, `Alt` ×0.1); `!` toggles `!important`; ✕ removes.
Each change rewrites only that declaration: `Ctrl+Z` takes it back, comments and formatting stay. Typing in the code redraws the
panels; Split follows the cursor.
## Preview
A sample page or one of the project's pages. The elements the selected rule matches are outlined; a click on an element lists the
rules that apply to it, the strongest first, with their specificity.
## SCSS
Compiled by a real dart-sass (the project's, the computer's, else the `sass` package in Docker): errors at their line, the compiled CSS
in the preview. You edit the SCSS itself.
## In the code
A colour swatch beside every colour (also `var(--x)` and `$x` holding a colour); a click opens the picker (a variable's swatch changes
its definition).