Problem/Motivation
Given an empty content, some components still emit their markup, while others correctly return nothing.
header, footer, modal, share, display, consent_banner, consent_manager, france_connect and transcription are out of scope: they carry their own interface and are meant to render on their own.
But here are some components potentially concerned : summary, side_menu, link, button, tab, card, alert, notice, callout, content_media, tab_panel, stepper, tag..etc
We need also to write the markup when the part the DSFR declares mandatory is there.
Some thoughts :
- summary: a title and at least one link
- side_menu: at least one item. The title stays optional, as the doc says, and the landmark falls back to an aria-label when it is missing
- stepper: a title
- notice: a title, a description or a link. The body wrapper stops being conditional
- alert: a title or a message
- callout: a title or a text
- content_media: an image or a video
- card: any of its parts, which are all optional
- tag: a label
- tab: a title
- link and button: a label, or an icon. With an icon and no label, the title becomes the label, which is what the doc asks for the icon-only variant
- Inside summary and side_menu, a link with an empty title drops out instead of becoming an empty anchor.
- Layout containers keep their empty shell: grid_row, grid_row_1 and tab_panel are plain div elements.
Issue fork ui_suite_dsfr-3620099
Show commands
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 #3
just_like_good_vibesComment #4
pdureau commentedIndeed, in any Web design system, some components are expected to not be rendered according to some conditions (missing slot(s), some prop(s) values...).
If the upstream documentation and examples don't tell what is expected, it is up to the implementation owner (the Drupal themer here), to decide when authoring the Twig.
Your proposal is updating 11 components. Each one must be check individually.
Some though before the review:
buttonandtagwhere most logic revolve aroundurlpropnotice)Comment #5
pdureau commentedIf we are sure
buttonandtaglogic are still OK, and if the changes has been checked against proper upstream documentation: RTBCComment #7
just_like_good_vibes