New
<div class="input">
<label for="input-1">Label</label>
<div class="input__body">
<div class="input__body-main">
<div class="input__icon-left" aria-hidden="true">
<!-- TODO: change de icon if needed -->
<span class="material-symbols-outlined" aria-hidden="true">circle</span>
</div>
<input type="text" id="input-1" name="input-1" placeholder="Place holder text" required>
<div class="input__icon-right" aria-hidden="true">
<!-- TODO: change de icon if needed -->
<span class="material-symbols-outlined" aria-hidden="true">circle</span>
</div>
</div>
<div class="input__body-aside">
<!-- TODO: add final tooltip if needed -->
<button class="input__tooltip" type="button" title="This is a temporary tooltip">
<span class="material-symbols-outlined" aria-hidden="true">info</span>
</button>
</div>
</div>
<div class="input__help">Helpful text goes here</div>
</div>
The CSS was created using the "Block, Element, Modifier" (BEM)
directive for creating classes.
- .input - The container of the group that contains input and its related elements.
- .input__body - The container that will receive the input field and its closest elements
- .input__icon-left - The icon container that will be on the left side of the input field.
- .input__icon-right- The icon container that will be on the right side of the input field.
- .input__help - Container for helpful information related to the input field.
- .input__tooltip - Container for the tooltip.
Depending on the context, some elements should be removed.
General rules
Input field states
Features
Layout modifiers will change the layout structure of the whole block.
Theme state modifiers are capable of changing the colors, icons and other visual representations of the element, they are: