All Projects → benface → Tailwindcss Typography

benface / Tailwindcss Typography

Licence: isc
Tailwind CSS plugin to generate typography utilities and text style components

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tailwindcss Typography

Pingcrm React
⚛️ Ping CRM React - A demo app to illustrate how Inertia.js works with Laravel and React (hosted on a heroku free dyno).
Stars: ✭ 158 (-25.47%)
Mutual labels:  tailwindcss
Leaguestats
📈 League of Legends Stats Web App
Stars: ✭ 172 (-18.87%)
Mutual labels:  tailwindcss
Tailwindcss Transitions
[DEPRECATED] Tailwind CSS plugin to generate transition utilities
Stars: ✭ 200 (-5.66%)
Mutual labels:  tailwindcss
Admin Template
Tailwind CSS Starter Template - Admin Dashboard Template
Stars: ✭ 160 (-24.53%)
Mutual labels:  tailwindcss
Sketch Tailwind
A plugin that tries to bridge the gap between designs and code. Sketch Tailwind lets you export aspects of a design made in Sketch to a javascript theme file that you can import into your TailwindCSS config
Stars: ✭ 166 (-21.7%)
Mutual labels:  tailwindcss
Notus React
Notus React: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 173 (-18.4%)
Mutual labels:  tailwindcss
Tailwindcss Dir
Adds direction (LTR, RTL) variants to your Tailwind project
Stars: ✭ 156 (-26.42%)
Mutual labels:  tailwindcss
Dashboard
🛩 🧶 Dashboard template built with tailwindcss.
Stars: ✭ 202 (-4.72%)
Mutual labels:  tailwindcss
Vue Tailwind Picker
🎉 Datepicker component for vue.js build with Tailwind CSS & dayjs date library
Stars: ✭ 170 (-19.81%)
Mutual labels:  tailwindcss
Tailwindcss Gradients
Tailwind CSS plugin to generate gradient background utilities
Stars: ✭ 194 (-8.49%)
Mutual labels:  tailwindcss
Tails Ui
🐒 Clean UI based on tailwindcss
Stars: ✭ 162 (-23.58%)
Mutual labels:  tailwindcss
Tailwindcss Spinner
Spinner utility for Tailwind CSS
Stars: ✭ 163 (-23.11%)
Mutual labels:  tailwindcss
Hugo Theme Tailwindcss Starter
Starter files for a Hugo theme with Tailwindcss
Stars: ✭ 187 (-11.79%)
Mutual labels:  tailwindcss
Tailwind Cards
A growing collection of text/image cards you can use/copy-paste in your tailwind css projects
Stars: ✭ 154 (-27.36%)
Mutual labels:  tailwindcss
Wp Tailwindcss Theme Boilerplate
A minimalist boilerplate for WordPress theme development using Tailwind CSS, SCSS, and Laravel Mix.
Stars: ✭ 199 (-6.13%)
Mutual labels:  tailwindcss
Devfolio
A modern and production-ready personal portfolio + blog template built with GatsbyJs and TailwindCSS
Stars: ✭ 154 (-27.36%)
Mutual labels:  tailwindcss
Gridsome Starter Bleda
Gridsome blog starter, built with Tailwind CSS
Stars: ✭ 179 (-15.57%)
Mutual labels:  tailwindcss
Panel
Pterodactyl is an open-source game server management panel built with PHP 7, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
Stars: ✭ 2,988 (+1309.43%)
Mutual labels:  tailwindcss
Svelte Storybook Tailwind
A starter template for Svelte, TailwindCSS and Storybook. You can easily start your project with this template, instead of wasting time figuring out configurations for each integration.
Stars: ✭ 204 (-3.77%)
Mutual labels:  tailwindcss
My Dash
🔢 A developer friendly dashboard for monitoring your self-hosted services with a clean and modern UI.
Stars: ✭ 193 (-8.96%)
Mutual labels:  tailwindcss

BLACK LIVES MATTER

Be aware. Be angry. Do better. Demand change. Show your support any way you can. Click on the link above to find protests, petitions, and other ways to help. DO NOT LET IT GO SILENT.

Typography Plugin for Tailwind CSS

Requirements

This plugin requires Tailwind CSS 1.2 or later. If your project uses an older version of Tailwind, you should install the latest 2.x version of this plugin (npm install [email protected]).

Installation

npm install tailwindcss-typography

Usage

// tailwind.config.js
module.exports = {
  theme: {
    textIndent: { // defaults to {}
      '1': '0.25rem',
      '2': '0.5rem',
    },
    textShadow: { // defaults to {}
      'default': '0 2px 5px rgba(0, 0, 0, 0.5)',
      'lg': '0 2px 10px rgba(0, 0, 0, 0.5)',
    },
    textDecorationStyle: { // defaults to these values
      'solid': 'solid',
      'double': 'double',
      'dotted': 'dotted',
      'dashed': 'dashed',
      'wavy': 'wavy',
    },
    textDecorationColor: { // defaults to theme => theme('colors')
      'red': '#f00',
      'green': '#0f0',
      'blue': '#00f',
    },
    fontVariantCaps: { // defaults to these values
      'normal': 'normal',
      'small': 'small-caps',
      'all-small': 'all-small-caps',
      'petite': 'petite-caps',
      'unicase': 'unicase',
      'titling': 'titling-caps',
    },
    fontVariantNumeric: { // defaults to these values
      'normal': 'normal',
      'ordinal': 'ordinal',
      'slashed-zero': 'slashed-zero',
      'lining': 'lining-nums',
      'oldstyle': 'oldstyle-nums',
      'proportional': 'proportional-nums',
      'tabular': 'tabular-nums',
      'diagonal-fractions': 'diagonal-fractions',
      'stacked-fractions': 'stacked-fractions',
    },
    fontVariantLigatures: { // defaults to these values
      'normal': 'normal',
      'none': 'none',
      'common': 'common-ligatures',
      'no-common': 'no-common-ligatures',
      'discretionary': 'discretionary-ligatures',
      'no-discretionary': 'no-discretionary-ligatures',
      'historical': 'historical-ligatures',
      'no-historical': 'no-historical-ligatures',
      'contextual': 'contextual',
      'no-contextual': 'no-contextual',
    },
    textRendering: { // defaults to these values
      'rendering-auto': 'auto',
      'optimize-legibility': 'optimizeLegibility',
      'optimize-speed': 'optimizeSpeed',
      'geometric-precision': 'geometricPrecision'
    },
    textStyles: theme => ({ // defaults to {}
      heading: {
        output: false, // this means there won't be a "heading" component in the CSS, but it can be extended
        fontWeight: theme('fontWeight.bold'),
        lineHeight: theme('lineHeight.tight'),
      },
      h1: {
        extends: 'heading', // this means all the styles in "heading" will be copied here; "extends" can also be an array to extend multiple text styles
        fontSize: theme('fontSize.5xl'),
        '@screen sm': {
          fontSize: theme('fontSize.6xl'),
        },
      },
      h2: {
        extends: 'heading',
        fontSize: theme('fontSize.4xl'),
        '@screen sm': {
          fontSize: theme('fontSize.5xl'),
        },
      },
      h3: {
        extends: 'heading',
        fontSize: theme('fontSize.4xl'),
      },
      h4: {
        extends: 'heading',
        fontSize: theme('fontSize.3xl'),
      },
      h5: {
        extends: 'heading',
        fontSize: theme('fontSize.2xl'),
      },
      h6: {
        extends: 'heading',
        fontSize: theme('fontSize.xl'),
      },
      link: {
        fontWeight: theme('fontWeight.bold'),
        color: theme('colors.blue.400'),
        '&:hover': {
          color: theme('colors.blue.600'),
          textDecoration: 'underline',
        },
      },
      richText: {
        fontWeight: theme('fontWeight.normal'),
        fontSize: theme('fontSize.base'),
        lineHeight: theme('lineHeight.relaxed'),
        '> * + *': {
          marginTop: '1em',
        },
        'h1': {
          extends: 'h1',
        },
        'h2': {
          extends: 'h2',
        },
        'h3': {
          extends: 'h3',
        },
        'h4': {
          extends: 'h4',
        },
        'h5': {
          extends: 'h5',
        },
        'h6': {
          extends: 'h6',
        },
        'ul': {
          listStyleType: 'disc',
        },
        'ol': {
          listStyleType: 'decimal',
        },
        'a': {
          extends: 'link',
        },
        'b, strong': {
          fontWeight: theme('fontWeight.bold'),
        },
        'i, em': {
          fontStyle: 'italic',
        },
      },
    }),
  },
  variants: { // all the following default to ['responsive']
    textIndent: ['responsive'],
    textShadow: ['responsive'],
    textDecorationStyle: ['responsive'],
    textDecorationColor: ['responsive'],
    ellipsis: ['responsive'],
    hyphens: ['responsive'],
    kerning: ['responsive'],
    textUnset: ['responsive'],
    fontVariantCaps: ['responsive'],
    fontVariantNumeric: ['responsive'],
    fontVariantLigatures: ['responsive'],
    textRendering: ['responsive'],
  },
  plugins: [
    require('tailwindcss-typography')({
      // all these options default to the values specified here
      ellipsis: true,         // whether to generate ellipsis utilities
      hyphens: true,          // whether to generate hyphenation utilities
      kerning: true,          // whether to generate kerning utilities
      textUnset: true,        // whether to generate utilities to unset text properties
      componentPrefix: 'c-',  // the prefix to use for text style classes
    }),
  ],
};

This plugin generates the following utilities:

/* configurable with the "textIndent" theme object */
.indent-[key] {
  text-indent: [value];
}

/* configurable with the "textShadow" theme object */
/* note: the "default" key generates a simple "text-shadow" class (instead of "text-shadow-default") */
.text-shadow-[key] {
  text-shadow: [value];
}

/* configurable with the "textDecorationStyle" theme object */
.line-[key] {
  text-decoration-style: [value];
}

/* configurable with the "textDecorationColor" theme object */
.line-[key] {
  text-decoration-color: [value];
}

/* generated when the "ellipsis" option is set to true */
.ellipsis {
  text-overflow: ellipsis;
}
.no-ellipsis {
  text-overflow: clip;
}

/* generated when the "hyphens" option is set to true */
.hyphens-none {
  hyphens: none;
}
.hyphens-manual {
  hyphens: manual;
}
.hyphens-auto {
  hyphens: auto;
}

/* generated when the "kerning" option is set to true */
.kerning {
  font-kerning: normal;
}
.kerning-none {
  font-kerning: none;
}
.kerning-auto {
  font-kerning: auto;
}

/* generated when the "textUnset" option is set to true */
.font-family-unset {
  font-family: inherit;
}
.font-weight-unset {
  font-weight: inherit;
}
.font-style-unset {
  font-style: inherit;
}
.text-size-unset {
  font-size: inherit;
}
.text-align-unset {
  text-align: inherit;
}
.leading-unset {
  line-height: inherit;
}
.tracking-unset {
  letter-spacing: inherit;
}
.text-color-unset {
  color: inherit;
}
.text-transform-unset {
  text-transform: inherit;
}

/* configurable with the "fontVariantCaps" theme object */
.caps-normal {
  font-variant-caps: normal;
}
.caps-small {
  font-variant-caps: small-caps;
}
.caps-all-small {
  font-variant-caps: all-small-caps;
}
.caps-petite {
  font-variant-caps: petite-caps;
}
.caps-unicase {
  font-variant-caps: unicase;
}
.caps-titling {
  font-variant-caps: titling-caps;
}

/* configurable with the "fontVariantNumeric" theme object */
.nums-normal {
  font-variant-numeric: normal;
}
.nums-ordinal {
  font-variant-numeric: ordinal;
}
.nums-slashed-zero {
  font-variant-numeric: slashed-zero;
}
.nums-lining {
  font-variant-numeric: lining-nums;
}
.nums-oldstyle {
  font-variant-numeric: oldstyle-nums;
}
.nums-proportional {
  font-variant-numeric: proportional-nums;
}
.nums-tabular {
  font-variant-numeric: tabular-nums;
}
.nums-diagonal-fractions {
  font-variant-numeric: diagonal-fractions;
}
.nums-stacked-fractions {
  font-variant-numeric: stacked-fractions;
}

/* configurable with the "fontVariantLigatures" theme object */
.ligatures-normal {
  font-variant-ligatures: normal;
}
.ligatures-none {
  font-variant-ligatures: none;
}
.ligatures-common {
  font-variant-ligatures: common-ligatures;
}
.ligatures-no-common {
  font-variant-ligatures: no-common-ligatures;
}
.ligatures-discretionary {
  font-variant-ligatures: discretionary-ligatures;
}
.ligatures-no-discretionary {
  font-variant-ligatures: no-discretionary-ligatures;
}
.ligatures-historical {
  font-variant-ligatures: historical-ligatures;
}
.ligatures-no-historical {
  font-variant-ligatures: no-historical-ligatures;
}
.ligatures-contextual {
  font-variant-ligatures: contextual;
}
.ligatures-no-contextual {
  font-variant-ligatures: no-contextual;
}

/* configurable with the "textRendering" theme object */
.text-rendering-auto {
  text-rendering: auto;
}
.text-optimize-legibility {
  text-rendering: optimizeLegibility;
}
.text-optimize-speed {
  text-rendering: optimizeSpeed;
}
.text-geometric-precision {
  text-rendering: geometricPrecision;
}

The plugin also generates components for text styles. The above config example would generate something like this:

.c-h1 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 3rem;
}
@media (min-width: 640px) {
  .c-h1 {
    font-size: 4rem;
  }
}
.c-h2 {
  font-weight: 800;
  line-height: 1.25;
  font-size: 2.25rem;
}
@media (min-width: 640px) {
  .c-h2 {
    font-size: 3rem;
  }
}
.c-h3 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 2.25rem;
}
.c-h4 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1.875rem;
}
.c-h5 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1.5rem;
}
.c-h6 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1.25rem;
}

.c-link {
  font-weight: 700;
  color: #63b3ed;
}
.c-link:hover {
  color: #3182ce;
  text-decoration: underline;
}

.c-rich-text {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.625;
}
.c-rich-text > * + * {
  margin-top: 1em;
}
.c-rich-text h1 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 3rem;
}
@media (min-width: 640px) {
  .c-rich-text h1 {
    font-size: 4rem;
  }
}
.c-rich-text h2 {
  font-weight: 800;
  line-height: 1.25;
  font-size: 2.25rem;
}
@media (min-width: 640px) {
  .c-rich-text h2 {
    font-size: 3rem;
  }
}
.c-rich-text h3 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 2.25rem;
}
.c-rich-text h4 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1.875rem;
}
.c-rich-text h5 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1.5rem;
}
.c-rich-text h6 {
  font-weight: 700;
  line-height: 1.25;
  font-size: 1.25rem;
}
.c-rich-text ul {
  list-style-type: disc;
}
.c-rich-text ol {
  list-style-type: decimal;
}
.c-rich-text a {
  font-weight: 700;
  color: #63b3ed;
}
.c-rich-text a:hover {
  color: #3182ce;
  text-decoration: underline;
}
.c-rich-text b, .c-rich-text strong {
  font-weight: 700;
}
.c-rich-text i, .c-rich-text em {
  font-style: italic;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].