Dedicated Options for Styles

Đang mở
#6,027 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
css, php, scss
Lĩnh vực
backend, frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
PHP
Star
248
Fork
147
Merge trung bình
17 phút
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WoltLab/WCF

Tất cả issue của WoltLab/WCF

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.