Javascript enhancements
Huesos provide a small set of javascript enhancements over native HTML behavior.
These enhancements adhere to the following guidelines:
- Zero overweight. When using third-parties we favor small, concise, single-purpose libraries.
- Vanilla javascript. jQuery shouldn’t be a dependency. All code is vanilla.
- Quick (and optional) application. We use data-attributes to make instantiation as easy as writing some HTML. By default, we don’t apply any enhancement.
- HTML Fallbacks. You can always resort to native HTML behavior without losing functionality.
- Only when needed. We only enhance HTML when the native UX is clearly broken (i.e:
<select
>), inconsistent (<input type="file">
) or incomplete (<details>
).
Accordion
Use [data-accordion]
on a wrapper element around some details
to set an accordion-like behavior using JS.
…continue reading the docs for Accordion
File uploader
With [data-file-input]
you get a button-like input that will inform the user on the number of files that are uploaded or the name of the file when it’s only one.
…continue reading the docs for File Uploader
Selectr
Use [data-selectr]
to tame those pesky <select>
elements. Your users will be grateful.