A small library that adds typography fixes using the typograf library to your Astro project.
npx astro add astro-typograf
Before you start using it, install the library.
npm install astro-typograf --save
Then put the integration in the Astro configuration file.
// astro.config.mjs
import { defineConfig } from 'astro/config'
import typograf from 'astro-typograf'
export default defineConfig({
integrations: [
typograf()
],
})
Additional options:
// astro.config.mjs
import { defineConfig } from 'astro/config'
import typograf from 'astro-typograf'
export default defineConfig({
integrations: [
typograf(
selector: 'p, h1, h2, h3', // CSS selectors to apply Typograf
typografOptions: { // Typograf options
locale: ['ru', 'en-US']
}
)
],
})