.ai/principles/distilled/frontend-haml.md
Prerequisite: If you haven't already, also read .ai/principles/distilled/frontend-vue.md - it contains foundational rules that apply to all frontend work.
<article>, <nav>, <section>, <footer>, etc.) only when their semantic meaning accurately matches the content's intent.<strong> or other semantic tags for purely presentational purposes (e.g., bold styling); use CSS classes like gl-font-bold instead.<div> elements where semantic alternatives exist and are appropriate.<button> element has an explicit type attribute (e.g., type="button").<a href="#">) to invoke JavaScript handlers; use <button type="button"> instead.target="_blank" to <a> tags without also adding rel="noopener noreferrer".gl-link with target="_blank", omit rel="noopener noreferrer" (it is added automatically).target="_blank".gitlab_ui_form_for) instead of standard form_for when building HAML forms with Pajamas-styled inputs.f.check_box + f.label pairs with f.gitlab_ui_checkbox_component when using gitlab_ui_form_for.gitlab_ui_radio_component for radio buttons within gitlab_ui_form_for forms.gitlab_ui_checkbox_component; use the label slot only when HTML content is required inside the label.help_text: keyword argument to gitlab_ui_checkbox_component/gitlab_ui_radio_component; use the help_text slot only when HTML content is required.f.label as a separate element alongside gitlab_ui_checkbox_component or gitlab_ui_radio_component; the label is managed by the component itself.For the full picture, see: