Dedicated Options for Styles
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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:
- 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.
- 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.
- 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.
- 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__%sfor boolean fields and.styleOption__%s--%sfor 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.
- 主要语言
- PHP
- 星标
- 248
- 派生
- 147
- 平均合并
- 17 分钟
- 30 天内合并 PR
- 21
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WoltLab/WCF 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 58/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 30/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
WoltLab/WCF#6771 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
HE-Arc/le-panier-du-coin#49 ·
维护者通常 1 天内回复
-
15.0
难度 2/5 1-3 小时 新手友好度 65/100
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
LinkNacional/woo-rede#367 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Lazyload SVG placeholder runs uncached attachment lookups with JSON-escaped URLs on REST responses未关闭customer report
难度 2/5 1-3 小时 新手友好度 72/100
Codeinwp/optimole-wp#1253 ·
维护者通常 1 天内回复