Visually Hidden Utility Tailwind Plugin
Overview
Hide only visually, but have it available for screen readers: https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
For long content, line feeds are not interpreted as spaces and small width causes content to wrap 1 word per line: https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
Installation
Add this plugin to your project:
# Install via npm npm install --save-dev tailwindcss-visuallyhidden
Usage
You can add the plugin to your tailwind config as follows:
This plugin outputs the following
As per the tailwind plugin docs you are able to pass variants (responsive, hover etc) as a parameter.
variants: 'responsive' 'hover'