glare-typography
v1.0.4
Published
A Tailwind CSS plugin for custom typography utilities.
Maintainers
Readme
Tailwind CSS Glare Typography Plugin
A Tailwind CSS plugin that provides a comprehensive set of typography utility classes for consistent and scalable text styling.
Features
- Predefined typography styles for Display, Headers, Labels, and Body text.
- Supports multiple font weights: Bold, Semibold, Medium, and Regular.
- Responsive and customizable typography utilities.
- Easy integration with Tailwind CSS projects.
Installation
Install the plugin via npm:
npm install glare-typographyOr using Yarn:
yarn add glare-typographyUsage
Add the plugin to your tailwind.config.js file:
module.exports = {
plugins: [
require('glare-typography')
]
}Use the provided utility classes in your HTML or JSX:
<h1 class="typography-display-large-bold">Display Large Bold</h1>
<p class="typography-body-medium-regular">Body Medium Regular</p>
<label class="typography-labels-small-semibold">Label Small Semibold</label>Available Classes
Display Text
typography-display-large-boldtypography-display-large-semiboldtypography-display-large-mediumtypography-display-large-regulartypography-display-medium-boldtypography-display-medium-semiboldtypography-display-medium-mediumtypography-display-medium-regulartypography-display-small-boldtypography-display-small-semiboldtypography-display-small-mediumtypography-display-small-regular
Headers
typography-headers-large-boldtypography-headers-large-semiboldtypography-headers-large-mediumtypography-headers-large-regulartypography-headers-medium-boldtypography-headers-medium-semiboldtypography-headers-medium-mediumtypography-headers-medium-regulartypography-headers-small-boldtypography-headers-small-semiboldtypography-headers-small-mediumtypography-headers-small-regular
Labels
typography-labels-large-boldtypography-labels-large-semiboldtypography-labels-large-mediumtypography-labels-large-regulartypography-labels-medium-boldtypography-labels-medium-semiboldtypography-labels-medium-mediumtypography-labels-medium-regulartypography-labels-small-boldtypography-labels-small-semiboldtypography-labels-small-mediumtypography-labels-small-regular
Body Text
typography-body-large-boldtypography-body-large-semiboldtypography-body-large-mediumtypography-body-large-regulartypography-body-medium-boldtypography-body-medium-semiboldtypography-body-medium-mediumtypography-body-medium-regulartypography-body-small-boldtypography-body-small-semiboldtypography-body-small-mediumtypography-body-small-regular
Customization
You can extend or override the default styles by adding custom configurations in your tailwind.config.js file. For example:
module.exports = {
theme: {
extend: {
typography: {
'display-large-bold': {
fontSize: '36px',
lineHeight: '125%',
fontWeight: '700',
letterSpacing: '-0.36px',
},
},
},
},
plugins: [
require('glare-typography')
]
}Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you find this plugin useful, consider giving it a ⭐️ on GitHub.
