The radio group component is structured with a fieldset/legend element, for a11y concerns.
<fieldset class="sds-radioGroup sds-stackLg">
<legend>
<div class="sds-label -labelForm">
Label
</div>
</legend>
<ul class="list-unstyled">
<li class="form-group">
<div class="sds-radio custom-control custom-radio">
<input value="radio-value" type="radio" name="radio-name" class="sr-only custom-control-input " id="default"><span class="sds-radioDot sds-radio__shape" aria-hidden="true"></span>
<label class="custom-control-label" for="default">
Check this custom radio
</label>
</div>
</li>
<li class="form-group">
<div class="sds-radio custom-control custom-radio">
<input value="radio-value" type="radio" name="radio-name" class="sr-only custom-control-input " id="default"><span class="sds-radioDot sds-radio__shape" aria-hidden="true"></span>
<label class="custom-control-label" for="default">
Check this custom radio
</label>
</div>
</li>
<li class="form-group">
<div class="sds-radio custom-control custom-radio">
<input value="radio-value" type="radio" name="radio-name" class="sr-only custom-control-input " id="default"><span class="sds-radioDot sds-radio__shape" aria-hidden="true"></span>
<label class="custom-control-label" for="default">
Check this custom radio
</label>
</div>
</li>
<li class="form-group">
<div class="sds-radio custom-control custom-radio">
<input value="radio-value" type="radio" name="radio-name" class="sr-only custom-control-input " id="default"><span class="sds-radioDot sds-radio__shape" aria-hidden="true"></span>
<label class="custom-control-label" for="default">
Check this custom radio
</label>
</div>
</li>
<li class="form-group">
<div class="sds-radio custom-control custom-radio">
<input value="radio-value" type="radio" name="radio-name" class="sr-only custom-control-input " id="default"><span class="sds-radioDot sds-radio__shape" aria-hidden="true"></span>
<label class="custom-control-label" for="default">
Check this custom radio
</label>
</div>
</li>
</ul>
<p class="sds-radioGroup__error invalid-feedback">Error message</p>
</fieldset>
<fieldset class="{{ namespace }}radioGroup {{ namespace }}stackLg{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}">
<legend>
{% render "@label--form",{
eltType: "div",
text: labelText
}, true %}
</legend>
<ul class="list-unstyled{% if groupErrorClass %} {{ groupErrorClass }}{% endif %}">
{% for i in range(0,5) %}
<li class="form-group">
{% render "@radio",{state: radioErrorState} ,true %}
</li>
{% endfor %}
</ul>
{% if hint %}
<p class="{{ namespace }}radioGroup__hint {{ namespace }}textHelperSmall">Radio hint</p>
{% endif %}
<p class="{{ namespace }}radioGroup__error invalid-feedback">Error message</p>
</fieldset>
/* variables specific to current element */
$element-specific-variables: "";
.#{$namespace}radioGroup {
/* Save root element context for easy access if nesting is needed */
$self: &;
/* properties of current element + media queries */
/* Pseudo Elements */
&::before {
}
&::after {
}
/*
Include elements that are linked to the current element but have to reside at the root level of the stylesheet
(e.g: keyframes)
*/
@at-root {
}
/* children - write selector in full in comments in order to facilitate search */
// radioGroup__childElement
&__error,
&__hint {
margin-top: 0;
padding-left: $custom-control-label-shape-space;
}
&__hint {
@include custom-prop-fallback("color", "sys-color-text-primary-muted");
}
/* modifiers */
// radioGroup -altStyle
&.-altStyle {
// follows same logic as base element
}
/* random parent element */
/*
*
* Syntax : .randomParentElt & {}
*
*/
/* Pseudo Classes */
&:hover {
@media (hover: hover) {
}
}
&:focus {
}
&:active {
}
&:focus,
&:active {
}
}