Codebase 6 form elements have simple background and focus styling.
Notes:
w-100%
btn
font-size: inherit
var(--t-base-fs)
Text
Search
Email address Expects an email address. On touch screens, this will invoke a keypad for entering emails.
Password
Url Expects a web address. On touch screens, this will invoke a keypad for entering URLs.
On touch screens, these inputs invoke the numeric keyboard instead of the text keyboard.
Telephone number
Number
On some devices (e.g. iOS Safari), these inputs get modified by date pickers, etc. The shape of the input fields gets changed.
Date
Date / Time local
Time
Invokes the device’s color picker.
Color
File input
Note: File upload inputs <input type="file"> can break your page layout on the smallest phones in portrait orientation. But if you add class="w100%" that problem goes away.
<input type="file">
class="w100%"
On some devices (e.g. iOS Safari), these inputs get modified by number pickers (dropdowns).
Example select 1 2 3 4 5
Example multiple select 1 2 3 4 5
Favourite dog breed:
Radio boxes:
Checkboxes:
Groups of form elements can be wrapped in <fieldset> tags. Add a <legend> to provide a special title for the entire fieldset.
<fieldset>
<legend>
<form action=""> <fieldset class="flex gap-tiny"> <legend>Example e-newsletter subscribe</legend> <input class="w100%" type="email" id="example-input-email" placeholder="Enter email"> <input type="submit" name="submit" value="Subscribe"> </fieldset> </form>
Note: In the example above, the Codebase flex class has been used to align these form elements side-by-side, and then grow has been used to expand the email input field. A <legend> is also included — but since its text incorporates with the <fieldset> wrapping border line, it will not be controlled by the flexbox rule.
flex
grow
Border, background, and text color utilities can be used.
<label for="example-input-text">Label</label> <input class="b-thick b-red" type="text" id="example-input-text" placeholder="Enter some text here"> <input class="b-thick b-green" type="text" id="example-input-text" placeholder="Enter some text here">
Button
<form action=""> <p> <button type="button" name="button">Button</button> <input type="button" name="input" value="Input Button"> <input type="submit" name="submit" value="Submit Button"> <input type="reset" name="reset" value="Reset Button"> </p> </form>
The btn class is used to style links as buttons. See components: buttons for more information.
Docs