Dedicated Options for Styles

Aperta
#6,027 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
css, php, scss
Ambito
backend, frontend

Direzione di ricerca

Read the linked initiative in #6028 alongside this issue. The issue describes style options built from form builder fields and raises unresolved questions about CSS variables, document element classes, custom fields, and an allow-list; it does not identify files, tests, or a settled design. A contribution would need a decision on those questions and a defined scope before implementation can be assessed as done.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Discussion

Note: This is part of a larger initiative to overhaul the style system and the customization options in general. See #6028 to learn more.

The status quo for styles with customization abilities is to ship alongside a regular plugin that provides generic options in the admin panel. This approach works because some types of options are exposed using variables in the SCSS compile step which allows for some decision to be made. The second building block are customized templates that embed additional logic or insert extra blocks that are then customized by the style.

Drawbacks of Using Global Options

Using global options are undesirable for a plethora of reasons:

  1. Styles are then tied to the plugin that provides the package. Lifting the style protection will remove that coupling which means that users could uninstall the plugin and break their style.
  2. This causes the options menu to be filled with sometimes tens of options per style which causes a lot of clutter and especially noise in the search results.
  3. While the naming of the categories are mostly relatable, a lot of the times it makes it difficult to draw the connection between the option and the style it affects.
  4. Exporting styles is a mess because while customized templates are exported, individual options are left out. This is caused by the options provided through the plugin and not by the style itself.

Potential Solution: Options per Style

The most straightforward approach is to add support for custom options to styles based on form builder input fields. This provides a wide range of customization options while providing a familiar UI while avoiding additional burden for style authors. Options are then tied to that specific style and can be exported / imported alongside.

Unclear

  • How should these options be made available? Exporting them as CSS variable is possible, but does not allow for proper decision making in CSS selectors.
  • How should we deal with boolean options and/or radio selects? Those could be translated into CSS classes applied to the document element, allowing for some degree of decision making. Something like .style__option__%s for boolean fields and .styleOption__%s--%s for radio selects could work.
  • Do we want to support custom input fields? This could enable some more advanced options but would then cause the styles to be tied to a specific plugin once again. If there are some useful form fields missing, we could add them to the core. If we want to restrict options to those available in the core only, we must maintain an explicit allow-list to make it work.
Lingua principale
PHP
Stelle
248
Fork
147
Merge medio
17m
PR unite (30g)
21

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WoltLab/WCF

Tutte le issue di WoltLab/WCF

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.