Trimmings
HTML-focused thin JavaScript framework from Postlight folks. https://postlight.github.io/trimmings/ (2019-08-29) Postlight Back To Html Introducing Trimmings
- 2023 update: looks abandoned https://github.com/postlight/trimmings
What happens to your web development process when you can focus on designing views and stop thinking about how to stitch them together?
This project follows in the footsteps of libraries like Turbolinks and Stimulus.
Pair Trimmings with Turbolinks for an even more seamless experience!
Trimmings’s API was inspired by Stimulus and the two libraries work happily together
Installation: Just include trimmings.js in your <head>
. That’s it.
Features – Trimmings
Embed: Pre-fetch and replace links with the content they’re linking to on page load.
Inline: Load a linked page into the current page on click.
Replace: Update portions of your current page when the user clicks a link.
Toggle: Add and remove classes from your elements when the user interacts with form inputs.
Autosubmit: Submit your form automatically when a field changes.
Current, listen for changes to the current page and add classes to specific elements automatically
Getting Started – Trimmings
Each thing has one URL
The web is a web because of the many links between its many pages. A link only really works when it can point somewhere, and that means that all your things need their own URLs.
Each URL has one thing
the sooner you can identify your network of things, the better-equipped you’ll be to start putting those things on the web. As you might have guessed, each of your things should have a URL
Modeling your data
be careful not to repeat yourself too much.
HTML is not just the tags that hold your content. HTML describes your data and imposes hierarchy
Take all of the thoughts you’d put into a JSON API, with its many objects and attributes and relationships—all your things—and replace the JSON with HTML
A Trimmings website prioritizes HTML above everything else (except the URL).
Edited: | Tweet this! | Search Twitter for discussion