Active
Project:
Advanced Form
Version:
2.0.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2023 at 23:49 UTC
Updated:
17 Sep 2023 at 22:08 UTC
Jump to comment: Most recent
Improve documentation and test coverage.
CssGeneratorTest which tests behaviour of the advancedform.cssgenerator service with various inputs & expected outputsCssGeneratorInterface and allow the service to throw an exception if the rules input is invalid?Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
xurizaemonSteps to configure term-based behaviour
Comment #4
xurizaemonAdding related issue #3387723: selected-xxx classes not removed on select updates where test coverage for fields hidden by select option conditions is added.
Comment #5
xurizaemonComment #6
xurizaemonWhat threw me about this was that the rules syntax seems to ask you to incorporate a space, OR to add an additional selector inside the square brackets.
Actual usage "in the wild" appears to be like this (now "documented" in the test coverage):
This will generate:
form.advanced-form-filtered.node-page-form.selected-standard-page .field--name-field-intro { display: none; }Which works because
.selected-standard-pageis applied to the create/edit form when term "Standard Page" is selected in a term<select>.Without the class inside the square brackets, I found I had to include an additional space to make the selectors work, and that felt unintuitive.
Honestly the whole "rules to CSS" thing feels unintuitive and I'd probably use SASS today and keep the JS, but that's another issue.